0
Googleのページを開くことはできますが、検索バーにはテキストを入力できません。私の実行は、Googleページを開いた後にのみ停止します。GoogleのページにSeleniumでデータを入力できません
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class FirePath {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
WebDriver Driver = new FirefoxDriver();
Driver.get("http://www.google.com");
//Driver.wait(50);
Driver.findElement(By.xpath(".//*[@id='gs_htif0']']")).sendKeys("some text");
//Driver.findElement(By.cssSelector(".gb_P")).click();
//Driver.findElement(By.xpath("html/body/nav/div/a[1]")).click();
}
}
idとして 'lst-ib'を使用します。 –