How to run webdriverio tests on firefox using wdio testRunner and wdio-selenium-standalone-service

不羁岁月 提交于 2019-12-13 20:14:06

问题


My environment:

  1. Mac OSX 10.12.6
  2. webdriverio(using the test runner i.e., wdio)("webdriverio": "^4.9.11")
  3. Cucumber framework ("wdio-cucumber-framework": "^1.0.3")
  4. Using WDIO Selenium Standalone Service help to start the selenium service automatically.("wdio-selenium-standalone-service": "0.0.10")
  5. firefox(version: 52)

I am able to successfully run the tests on chrome browser(version: 65) but when it comes to firefox i always get connection refused error.

More details:

In the wdio config file i have mentioned firefox as browserName. Once the test is started firefox launches and it stays on the "New Tab" page. It does not navigate to the URL.

After some time(like: 60 secs later), In the wdio logs i can see ERROR: connection refused. Additionally the firefox also does not quit in the end.

NOTE: The same test works fine if change the browserName to chrome.

WDIO Config file capabilities part:

...capabilities: [{

    maxInstances: 5,
    //
    browserName: 'firefox',
    marionette: true,
}],...

回答1:


Able to FIX the issue by myself after some research.

The problem is version mismatch.

The geckoDriver verison is 0.20.0 and the firefox version i was using is 52.

I upgraded the firefox to latest. i.e., version 59 and i was able to successfully run the test.

As per geckoDriver release notes of version 0.19.0

Note that with geckodriver v0.19.0 the following versions are recommended:
Firefox 55.0 (and greater)
Selenium 3.5 (and greater)

So i understood that the higher version also should have the same property.



来源:https://stackoverflow.com/questions/49987451/how-to-run-webdriverio-tests-on-firefox-using-wdio-testrunner-and-wdio-selenium

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