Selenium Framework - Part 7 - Fixing Parallel execution issues in Selenium -Thank you Thread Local

  Рет қаралды 20,681

Testing Mini Bytes

Testing Mini Bytes

Күн бұрын

Пікірлер: 78
@Udzial
@Udzial Жыл бұрын
Awesome from simple to expert level everything in one video. Since i have seen your java 8 series video. All of the last part Anonymous inner class etc made proper sense. Thanks for taking automation to another level.
@gayathrivr
@gayathrivr 2 жыл бұрын
Tons of thanks for your video I finally sorted out my issue.
@jaysree3678
@jaysree3678 3 жыл бұрын
Great Content to understand Thread local. Setting Initital value using Thread local is a new thing I learned today. Waiting to learn more new concepts.
@nagarajsastry3887
@nagarajsastry3887 3 жыл бұрын
Thank you for the detailed explanation on LocalThread class, able to achieve with cross browser using TestNG and ThreadLocal
@madhureddy8456
@madhureddy8456 3 жыл бұрын
thanks for the detailed explanation on LocalThread I tried many videos, but you explanation is best
@ashteshdiwakar276
@ashteshdiwakar276 3 жыл бұрын
Thank you soo much for knowledge sharing. This is really some advance things which i had no idea about. Really glad to checkout this channel. Keep up the good work.
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Glad you liked it. Please check out the other videos as well.
@ctacts
@ctacts 4 ай бұрын
It is very well explained with examples
@sumitrawat9323
@sumitrawat9323 3 жыл бұрын
Thank you for the video. Helped a lot.
@sunilkumarakumalla1265
@sunilkumarakumalla1265 3 жыл бұрын
Amazing content Keep going @Amuthan Sakthivel... One query Around Threadcount & Parallel execution. you have created one test method each in both Home and login classes and tried to give the thread-count as 2 with parallel on methods which is working fine but when you try to add one more method in either home or login classes then it will either skip or failing the test. since it is already closing the driver and not able to find the driver instance. when i change the thread count to >2 then it is working fine. Please check and explain a bit if we have more than one method for a class. Thanks in advance :)
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Ha ha !! Good catch. I forget to update driver to DriverManager.getDriver() in if condition, that would have caused the issue. I already noted that. We will go one more round of fixing small issue in the next video!!
@sunilkumarakumalla1265
@sunilkumarakumalla1265 3 жыл бұрын
I have updated it with drivermanager.getdriver and it's working fine now 👍🏼
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
@@sunilkumarakumalla1265 It will be covered in next video anyways!!. I am glad you are learning well!!
@ashishuniyal3429
@ashishuniyal3429 3 жыл бұрын
I faced similar issue, I had to comment out everything to get to the actual issue. Thanks Sunil Kumar and Amuthan Sakthivel
@avikroychoudhury3858
@avikroychoudhury3858 3 жыл бұрын
Thanks Amuthan for the clear explanation. Waiting for the next videos :)
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Keep watching mate !!
@boss6378
@boss6378 3 жыл бұрын
Hey ur videos are very informative .Keep it up!! Also i have 1 question why are u using static web driver ?if u want to run them in parallel just declare them public WebDriver driver?it works?
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Hi Boss, I am glad that you find this video useful. May i request to you to watch the part 5 and part 6 to understand why i cannot use public webdriver driver.. If you have time please watch the whole series so you can understand everything clearly. I am sure you ll enjoy the learning 😄
@boss6378
@boss6378 3 жыл бұрын
@@TestingMiniBytes I know with static webdriver we are facing some issues and thats why you use ThreadLocal.I want to say that if we declare our webdriver as public WebDriver driver.Then all our testcase will run without any issue.
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
@@boss6378 if you use without static you are creating lot of variables at the end. If you want to run more tests in parallel then you also need to think about memory management. When there is easy and efficient way we need to use that.
@Payazee
@Payazee 3 жыл бұрын
13:15 will it unload all the thread execution even if some thread are slow and still executing?
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
remove method should be called at the end to remove the value safely
@Payazee
@Payazee 3 жыл бұрын
@@TestingMiniBytes cool, learned new concept :) nice indepth concept covered
@ameeruddin9986
@ameeruddin9986 3 жыл бұрын
Awesome video....go ahead and post more videos
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Thank you. More videos coming soon !!
@Payazee
@Payazee 3 жыл бұрын
10:07 so here two driver instance are created for parallel execution?
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Thread local will create two different copies for two different threads
@raghavendrabk8360
@raghavendrabk8360 Жыл бұрын
Hi Amuthan, Thanks for this video, instead of using a static webdriver is it not good to use a nonstatic webdriver and use dependency injection (pico container) and share the driver instance between different classes.
@shreeyabhosale1456
@shreeyabhosale1456 3 жыл бұрын
this really good content.Thanks
@shashank.pandey
@shashank.pandey 3 жыл бұрын
Hi Amuthan, Your videos are informative. I have one question it is giving null pointer exception for one of the test when I am not adding parallel parameter in TestNG but using threadlocal variable in classes.
@shashank.pandey
@shashank.pandey 3 жыл бұрын
it got resolved after changing the if condition...thanks
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Hi Shashank, I am glad that you liked my content. Are you following the series from the start if not could you please spare some time to watch part 5 and Part 6 of this selenium framework series to understand this issue in detail. I cannot comment on your question without seeing the code or other meta info. I would request you to watch the series from part I to the end which can give you lot of knowledge to solve all these issues by yourself. Happy learning 😄
@samarthjain5170
@samarthjain5170 3 жыл бұрын
Hi Amuthan, Why r we creating threadlocal driver as static?
@shanthkumar4709
@shanthkumar4709 Жыл бұрын
How to achieve this for C# Nunit framework.. any ideas helps a lot … Thanks
@anyaslol
@anyaslol 2 жыл бұрын
Great explanation. I have one question- I am running a parallel execution of my application in two browser with different thread.Now from the two browser I am trying to fetch the transaction id attributes using driver.findelements but I can see only one txn-id is fetching at runtime. I observed which ever the browser opens first that application txn id gets overwritten by second one and gets stored in the List interface. How to resolve this issue. Please suggest how to capture these multiple txn-id
@TestingMiniBytes
@TestingMiniBytes 2 жыл бұрын
You have to store it in ThreadLocal variable. If the txn id is static variable it will be shared with threads.
@ravipantar5511
@ravipantar5511 3 жыл бұрын
Hi Amruthan, your videos are informative ,i followed your videos from beginning. while running test parallelly i am getting null pointer exception after using Thread Local class in code.
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Hi Ravi, I am glad that you find my videos informative. Null pointer exception can happen anytime and not specifically because of using thread local. So please follow the exact steps mentioned in the video and practice. Or make sure to debug the whole scenario to replicate the behaviour
@sreekanthkamal7680
@sreekanthkamal7680 3 жыл бұрын
Hi, parallel execution is not working for me , giving null pointer exception. Could you please help me in solving this?.but, I could able to run individually.
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Null pointer can happen because of multiple reasons. Please watch the tutorial and replicate the same.
@Payazee
@Payazee 3 жыл бұрын
Is there a way to support BDD cucumber with this framework along with testNG?
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Will do soon. But you can add cucumber later easily
@manishpatidar5379
@manishpatidar5379 3 жыл бұрын
Very well explained...
@mjj3tube
@mjj3tube 2 жыл бұрын
HI Amuthan! I had a quick question , @11.00 what should be the hierarchy for get and set method ? I feel we should first set the driver and get it right ? I stand to be corrected.😀
@TestingMiniBytes
@TestingMiniBytes 2 жыл бұрын
That is correct to set the values to the Threadlocal and then we can get the values
@mjj3tube
@mjj3tube 2 жыл бұрын
@@TestingMiniBytes Thanks thala.
@shruthirampure3344
@shruthirampure3344 3 ай бұрын
Thank you issue solved 🎉
@pujasaha5452
@pujasaha5452 2 жыл бұрын
Hi Amuthan..really great content. I tried the exact thing but its working fine sometimes but sometimes giving "StaleElementReferenceException".
@TestingMiniBytes
@TestingMiniBytes 2 жыл бұрын
Don't use page factory. Stale element is different exception. I have also covered at the end how to fix that using lambda
@pujasaha5452
@pujasaha5452 2 жыл бұрын
@@TestingMiniBytes Thank you for the prompt reply but till now I haven't used Pagefactory still the code is behaving inconsistant. Sometimes both test cases running fine in parallel but sometimes only one test case is running and the other test case failing with StaleElementReferenceException.
@jaykavin2215
@jaykavin2215 3 жыл бұрын
Very useful 👍
@shaikfaruk4679
@shaikfaruk4679 2 жыл бұрын
I followed as your way but is not working could please help me to resolve This. It is working for one browser only i used thread local
@TestingMiniBytes
@TestingMiniBytes 2 жыл бұрын
Ask your questions in the telegram group
@shaikfaruk4679
@shaikfaruk4679 2 жыл бұрын
Please share group name sir
@TestingMiniBytes
@TestingMiniBytes 2 жыл бұрын
@@shaikfaruk4679 t.me/+cJX1FmzfntJhMTg9
@ronakbhatt2153
@ronakbhatt2153 3 жыл бұрын
Hello is there any jar file available alternative thread.sleep in java?
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
In apache commons use uninteruppiles class methods.
@chaitanyabuddi5968
@chaitanyabuddi5968 2 жыл бұрын
Hi Amuthan .. Can you please do a video on file(any extension) download and verifying the data in the file
@TestingMiniBytes
@TestingMiniBytes 2 жыл бұрын
Okay. Let me do that.
@dineshkumaar2117
@dineshkumaar2117 3 жыл бұрын
Thanks Amuthan , the session was very informative and it would be great if you could share the git hub link
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
github.com/amuthansakthivel/KZbinSessions
@junaid9392
@junaid9392 Жыл бұрын
Hi TMB, thanks for this video.. this made my day. Was stuck on parallel execution for last 4 days. Can I get the framework source code as well?
@TestingMiniBytes
@TestingMiniBytes Жыл бұрын
github.com/amuthansakthivel/SeleniumAutomationFramework_KZbin
@karthic5231
@karthic5231 2 жыл бұрын
Can you explain how to implement theeadlocal in rest assured with data provider as a xlsx sheet through input to passed into each APIs while executing serial is working fine but in parellel as you told it's not working in pure java oriented API AUTOMATION using rest assured
@TestingMiniBytes
@TestingMiniBytes 2 жыл бұрын
Ask these doubts in telegram group with code and screenshots
@shanthkumar4709
@shanthkumar4709 Жыл бұрын
Please share the telegram group we wanna join
@okey1317
@okey1317 2 жыл бұрын
18:50 why is that driver variable still there? in line number 17
@TestingMiniBytes
@TestingMiniBytes 2 жыл бұрын
Will be removed in the next video.
@okey1317
@okey1317 2 жыл бұрын
@@TestingMiniBytes Thanks, btw, do you have a github link to this project? could you share
@TestingMiniBytes
@TestingMiniBytes 2 жыл бұрын
@@okey1317 github.com/amuthansakthivel/SeleniumAutomationFramework_KZbin
@mayurmalik02
@mayurmalik02 3 жыл бұрын
hey it is working fine when we perform our actions in our @testmethod , can you please help how to implement threadlocal concept using page factory design pattern i'm facing issues it would be great help if you can make one video on this topic also
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
It has nothing to do woth page factory. But it will be covered in upcoming videos
@mayurmalik02
@mayurmalik02 3 жыл бұрын
@@TestingMiniBytes hi thanks for the prompt reply now I’m able to implement with page factory also i was doing some minor mistakes , but waiting for your video to get better and clear understanding on this topic
@VintageVibes
@VintageVibes 11 ай бұрын
good one
@sreedilse143
@sreedilse143 2 жыл бұрын
kudos
@amitchauhan1505
@amitchauhan1505 3 жыл бұрын
Whats the need of setting a default value? Reason is not clear from the session. @kzbin.info/www/bejne/Y2jdcmuBo6uUb9k
@geethanandana6738
@geethanandana6738 3 жыл бұрын
Video is good.. but voice is very low...
@TestingMiniBytes
@TestingMiniBytes 3 жыл бұрын
Please try watching the next videos, i have worked on the audio quality
Selenium Framework - Part 8 - Property File - A mandate or Choice ?
24:54
Testing Mini Bytes
Рет қаралды 9 М.
Selenium Framework - Part 6 - Understanding Thread Safety and Issues
17:50
Testing Mini Bytes
Рет қаралды 10 М.
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 25 МЛН
Как не носить с собой вещи
00:31
Miracle
Рет қаралды 894 М.
НАШЛА ДЕНЬГИ🙀@VERONIKAborsch
00:38
МишАня
Рет қаралды 2,8 МЛН
Selenium Framework - Part 17 - Fixing Issues in Framework with Enum
18:57
Testing Mini Bytes
Рет қаралды 5 М.
Selenium parallel execution thread safe [MUST WATCH] | automateNow
7:57
Mastering Parallel Execution: Overcoming Challenges in Selenium Testing || TestNG
22:06
PrinceAutomationDestination
Рет қаралды 3,6 М.
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 25 МЛН