嗨我尝试使用下面的代码来使用从foodpanda网站的下拉列表,并选择城市名称,但它不适合我。下拉不与硒这个网站
public static void main(String args[]) throws InterruptedException{
System.setProperty("webdriver.chrome.driver","C:/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.foodpanda.in/restaurants/city/pune?gclid=CIbFi5iEvdMCFdeFaAodujsK5w");
Thread.sleep(5000);
WebElement drp =driver.findElement(By.id("cityId"));
Select drp2 = new Select(drp);
drp2.selectByVisibleText("Bangalore");
它给出了在线程的错误 - 异常“主要” org.openqa.selenium.ElementNotVisibleException:元素不可见:元素当前不可见,不得操纵
为什么不工作? – alayor
它说 - ElementNotVisibleException:元素不可见:元素当前不可见,可能不会被操纵 –
为什么不尝试'ExplicitWait'? – Paras