我无法在内部网络中运行硒代码

时间:2018-07-04 07:07:37

标签: selenium-webdriver

我已经设置了硒webdriver来测试网站,但是在使用内部网络时无法运行它(外部是正常的)。其他同事正常使用内部网络。 我已经重新安装了macOS,但无法正常工作。

下面是我的简单代码:

    public static void main(String[] args) {

    System.setProperty("webdriver.chrome.driver","/Users/dailv/eclipse-workspace/WebDriver/chromedriver");
    WebDriver driver = new ChromeDriver();
    driver.get("https://google.com");
    System.out.println("Successfully opened the website");

使用内部网络时的响应问题:

Starting ChromeDriver 2.40.565386 (45a059dc425e08165f9a10324bd1380cc13ca363) on port 33141

仅允许本地连接。 线程“主” org.openqa.selenium.SessionNotCreatedException中的异常:会话未创建异常 断开连接:无法连接到渲染器

谢谢

0 个答案:

没有答案