'How to click on an option from dropdown list in Serenity?

<div class="dropdown-1" id="account-list">1231123</div>
<div class=" css-as9hnt-menu">
    <div class=" css-11unzgr">
        <div class=" css-1wvm2z9-option" id="react-select-8-option-0" tabindex="-1">1231123</div>
        <div class=" css-kzme5w-option" id="react-select-8-option-1" tabindex="-1">1231235</div>
        <div class=" css-kzmst5w-option" id="react-select-8-option-2" tabindex="-1">1231236</div>
        <div class=" css-treme5w-option" id="react-select-8-option-3" tabindex="-1">1231237</div>
        <div class=" css-erte5rt-option" id="react-select-8-option-4" tabindex="-1">1231238</div>
    </div>
</div>

How I can click on the option with text = 1231236 from a drop-down list like above using Serenity?

I've tried this but it not working :

public void selectItemInCustomDropdown(String parentDropdownLocator, String allItemDropdown,
                                           String ExpectedText){
        $(parentDropdownLocator).click();
        waitForRenderedElementsToBePresent($(allItemDropdown)).selectFromDropdown($(allItemDropdown),ExpectedText);
    }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source