Hi Ryan! Very well explained and structured course.... I find it excellent :) I have a question when it comes to run tests in parallel, in my case I would like to do the tests but in different environments ... I mean, assign a URL to each test that runs the same automated sequence .... This is possible with selenium, right? Thank you very much for everything
Hey there, Thank you for your kind feedback! Yes, running tests in parallel across different environments with different URLs using Selenium and Mocha is feasible. Using LambdaTest: Setup: Create an account on LambdaTest and get your access key. Configuration: In your test setup, configure Selenium to connect to LambdaTest's hub using your credentials. URLs and Environments: Assign different base URLs to your tests. Use LambdaTest's capability selector to choose the browsers and OS environments you need. Parallel Execution: LambdaTest supports parallel test execution, so multiple tests can run simultaneously on different environments. Ensure your tests are independent for consistent results when run in parallel. Best,
Hey there 👋 In many cases, simply passing --parallel to the mocha executable is enough to enable parallel test mode. You can customise running parallel according to spec file you want to run in parallel. For eg: "mocha --parallel test/*.spec.js"
Hi Amir, The parallelization is done at spec (file) level so if you have 2 x files each with a different set of tests then it’s likely to start running tests for both files at the same time. Given this, it’s difficult to predict the exact order tests will run in as it depends on which tests are completed first and which files are available next for mocha to pick up. Tests inside files are run in the order they’re listed. It’s good practice not to need to rely on order, each test should be able to be run independently without relying on any other test. Hope this helps!
Hi Ryan, thanks for the great video. can we set the instances?
Hi Ryan! Very well explained and structured course.... I find it excellent :)
I have a question when it comes to run tests in parallel, in my case I would like to do the tests but in different environments ... I mean, assign a URL to each test that runs the same automated sequence .... This is possible with selenium, right?
Thank you very much for everything
Hey there,
Thank you for your kind feedback!
Yes, running tests in parallel across different environments with different URLs using Selenium and Mocha is feasible.
Using LambdaTest:
Setup: Create an account on LambdaTest and get your access key.
Configuration: In your test setup, configure Selenium to connect to LambdaTest's hub using your credentials.
URLs and Environments: Assign different base URLs to your tests. Use LambdaTest's capability selector to choose the browsers and OS environments you need.
Parallel Execution: LambdaTest supports parallel test execution, so multiple tests can run simultaneously on different environments.
Ensure your tests are independent for consistent results when run in parallel.
Best,
How can we limit the parallel execution of tests? Such as execute 2 or 3 tc in parallel
Hey there 👋
In many cases, simply passing --parallel to the mocha executable is enough to enable parallel test mode.
You can customise running parallel according to spec file you want to run in parallel.
For eg: "mocha --parallel test/*.spec.js"
Is it run alphabetically ? because I have two classes "Login, Cart", and I want to run login first, but it run cart first then login
Hi Amir,
The parallelization is done at spec (file) level so if you have 2 x files each with a different set of tests then it’s likely to start running tests for both files at the same time. Given this, it’s difficult to predict the exact order tests will run in as it depends on which tests are completed first and which files are available next for mocha to pick up.
Tests inside files are run in the order they’re listed. It’s good practice not to need to rely on order, each test should be able to be run independently without relying on any other test.
Hope this helps!
so it took 19sec originally and 23sec when you ran in parallel?
Hey Tony, Let us get back to you