Google搜索定位的元素不起作用

时间:2017-12-11 10:32:51

标签: selenium selenium-webdriver

  DesiredCapabilities capabilities = DesiredCapabilities.chrome();
  capabilities.setCapability("marionette", true);
  String baseUrl = "https://www.google.co.in/?gfe_rd=cr&dcr=0&ei=SiwuWq0Rx5xfj9ug2Aw";
  System.setProperty("webdriver.gecko.driver", "D:\\Geco\\geckodriver\\geckodriver.exe");
  driver=new ChromeDriver(capabilities);
  driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
  driver.get(baseUrl);
  driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
  //driver.findElement(By.id("lst-ib")).sendKeys("test");
  driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

尝试使用selenium网络驱动程序搜索谷歌搜索按钮,但它无法正常工作。

0 个答案:

没有答案