Webdriver.io crashes with NoSessionIdError

前端 未结 2 824
旧巷少年郎
旧巷少年郎 2020-12-17 02:54

I\'m trying to get webdriver.io and Jasmine working.

Following their example, my script is at test/specs/first/test2.js (in accordance with the configur

相关标签:
2条回答
  • 2020-12-17 03:22

    Please check out the docs on the wdio test runner. You don't need to create an instance using init on your own. The wdio test runner takes care on creating and ending the session for you.

    Your example covers the standalone WebdriverIO usage (without testrunner). You can find examples which use wdio here.

    To clarify that: there are two ways of using WebdriverIO. You can embed it in your test system by yourself (using it as standalone / or as a scrapper). Then you need to take care of things like create and end an instance or run those in parallel. The other way to use WebdriverIO is using its test runner called wdio. The testrunner takes a config file with a bunch of information on your test setup and spawns instances updates job information on Sauce Labs and so on.

    0 讨论(0)
  • 2020-12-17 03:31

    Every Webdriver command gets executed asynchronously. You properly called the done callback in afterEach and in your test it test, but forgot to do it in beforeEach:

    beforeEach(function(done) {
        client = webdriverio.remote({ desiredCapabilities: {browserName: 'firefox'} });
        client.init(done);
    });
    
    0 讨论(0)
提交回复
热议问题