Wait for Webdriver Windows Count - Codoid
Select Page
Codoid Blog

Wait for Webdriver Windows Count

Irrespective of the business that your client is in, marketing is an integral part of their operations. In fact, in this day and age of social.

In this blog post, we would like to show you a snippet for ExpectedConditions.numberOfWindowsToBe method.

NumberOfWindowsToBe is a new method in ExpectedConditions class and introduced in Selenium 2.48; it waits until the expected windows count matches with actual WebDriver windows count.

WebDriver driver=new FirefoxDriver();	
WebDriverWait wait=new WebDriverWait(driver,10);
driver.get("http://google.com");

driver.findElement(By.linkText("Google")).click();

wait.until(ExpectedConditions.numberOfWindowsToBe(2));
  

Written By

Submit a Comment

Your email address will not be published. Required fields are marked *


In this blog post, we would like to show you a snippet for ExpectedConditions.numberOfWindowsToBe method.

NumberOfWindowsToBe is a new method in ExpectedConditions class and introduced in Selenium 2.48; it waits until the expected windows count matches with actual WebDriver windows count.

WebDriver driver=new FirefoxDriver();	
WebDriverWait wait=new WebDriverWait(driver,10);
driver.get("http://google.com");

driver.findElement(By.linkText("Google")).click();

wait.until(ExpectedConditions.numberOfWindowsToBe(2));