Question

Is there anyone know how to read FireFox Browser Status bar text using Selenium WebDriver? I want it because I want to know whether my entire webpage is loaded completely or not.

Please suggest me if there is another way to do. Calling any JavaScript (which will be returning me Firefox Status bar text from my Java program)?

Also, how can I verify the presence of webelement I am looking on the webpage?

Thanks!

Was it helpful?

Solution

I don't think that there is a way to read the FireFox Status bar using WebDriver.

When you do webdriver.get(), it will wait until the “onload” event has fired before returning control to your test or script. However, that might not be good enough if your page uses a lot of AJAX to load content on your page and the "onload" event fires while stuff is still showing up in the browser.

If you need to ensure such pages are fully loaded then the solution is to use “waits”.

You can wait for a particular element:

Wait<WebDriver> wait = new WebDriverWait(driver, 10);
wait.until(visibilityOfElementLocated(By.id("target"))); 

see: http://seleniumexamples.com/blog/examples/selenium-2-examples/

Or try to wait for Ajax to complete any pending requests:

see: http://blog.activelylazy.co.uk/2010/05/05/testing-asynchronous-applications-with-webdriver/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top