0

So i have perform some times tests using Selenium:

My page have simple Drop Down List and from this Element i am selecting different value and wait until the next page will load and calculate the time that this operation took and again try to load different value from this Drop Down List. So in some values this took a loot of time (because the page need to load many thing) so in this case sometimes this lead into white screen and in this case i want to specify that this is TimeOut so my question is how to recognise that this white screen appears when i cannot expect to any WebElement on this white screen.

Nuz reel
  • 19
  • 3
  • After selecting any value from dropdown add a expected wait condition to verify for a web element to be displayed on the next page.if the web element is not dispayed after mentioned time selenium will throw an exception and you can catch it using try catch. Have a look at below sample code. WebDriverWait wait = new WebDriverWait(webDriver, timeoutInSeconds); wait.until(ExpectedConditions.visibilityOfElementLocated(By.id)); or – Sudharsan Selvaraj Jun 09 '16 at 09:56
  • I am using this wait in any element i want to fine with specific conditions but in this case i want to recognise browser timeout – Nuz reel Jun 09 '16 at 10:01

1 Answers1

0

You can waitForCondition to wait until a particular javascript condition is true. There's also other waitForX convenience methods.

https://www.neustar.biz/blog/selenium-tips-wait-with-waitforcondition

Note: If using jQuery you can wait for "jQuery.active == 0"

wait for an ajax call to complete with Selenium 2 web driver

Community
  • 1
  • 1
lance-java
  • 25,497
  • 4
  • 59
  • 101
  • I am using this wait in any element i want to fine with specific conditions but in this case i want to recognise browser timeout – Nuz reel Jun 09 '16 at 10:03