Selenium: How to wait for options in a select to be populated?

后端 未结 9 1777
温柔的废话
温柔的废话 2020-12-14 18:14

I am using Selenium for the first time and am overwhelmed by the options. I am using the IDE in Firefox.

When my page loads, it subsequently fetches values via an JS

9条回答
  •  执念已碎
    2020-12-14 18:42

    Its work for me:

      WebElement element = driver.findElement(By.xpath("//select[@name='NamE']/option[1]"));
      return element.getAttribute("text");
    

提交回复
热议问题