Von Dropdown kann ich den Wert aus Dropdown nicht auswählen.Fehler beim Selektieren des Dropdown-Wertes in selen webdriver
HTML-Code:
<select id="ctl00_ContentPlaceHolder1_drp85" class="form-control select2-hidden-accessible" data-varindex="9" onchange="SetVariableValue('9', this, 'DESCENDANT - DROPDOWN')" name="ctl00$ContentPlaceHolder1$drp85" tabindex="-1" aria-hidden="true">
<option value="-1">--Select--</option>
<option value="Please don't hesitate">Please don't hesitate </option>
<option value="Please reach out to us">Please reach out to us</option>
<option value="Remember we are here for you">Remember we are here for you</option>
<option value="If you need help">If you need help</option>
<option value="If you ever need additional help">If you ever need additional help</option>
</select>
Selen WebDriver Code:
WebElement dropdown = driver.findElement(By.id("ctl00_ContentPlaceHolder1_drp85"));
selectbyindex=new Select(dropdown);
selectbyindex.selectByIndex(1);
Erste Ausnahme als:
Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: element not visible: Element is not currently visible and may not be manipulated".
Kann mir jemand helfen, wo ich Fehler mache?
Die 'Option-value' nicht sichtbar sein, wenn Sie darauf klicken. Versuchen Sie es mit der Methode 'click()', bevor Sie selectByIndex() verwenden. Wenn dies nicht funktioniert, versuchen Sie "warten", bis das Dropdown-Menü tatsächlich sichtbar ist, bevor Sie versuchen, die Optionen auszuwählen. – Chaitali