selenium+java提示Error communicating with the remote browser. It may have die...
本帖最后由 SunnyLan 于 2016-12-19 17:16 编辑浏览器提示“请停用以开发者模式运行的扩展程序”
package Common;
import java.util.Arrays;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.*;
//import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.WebDriver.Navigation;
public class testbaidu {
/**
* @param args
* @throws InterruptedException
*/
public static void main(String[] args) throws InterruptedException {
WebDriver driver = new ChromeDriver();
Thread.sleep(3000);
driver.get("www.baidu.com");
Thread.sleep(3000);
driver.findElement(By.id("kw")).sendKeys(new String[]{"selenium"});//
Thread.sleep(3000);
driver.findElement(By.id("su")).click();
}
}
开发者模式的浏览器? 应该跟程序无关,是浏览器自己的设置吧 搜索下,有很多设置的方式
页:
[1]