ElementNotVisible Exception Selenium Webdriver Java

问题描述:

I am working on a public site:

http://preview.harriscountyfws.org/

The logic shown below encounters the ElementNotVisibleException.

However, if you uncomment out the two lines that start with "//", as well as comment out the two lines above that code, the code works fine (however this is for a different dropdown than the one I want).

So I am puzzled.

I am able to select from "Rainfall in the last" dropdown just fine.

But using exactly the same method, I cannot select from the "Gage by Location" dropdown.

How do I select from the Gage by Location dropdown?

package sdfwe.sdwd.qsde;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.chrome.ChromeDriver;

public class Gfgsdrfffde {

public static void main(String[] args) {

System.out.println("Running Tests....");

// Optional, if not specified, WebDriver will search your path for chromedriver.