Protractor failed to start test with firefox

佐手、 提交于 2019-12-08 06:56:29

With geckodriver, you'll need to add marionette to the capabilities:

capabilities: {
    'browserName': 'firefox',
    'marionnette': true
},

UPDATE: There is a open issue #4253 introduced in Protractor 5.1.1 . The workaround is to manually replace directConnect with seleniumAddress and manually start webdriver-manager as specified in the bug:

The solution is to use selenium standalone when testing with Firefox. The latest version of the selenium standalone server is compatible with Protractor's selenium JS bindings and with geckodriver. You can update and launch the standalone server with

webdriver-manager update 
webdriver-manager start 

and set seleniumAddress: http://localhost:4444

If you are opting for directconnect then you dont need to specify the base url and don't need to start explicitly the webdriver server.

exports.config = {
    allScriptsTimeout: 11000,
    specs: [
        './e2e/**/*.e2e-spec.ts'
    ],
    capabilities: {
        'browserName': 'firefox'
    },

    directConnect: true,
    framework: 'jasmine',
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000,
        print: function() {}
    },
};

In my case, running it with 'sudo' did not work. I had to change file permissions and then ran it without sudo.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!