We are using Seleniumquery-0.19.0 for our selenium tests.
we noticed that $.url() is not waiting for page to load completely. I also tried $.driver().get().navigate().to(url);.
our Scenario,
- open the page.
- search for login controls i.e user and password text box
- fill value and click on submit button.
In the test result we found that selenium is not able to find the Username text box. we tried with
- waits i.e. $("*[id='login.username']").waitUntil(5000).isPresent();
- timeouts i.e. $.driver().get().manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS);
static void waitForPageLoad(final WebDriver wdriver) { final WebDriverWait wait = new WebDriverWait(wdriver, 600);
final Function<WebDriver, Boolean> pageLoaded = new Function<WebDriver, Boolean>() { @Override public Boolean apply(final WebDriver input) { final Boolean result = ((JavascriptExecutor)input).executeScript("return document.readyState").equals("complete"); LOG.info("Status of the Page : " + result); return result; } }; wait.until(pageLoaded);
}