I have a dynamic lookup salesforce component on the webpage.
<input lightning-basecombobox_basecombobox="" id="input-19" type="text" role="textbox" autocomplete="off" placeholder="Search undefined..." maxlength="255" aria-autocomplete="list" required="" class="slds-input slds-combobox__input" aria-controls="dropdown-element-19" data-position-id="lgcp-1000001" aria-describedby="help-message-18">
After I type first 3 letters, the options are displayed dynamically and I have to select the option. This is the HTML code for the component after selection:
<input lightning-basecombobox_basecombobox="" id="input-19" type="text" role="textbox" autocomplete="off" placeholder="Bandra West Branch" maxlength="255" required="" class="slds-input slds-combobox__input slds-combobox__input-value" aria-controls="dropdown-element-19" data-position-id="lgcp-1000007" aria-describedby="help-message-18" readonly="">
And this is my Selenium-Java code for selecting the value:
wait.until(ExpectedConditions.visibilityOf(newLoanObj.txtBranch()));
newLoanObj.txtBranch().sendKeys(data.get("Branch"));
Thread.sleep(2500);
newLoanObj.txtBranch().sendKeys(Keys.ARROW_DOWN);
newLoanObj.txtBranch().sendKeys(Keys.ENTER);
Now, the problem is the dynamically populated options takes time to populate and I can not get the locator for the options displayed after sending the key values. Thus I cant use wait for the options to appear. So I am forced to use thread.sleep in this case. So my script fails sometime if the options are not populated within the specified time. So what is the way out to avoid using thread.sleep and still wait till the options are populated after send keys and continue script execution without failures?
