There was an error in this gadget

Technical Project Lead @ Huawei Technologies

My photo
Bangalore/Hyderabad, Karnataka/Andhra Pradesh, India
Have an overall 10 + yrs of experience Currently working as an Senior Architect.Expertise in design,implementation of Automation frameworks for Opensource automation tools like Selenium,Jmeter, Webdriver,Appium, Robotium Expertise in integrating Test & ALM Management tools like Rally,Qmetry,JIRA-Zephyr with Automation frameworks Expertise in design and developmenet Mobile Automation frameworks for tools like Appium, Robotium Remote Control,Cucumber BDD


Saturday, August 10, 2013

How to verify Google Search List Options using Selenium RC/ Webdriver

Below is the snippet for list the google search list options using both Selenium RC and web driver

package selenium;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import com.thoughtworks.selenium.Selenium;

public class GoogleTests {
    static WebDriver driver;
    public static void main(String[] args) throws InterruptedException {
        driver = new FirefoxDriver();
        driver.findElement(By.xpath("//input[@type='text']")).sendKeys("Selenium webdriver");
         // Selenium Code to print all the options from the dropdown suggestionlist
        Selenium selenium = new WebDriverBackedSelenium(driver,
        System.out.println("Below list is printed by Selenium RC");
        int listCount = selenium.getXpathCount(
        for (int i = 1; i < listCount; i++) {
            String listValues = selenium
                    .getText("//table[@class='gssb_m']/tbody/tr[" + i
                            + "]/td[1]/div/table/tbody/tr[1]/td[1]/span");
        // Webdriver Code to print all the options from the dropdown suggestion list
        System.out.println("Below list is printed by Webdriver");
        List<WebElement> options = driver.findElements(By
        for (WebElement webElement : options) {
        // driver




  1. Fantastic article ! You havemade some very astute statements and I appreciate the the effort you have put into your

    writing. Its clear that you know what you are writing about. I am excited to read more of your sites content.

    Microsoft dynamics training

  2. Valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!!
    Hadoop training

  3. Hi Kiran,
    We have requirement like as soon as the application build deployment has been done, need to execute my jenkin jobs automatically.
    Please suggest me on this.


    1. Hi Mahesh, You can do the Jenkins integration by having your Selenium Project with Ant/Maven and its just few steps to setup Jenkins