org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话

时间:2016-12-26 06:58:40

标签: selenium selenium-grid

我正在尝试设置selenium网格。并按照以下步骤操作: -

1)在Windows 10(32位)上启动集线器: - java -jar“独立jar的路径”-role hub -port 4444

2)在Ubuntu14.04(64位)上启动节点: - java -jar“独立jar的路径”-role webdriver -port 5555 -hub“http:// ip of windows PC:4444 / grid / hub”

节点和集线器已成功启动。但问题是,当我尝试执行以下脚本时,它会抛出异常“org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话”请查看以下代码: -

public class gridclass
{
    public static void main(String[] args)
  {
    System.setProperty("webdriver.gecko.driver","Path to/geckodriver");
    WebDriver wd=null;
    try
    {   
        DesiredCapabilities desire = DesiredCapabilities.firefox();
        wd = new RemoteWebDriver( new URL("http://path to hub URL/grid/hub"), desire);
    } 
    catch (MalformedURLException e)
    {
        e.printStackTrace();
    }
    wd.get("http://www.google.com");
    wd.close();
    wd.quit();
 }
}

我在Windows 10上编写的上述代码(即在集线器上)。这是正确的方法吗?

如果正确且代码正确则如何解决org.openqa.selenium.SessionNotCreatedException。  在这种情况下请帮助我。

0 个答案:

没有答案
相关问题