Protractor gives “Unable to start a WebDriver session” error

前端 未结 2 617
野的像风
野的像风 2020-12-19 05:56

I already have started a server with webdriver-manager start, but I get this error when I try to run protractor:

Using the selenium server at ht         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-19 06:55

    I generated code using JHipster and had similar error where e2e was not working. I provided binary path. But upon npm run e2e the browser opened and displayed data; in the address bar.

    I shuffled and provided the binary at the end of chromeOptions after the args and it worked.

    capabilities: {
            browserName: 'chrome',
            chromeOptions: {
                args: process.env.JHI_E2E_HEADLESS
                    ? [ "--headless", "--disable-gpu", "--window-size=800,600" ]
                    : [ "--disable-gpu", "--window-size=800,600" ],
                binary: "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
            }
        }
    

    Note: I also had to update the chrome version when an unsupported webdriver version error occurred.

提交回复
热议问题