Basic Info: Selenium WebDriver, Eclipse, Java, Firefox Driver
I'm receiving this error:
`
Exception in thread "main" org.openqa.selenium.ElementNotVisibleException:
Build info: version: 'unknown', revision: '5234b32', time: '2017-03-10 09:00:17 -0800'
System info: host: 'MILTON-MENDIETA', ip: '10.77.60.197', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=C:\Users\Milton\AppData\Local\Temp\rust_mozprofile.POZZHDGnD1QQ, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=52.0.2, platformVersion=10.0, moz:processID=14868, browserName=firefox, platformName=windows_nt}]
Session ID: 3172ee71-f22c-4699-a723-3c27a87c6ce5
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:133)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:99)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:43)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:274)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)
`
This happens as soon as the I land on the page, after calling get().
Here is the code I have to wait for the element to be visible:
WebDriverWait wait = new WebDriverWait(driver, 20);
for(int counter = 25; counter < 50; counter++){
// Navigate to Site
driver.get("https://sandbox.webcomserver.com/wpm/adminHome.do?&tenantName=walkme_test");
//Wait for SmartTip to be visible
// wait.until(ExpectedConditions.visibilityOfElementLocated((By.cssSelector("a#helpLink"))));
//Wait for Widget to be visible (Could be a method? MyClass.openWidget() ?
wait.until(ExpectedConditions.visibilityOfElementLocated((By.id("walkme-player"))));
driver.findElement(By.id("walkme-player")).click();
//Start Add Status to WorkFlow WT
wait.until(ExpectedConditions.visibilityOfElementLocated((By.cssSelector("div.walkme-walkthru-219559"))));
driver.findElement(By.cssSelector("div.walkme-walkthru-219559")).click();
//Wait for Step (Hover over Workflows) to be visible
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("walkme-balloon-2412584")));
It gives me the error as soon as the page loads. Should it not be waiting 20 seconds before throwing the error?
I've tried using different selectors such as className, cssSelectors, and id.
HTML Snippet:
<div id="walkme-player" class="walkme-player walkme-colorado walkme-theme-white-green walkme-direction-ltr walkme-notie walkme-position-major-bottom walkme-position-minor-right walkme-dynamic-size walkme-to-destroy walkme-override walkme-css-reset walkme-language-default" style="display: block; bottom: 0px;" data-inanimation="0">
<div class="walkme-in-wrapper walkme-override walkme-css-reset" style="width: 154px;">
<div class="walkme-question-mark walkme-override walkme-css-reset"></div>
<div class="walkme-title walkme-override walkme-css-reset">Need help?</div>
</div>
</div>
I'm pretty sure it's just evaluating it as not visible before the element loads because it occasionally works. I've even tried adding an implicit wait, thread.sleep(), and it still doesn't wait. Not sure what else to do.