Skip to main content

Questions

How do I do this with Selenium Web DriverMy test steps are-

a) go to google.com b) in the search box start typing a keyword example "IBM" c) google displays all the matching results d) Get the count of matching results in a List of strings

  • a) go to google.com
  • b) in the search box start typing a keyword example "IBM"
  • c) google displays all the matching results
  • d) Get the count of matching results in a List of strings.

for (a), (b) I have:-

System.setProperty("webdriver.chrome.driver", "C:\\Work\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.get("http://www.google.com");
        WebElement element = driver.findElement(By.name("q"));
        element.sendKeys("IBM");

System.setProperty("webdriver.chrome.driver", "C:\Work\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("http://www.google.com"); WebElement element = driver.findElement(By.name("q")); element.sendKeys("IBM"); How doThe Question is how I do (d)?

Questions

How do I do this with Selenium Web Driver

a) go to google.com b) in the search box start typing a keyword example "IBM" c) google displays all the matching results d) Get the count of matching results in a List of strings

for (a), (b) I have

System.setProperty("webdriver.chrome.driver", "C:\Work\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("http://www.google.com"); WebElement element = driver.findElement(By.name("q")); element.sendKeys("IBM"); How do I do (d)

My test steps are-

  • a) go to google.com
  • b) in the search box start typing a keyword example "IBM"
  • c) google displays all the matching results
  • d) Get the count of matching results in a List of strings.

for (a), (b) I have:-

System.setProperty("webdriver.chrome.driver", "C:\\Work\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.get("http://www.google.com");
        WebElement element = driver.findElement(By.name("q"));
        element.sendKeys("IBM");

The Question is how I do (d)?

Source Link

How Do I iterate through all the search results in Selenium returned by google search

Questions

How do I do this with Selenium Web Driver

a) go to google.com b) in the search box start typing a keyword example "IBM" c) google displays all the matching results d) Get the count of matching results in a List of strings

for (a), (b) I have

System.setProperty("webdriver.chrome.driver", "C:\Work\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("http://www.google.com"); WebElement element = driver.findElement(By.name("q")); element.sendKeys("IBM"); How do I do (d)