Mastering Parallel Execution: Overcoming Challenges in Selenium Testing || TestNG
Вставка
- Опубліковано 25 січ 2024
- Hello Everyone,
Welcome to my channel PrinceAutomationDestination.
🚀 Parallel Execution Challenges & Resolution in TestNG:
📌 Parallel Execution is one of the important aspect of Test Automation framework as it helps in achieving quick execution.
As a result it become important Interview question to Automation Engineers. So, Today's topic is parallel Execution challenges and resolution in TestNG Framework.
📌 How do you achieve parallel Execution in your TestNG based Automation Framework
Answer from most of people is:
1. provide parallel = methods|tests|class
2. provide thread-count=2|3|4|5
But are not aware about, How thread safety is being taken care i.e. how to avoid interference of parallelly executing Threads.
📌 Challenges with Automation Implementation:
✅ We need a single isolated driver per Thread and by default when we create static/Singleton driver instance, it is not Thread Safe
So, We get Thread Interference and as a result we get uneven results of execution and come across following errors
1. NullPointerException
2. SessionNotCreated
3. NoSuchElementException
4. and So On
📌 BIG Question is: How to resolve it
✅ There is a concept of Thread Local Class in Java using which we can store the value of variable for each thread and same thread would be able to retrieve it and thus avoid interference of threads.
✅ So we are going to use the same concept in case of Parallel Execution by creating Thread Local Instance for both static as well as Singleton Instances
Link to Repo:
github.com/prnbtr09/parallelE...
Singleton Design Pattern:
• Unlocking Efficiency: ...
Regards,
PrinceAutomationDestination - Наука та технологія
This is one of the hidden gem on TestNg with parallel execution challenges. Nicely explained . Hats off
Thanks buddy
Is there similar content for test data management , test report management for parallel execution.
Not so far but I will try creating soon
@@PrinceAutomationDestination ok thanks for the consideration . I think the test data supply via data providers or json should be thread safe . Else it will create a issue in parallel executions . The same applies to reporting as well when we are using extent report or allure .. All should be thread safe
Awaiting your video for the above mentioned challenges.
Very good explaination in detail with working code...Cheers
Thanks
Thank you for sharing this fascinating video; I hope this is the finest explanation.
Thanks
Prince great content. no words to express...love you man
Thanks
Very well Explained Prince Sir..!
Thanks Atul
Very nicely explained tutorial Sir, thank you very much !!
Welcome
Good explanation ❤
As per my opinion for better understanding any topic start with new project then easy to fallow up your code
Thank You
Thanks Rahul, will surely do so. Let us connect on linkedin and discuss more:
www.linkedin.com/in/prince-kumar-7b389a68?
Well documented content
Thanks Soumya
Good explanation
Thanks
Great explanation
Thanks 🙏🏼
Great Content Man !!!!
🙏🏼 Thanks buddy
Thanks for the clear cut explanation 👍🏻👍🏻
Welcome 🤗
Thanks for the clear cut explanation
Welcome
Great explanation 🎉
Thanks
Very good explanation 👏
Thanks buddy
Good explanation, would like to see more videos on your playlist
Thanks Nikhil, for sure please checkout my other videos i will add some more here in this playlist soon
Post a video on Crossbrowser testing with some realtime examples sir
Sure will post
www.linkedin.com/in/prince-kumar-7b389a68?
Let us connect on LinkedIn
Thank you for this video, I also use singleton trying your example but my tests are failed
Have you used thread local or let us connect at telegram
t.me/+dSqXNMdtm0wxOTRl
@@PrinceAutomationDestination yes, I used
Hi
Can you please suggest similar examples using junit also!? How the code you have written should work with junit !?
And thanks for the clear n precise explanation 🙏
Junit 5 ?
@@PrinceAutomationDestination yes please
Sure
is it possible to assign returning driver value from singelton class to normal driver like this from test case having class.
Webdriver driver = CrrateDriver.getInstance.getDriver();
is this approach fine to use driver reference variable in side test class
Yes
@@PrinceAutomationDestination Can you share your GitHub link sir
github.com/prnbtr09/parallelExecutionChallengesTestNG
Sure