Parallel execution - Selenium C# NUnit #4634
-
Hello guys, hope youre ok! Regards! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Is there a small code sample you can share so we can see what you've tried, along with the version of NUnit Framework you're using? Without knowing how you've setup your project, and without much internal knowledge of selenium, a few general tips I can give which may help: Try focusing on parallelizing just a small part of the suite first, perhaps just on a single class with multiple contained tests. If your tests are setup in a way which shares state (such as an instance of the Selenium driver stored at class-level) then your tests may be failing if two tests running at the same time are issuing commands to the same instance. This can be avoided in a few ways, but the simplest is to apply the |
Beta Was this translation helpful? Give feedback.
-
Hi, Could you please help anyone, I want to setup a parllelscope dynamically. declare parlleliza is true and parllelscope in app settings. i want to setup parllelscope dynamically. but i couldn't. i am using below code |
Beta Was this translation helpful? Give feedback.
Happy to help @ivanlgarcia28 .
Based on your current setup you are storing the webdriver instance in a static variable which means it will be shared with all the tests that access it. If you're running into issues with this setup only when your tests run in parallel then it may help to have an instance of the
IWebDriver
class per test. Perhaps something like below would help ensure each test works on a different instance of Selenium so that operations from one test don't interfere with another running at the same time.I'd recommend also updating to the latest versions of
Selenium.WebDriver
if you can to ensure you're using any of the latest bugfixes. Your sample uses 4.14 but the latest …