The following is the snippet of WebDriver code using Java:
WebDriver driver = new FirefoxDriver();
driver.get(\"http://www.google.pl/\");
@user729076: The xpath "//html/body/div[2]/span/center/form/table/tbody/tr/td[2]/div/div/input" you wrote for google text field is not right. The HTML for google text field is as follows:
Based on the above HTML, you can use simply id or xpath as below: By id:
driver.findElement(By.id("gbqfq")).sendKeys("some text");
By xpath:
driver.findElement(By.xpath("//input[@id='gbqfq']")).sendKeys("some text");