3

The following script works, however, it appears that when an error occurs in one test, it will cause all the other ones to fail as well. How do you make it so that they will run independently of each other?

var combos = [
['Windows 7', 'firefox'],
['Windows 7', 'chrome'],
['Windows 7', 'iexplore'],
['Windows 7', 'opera'],
['Windows 8', 'firefox'],
['Windows 8', 'chrome'],
['Windows 8', 'iexplore'],
['Windows 8', 'opera']
];

combos.forEach(function(currentValue) {
var options = {
    desiredCapabilities: {
        browserName: currentValue[1],
        platform: currentValue[0]
    },
    host: 'ondemand.saucelabs.com',
    port: 80,
    user: [redacted],
    key: [redacted],
    logLevel: "verbose"
};

    var webdriverio = require('webdriverio');
    var client = webdriverio
    .remote(options)
    .init()
    .url('http://google.com')
    ...

});
2
  • You might want to try looking at the new multiremote function that was added in Webdriverio v3 Commented Aug 18, 2015 at 21:17
  • multiremote is not intended for parallel testing. Please check out the new wdio test runner webdriver.io/guide/testrunner/gettingstarted.html . It allows you do specify capabilities as an array. They will get executed in parallel then Commented Aug 20, 2015 at 15:23

1 Answer 1

1

Adding Try-Catch to your test should solve this:

try {
    var webdriverio = require('webdriverio');
    var client = webdriverio
    .remote(options)
    .init()
    .url('http://google.com')
    ...
}
catch(err) {
    //log the error
} 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.