I have used the example from : https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs#defining-multiple-flows
and trying to run the test parallelly so that each browser will be concurrently executed. Here is the script:
const {Builder, By, Key, until} = require('selenium-webdriver');
var browsers = [
{ browserName: 'chrome' },
{ browserName: 'firefox'},
];
browsers.map(browser => {
describe('Google Search', function() {
let driver;
beforeEach(async function() {
driver = await new Builder().forBrowser(browser.browserName).build();
}, 10 * 1000);
afterEach(async function() {
await driver.quit();
});
it('example', async function() {
await driver.get('https://www.google.com/ncr');
await driver.manage().setTimeouts({ implicit: 5000 })
await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
}, 10 * 1000);
});
});
My knowledge in jest/jscript is limited. Apologies if there is anything fundamentally wrong.
I have tried both running locally and running against zalenium. In both cases, tests are running sequentially.
Thank you for the Help in making the script run parallelly.