Singleton Pattern With Selenium WebDriver + Java + TestNG

  Рет қаралды 16,699

Naveen AutomationLabs

Naveen AutomationLabs

Күн бұрын

Пікірлер
@naveenautomationlabs
@naveenautomationlabs 5 ай бұрын
GIT Repo URL : github.com/naveenanimation20/SeleniumWithDesignPatterns_Java.git
@panther0761
@panther0761 4 күн бұрын
Really a nice topic and it just enhanced our knowledge day by day
@mandheermaan
@mandheermaan 5 ай бұрын
I Have watched almost all your videos, you have great depth knowledge with related Selenium and latest techies coming in the market. Great hard work done !!!
@sayalichandane9312
@sayalichandane9312 24 күн бұрын
Thank you Naveen, you really doing very good job by upgrading all Job seekers to have latest technology understanding in simple and detailed way. I am currecntly trying to switch job and referring all your videos for interview. Thanks a lot again!!!
@tippanaudayabhaskar8334
@tippanaudayabhaskar8334 5 ай бұрын
Thank you Naveen for making it clear using Singleton Pattern for parallel run using TestNG.
@snehalpujari2982
@snehalpujari2982 3 ай бұрын
Thank you Naveen for such insightful content which keep motivating us and help lot to improve knowledge.
@MasterCardAmitJain
@MasterCardAmitJain 2 ай бұрын
Wow Naveen
@RajibLama
@RajibLama 5 ай бұрын
Thank you Naveen for clear my singleton pattern concept.
@JailParavai
@JailParavai 3 ай бұрын
Excellent Bro
@emb3rke
@emb3rke 5 ай бұрын
Great video, thank you. Why is it recommended to use Singleton pattern regarding WebDriver? What is the benefit of it?
@gourisankardash646
@gourisankardash646 5 ай бұрын
@@emb3rke optimization of memory use by avoiding multiple objects creation.
@whovishalmishra
@whovishalmishra 4 ай бұрын
Amazing, simple and useful.
@bredlin_jose
@bredlin_jose 5 ай бұрын
Hi Naveen, I integrated the same things with my existing framework, while executing the scripts the execution is not going good as expected.
@J.Ramanathan
@J.Ramanathan 5 ай бұрын
Thank you Naveen
@harisharipirala3346
@harisharipirala3346 5 ай бұрын
Thanks for the Information but I have a question. Is it mandatory to implement singleton pattern while using ThreadLocal method. Because threadlocal itself is storing unique web driver thread instances right?
@karnekantiarun4353
@karnekantiarun4353 5 ай бұрын
Hi bro thanks for the content one query webdriver manager and app test class are from different package it will works with same package also TIA
@naveenautomationlabs
@naveenautomationlabs 5 ай бұрын
Hi, it doesn't matter. You can call it from anywhere. Always, design your test classes under src/test/java and non test classes under src/main/java.
@karnekantiarun4353
@karnekantiarun4353 5 ай бұрын
@@naveenautomationlabs Thanks bro pls continue all the design patterns series in java
@bihari1422
@bihari1422 5 ай бұрын
Memwhile the office laptop is facing difficulty to handle one instance of Chrome(after 114 lot of memory is being consumed by Chrome only )...
@Life_Observers
@Life_Observers 5 ай бұрын
Hey Naveen, Please make a video on how to create portfolio
@Sanutainment
@Sanutainment 5 ай бұрын
Thanks
@zakirvnr6011
@zakirvnr6011 24 күн бұрын
When, we are telling, we have implemented singleton pattern. We mean same object is shared. From basic java, we know an object has state. Since same obejct is being shared does it cause interference, if two tests use same object.
@kamesh70
@kamesh70 5 ай бұрын
Hi Naveen: Got a clarity on how to implement Singleton pattern. I have implemented it following your videos whereas when i triggered parallel tests with different browsers it's running always on chrome even though I have provided chrome, firefox & edge browser. Can you help me the reason. One more issue. I cloned your repository and tried running the tests and getting java.lang.IllegalStateException: object already exists at SeleniumWithSingleton.WebDriverManager.initDriver(WebDriverManager.java:19) at SeleniumWithSingleton.WebDriverManager.getInstance(WebDriverManager.java:48) at mytests.AppTest.setUp(AppTest.java:20) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:69) at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:361) at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:296) at org.testng.internal.invokers.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:180) at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:122) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.testng.TestRunner.privateRun(TestRunner.java:829) at org.testng.TestRunner.run(TestRunner.java:602) at org.testng.SuiteRunner.runTest(SuiteRunner.java:437) at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:475) at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) java.lang.IllegalStateException: object already exists at SeleniumWithSingleton.WebDriverManager.initDriver(WebDriverManager.java:19) at SeleniumWithSingleton.WebDriverManager.getInstance(WebDriverManager.java:48) at mytests.AppTest.setUp(AppTest.java:20) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:69) at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:361) at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:296) at org.testng.internal.invokers.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:180) at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:122) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.testng.TestRunner.privateRun(TestRunner.java:829) at org.testng.TestRunner.run(TestRunner.java:602) at org.testng.SuiteRunner.runTest(SuiteRunner.java:437) at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:475) at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)
@tester9586
@tester9586 4 ай бұрын
I get an error same. Hi @naveen, how can we solve this issue?
@pranavhanwante5301
@pranavhanwante5301 4 ай бұрын
Comment below in project // if (instance != null) { // handling reflection attack // throw new IllegalStateException("object already exists"); // }
Singleton Pattern with Cloning using Cloneable Interface - How to prevent it?
4:44
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
What is Singleton Pattern in Java - How to achieve this?
15:21
Naveen AutomationLabs
Рет қаралды 22 М.
Factory Pattern With Selenium WebDriver + Java + TestNG
20:57
Naveen AutomationLabs
Рет қаралды 6 М.
Important Sure Shot Trick To Crack SDET Interviews || Be Different From Others
17:56
6 Steps to Master in Test Automation in 2025
44:40
Naveen AutomationLabs
Рет қаралды 27 М.
Singleton Design Pattern | Implementation with details & code ✌🏻
21:09
What is Builder Pattern || How to achieve this In Java
31:52
Naveen AutomationLabs
Рет қаралды 4,6 М.
30-Day SDET Technical Interview Preparation Plan | Naveen Automation
25:12
Naveen AutomationLabs
Рет қаралды 25 М.