Singleton Pattern With Selenium WebDriver + Java + TestNG

  Рет қаралды 12,290

Naveen AutomationLabs

Naveen AutomationLabs

Ай бұрын

In this video, I have explained how to implement Singleton Pattern With Selenium WebDriver + Java + TestNG.
Schedule a meeting in case of any queries/guidance/counselling:
calendly.com/naveenautomation...
~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
kzbin.info%20Au...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/9FrG-KzGlvxjNmQ1
Naveen AutomationLabs Paid Courses:
GIT Hub Course:
naveenautomationlabs.com/gitc...
Java & Selenium:
naveenautomationlabs.com/sele...
Java & API +POSTMAN + RestAssured + HttpClient:
naveenautomationlabs.com/manu...

Пікірлер: 17
@naveenautomationlabs
@naveenautomationlabs Ай бұрын
GIT Repo URL : github.com/naveenanimation20/SeleniumWithDesignPatterns_Java.git
@tippanaudayabhaskar8334
@tippanaudayabhaskar8334 Ай бұрын
Thank you Naveen for making it clear using Singleton Pattern for parallel run using TestNG.
@mandheermaan
@mandheermaan Ай бұрын
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 !!!
@RajibLama
@RajibLama 25 күн бұрын
Thank you Naveen for clear my singleton pattern concept.
@J.Ramanathan
@J.Ramanathan Ай бұрын
Thank you Naveen
@Rainbow-Dance-Academy
@Rainbow-Dance-Academy Ай бұрын
Thanks
@emb3rke
@emb3rke Ай бұрын
Great video, thank you. Why is it recommended to use Singleton pattern regarding WebDriver? What is the benefit of it?
@gourisankardash646
@gourisankardash646 Ай бұрын
@@emb3rke optimization of memory use by avoiding multiple objects creation.
@pabitra_swain
@pabitra_swain Ай бұрын
Hi Naveen, I understand Singleton is an important concept from the interview point of view. But I am just wondering why to complecate the setup by introducing it to the DriverManager class. Simple ThreadLocal of WebDriver would also work fine right? Is it like just for shake of having Singleton pattern we are having it? Or really some usecase is there where it will be more benefitial over just ThreadLocal?
@harisharipirala3346
@harisharipirala3346 Ай бұрын
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?
@Life_Observers
@Life_Observers Ай бұрын
Hey Naveen, Please make a video on how to create portfolio
@bredlin_jose
@bredlin_jose Ай бұрын
Hi Naveen, I integrated the same things with my existing framework, while executing the scripts the execution is not going good as expected.
@bihari1422
@bihari1422 Ай бұрын
Memwhile the office laptop is facing difficulty to handle one instance of Chrome(after 114 lot of memory is being consumed by Chrome only )...
@karnekantiarun4353
@karnekantiarun4353 Ай бұрын
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 Ай бұрын
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 Ай бұрын
@@naveenautomationlabs Thanks bro pls continue all the design patterns series in java
@kamesh70
@kamesh70 25 күн бұрын
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)
Singleton Pattern with Cloning using Cloneable Interface - How to prevent it?
4:44
SDET | QA Automation Mock Interview - 5+ Years of Experience
1:55:33
Naveen AutomationLabs
Рет қаралды 215 М.
小蚂蚁被感动了!火影忍者 #佐助 #家庭
00:54
火影忍者一家
Рет қаралды 42 МЛН
НЫСАНА КОНЦЕРТ 2024
2:26:34
Нысана театры
Рет қаралды 1,6 МЛН
路飞太过分了,自己游泳。#海贼王#路飞
00:28
路飞与唐舞桐
Рет қаралды 39 МЛН
FASTEST Way To Learn Coding and ACTUALLY Get A Job
10:44
Brian Cache
Рет қаралды 1 МЛН
Extent Reports in java selenium framework
26:40
QA Automation Classes
Рет қаралды 4,3 М.
Selenium with Cucumber 7.x - Java BDD Framework - Mini Project | Crash Course
46:56
Testing Mock interview - 5+ Years of Experience - Test Automation
1:15:52
Naveen AutomationLabs
Рет қаралды 185 М.
Singleton Pattern With Reflection Attack - How to protect reflection attacks?
7:54
Part 1 - API Testing Interview Questions & Answers
1:04:39
Naveen AutomationLabs
Рет қаралды 198 М.
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 64 МЛН
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 66 МЛН
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 555 М.
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 3,5 МЛН