0
我在點擊註冊標籤後顯示用戶選擇的下拉菜單。但使用硒我不能選擇任何選項。硒中下拉菜單的選擇選項
driver.findElement(By.id("signup")).click();
WebDriverWait wait = new WebDriverWait(driver,15);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Select drop = new Select(driver.findElement(By.id("user_type_select")));
drop.selectByIndex(2);
註冊選項卡出現,但未選擇下拉菜單。有任何想法嗎?
請提供[mcve] – charlietfl
隱式等待是指元素存在,但不保證可點擊性或某些行爲。沒有你想要自動化的頁面,很難說 - 例如[jqueryui.selectmenu](https://jqueryui.com/selectmenu/)隱藏了原來的'select' - 存在但是從不可見 - 並且用一組包含嘲笑選擇的事件處理程序的節點替換它,所以[可能有麻煩自動化](http://stackoverflow.com/questions/28947955/how-to-automate-jqueryui-selectmenu-with-selenium-web-driver-selenium-ide)。其他js UI庫可能會出現不同的問題。 –
@Amarendra,請跟蹤任何堆棧跟蹤? –