Тёмный

PART 6 - Run All Scenarios in Parallel Mode using Cucumber - TestNG || Generate Extent PDF Report 

Naveen AutomationLabs
Подписаться 388 тыс.
Просмотров 59 тыс.
50% 1

In this video, I have explained how to run all scenarios in parallel mode using Cucumber and TestNG Data Provides.
We will be designing different components in this Framework:
1. Feature Files
2. Step Definition Classes
3. Configuration Files
4. Cucumber Hooks with before and after
5. Element Utilities/Libraries/Generic Functions
6. Cucumber 6 Extent Report Adaptor for Spark HTML / PDF Reports
7. Test Runners in JUnit/TestNG
8. Page Classes for POM
9. Maven with pom.xml with different dependencies and plugins
10. Parallel Execution
11. Cucumber 6 Web HTML Reports
12. Screenshot for Failure scenarios
13. Integration with GIT Repo
14. Running test cases from Jenkins
15. Running test cases on Dockerized Selenium GRID
And much more.....
Technologies Used:
1. Selenium WebDriver with Java Language binding
2. Cucumber 6.x JVM library
3. WebDriverManager
4. JDK 1.8
5. Maven (Build tool)
6. Maven Plugins
7. Cucumber extent report 6 adapter
8. JUnit 4.x library / TestNG Cucumber Lib
9. Log4j
10. GIT HUB - Git Repo
11. Docker
12. Jenkins
13. Eclipse (IDE)
~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
www.youtube.co...
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/...
Paid courses (Recorded) videos:
naveenautomati...
For Java & Selenium - naveenautomatio...
For API (Manual + Automation) - naveenautomatio...

Опубликовано:

 

18 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 109   
@Someone_2923
@Someone_2923 3 года назад
Thanks for the much awaited series naveen! I tried running the scenarios with TestNG without changing the folder structure (kept as same like we used for junit runner). It runs without any problem... Small update from my side🙂
@yash4ful
@yash4ful Год назад
Any changes that you did? Because mine is not working
@saikiranpalugula802
@saikiranpalugula802 3 года назад
Hi Naveen, are you going to post one more video on integrating this Cucumber framework with Jenkins, GIT and docker? Please answer...
@shankumondal2881
@shankumondal2881 3 года назад
No word to say !! You are the boss !! Take a bow . 🙏
@SivaKumar-rg1kx
@SivaKumar-rg1kx 2 года назад
Great explanation. How to run parallel specific tagged scenarios ( which are located in multiple feature files) using testng
@biplabghosh1380
@biplabghosh1380 2 года назад
Hi Siva, did you get any solution for that?
@piotrk29
@piotrk29 Год назад
Hello, do you know how to limit threads ? for example I want to launch 2 scenarios parallel ? edit: if someone looking for solution just add this to surefire dataproviderthreadcount 2
@sainathvallampatla5135
@sainathvallampatla5135 3 года назад
I was thinking about the usage of empty class in runner.java. I got the answer in this video. Thank you
@yuvraj4870
@yuvraj4870 Месяц назад
@Naveen, what exactly does the 2d Object array return ? super.scenarios must be returning multiple scenarios but what is the other dimension? because it is a 2D array . Thanks :)
@romilpant5683
@romilpant5683 2 года назад
Hi. Is there a way to control the number of thread for parallel execution?
@AutomationTestingStudio
@AutomationTestingStudio Год назад
expecting reply on this
@yash4ful
@yash4ful Год назад
@@AutomationTestingStudio set unlimited threads to False and ThreadCount to number of thread you want
@luisjaviermedinacoca836
@luisjaviermedinacoca836 3 года назад
Thanks @Naveen for your video but I'm having an issue, everytime I run the test I got a sequential execution always. I copied your pom and even with that I've got the same execution... in sequence
@MnemonicCarrier
@MnemonicCarrier Год назад
This is awesome - thank you so much!!!
@gawanderohan
@gawanderohan 3 года назад
Thanks Naveen.., can I run API testing features in parallel or restassured does not support parallel run? Please advise
@pandudamera7211
@pandudamera7211 3 года назад
Awesome brother
@naveenautomationlabs
@naveenautomationlabs 3 года назад
Thank you! Cheers!
@PawanRajbhar-d2o
@PawanRajbhar-d2o 6 месяцев назад
hiii naveen as you told in this video run all scenario parallel but is possible to execute parallel scenario and feature file with thread value 2 in this video all test are executed at same time it consume lot of cpu.
@siteshvishwakarma7211
@siteshvishwakarma7211 Месяц назад
Hi Sir, Could you please make a video on mobile automation for parallel execution using Appium with cucumber? It will be beneficial.
@abhinashagrawal6502
@abhinashagrawal6502 3 года назад
Not Sure what wrong I am doing but for me it is saying 'The method scenarios() is undefined for the type AbstractTestNGCucumberTests' for the function written under runner class public class TestRun extends AbstractTestNGCucumberTests { @Override @DataProvider(parallel = true) public Object[][] scenarios() { return super.scenarios(); } } It would very helpful if you can put some light.
@arunkumarpandey4989
@arunkumarpandey4989 3 года назад
same issue i am able to resolve by changing by adding latest dependency...and latest dependency is dependency> io.cucumber cucumber-testng 6.11.0
@sachin99604325638
@sachin99604325638 2 года назад
I tried to use the same POM.xml but my tests are not running parallely . They are running sequentially.. Not sure the reason
@vs8738
@vs8738 3 года назад
Thanks Naveen is there any way we can define login as a separate feature file and from hooks we call using @Before("@Login") for all feature?
@rahulraman5672
@rahulraman5672 2 года назад
@Naveen I am getting issue -package cucumber.api does not exist.please help me on this I am having BDD +TestNg+maven project
@sridhar6358
@sridhar6358 2 года назад
Able to run scenarios in parallel mode with the testng framework as explained only by invoking using the Runner file but not able to execute with maven commands from command line -- can you tell me know what could be the problem then.
@josemariadelacruzsanchez4558
@josemariadelacruzsanchez4558 3 года назад
I have implemented everything, I got no error but PDF is not generating (html does)
@Nykster
@Nykster 3 года назад
change "import io.cucumber.junit.CucumberOptions" to "import io.cucumber.testng.CucumberOptions" in ParallelRun.java
@arunkumarpandey4989
@arunkumarpandey4989 3 года назад
@@Nykster Thanks it help me also, you save my time
@ashuiet
@ashuiet 3 года назад
Hi Naveen can you commit this parallel changes in your github. because mine build is not generating Extent and PDF report.
@naveenautomationlabs
@naveenautomationlabs 3 года назад
Done.....
@ashuiet
@ashuiet 3 года назад
Thank you, Naveen
@ashuiet
@ashuiet 3 года назад
Thanks Naveen it's working now !!
@MadirajuKChaitanya
@MadirajuKChaitanya 3 года назад
@@ashuiet : Can you please let me know what you have done to get the Extent and PDF reports...?. I followed the same steps...but I am not able to see these reports. Thanks, in advance.
@ashuiet
@ashuiet 3 года назад
@@MadirajuKChaitanya Please go thru my Github github.com/asingh4305/CucumberPOMDec2020
@karanatreya7314
@karanatreya7314 Год назад
Extent Report PDF and Spark HTML report folders are not getting generated . .any solutions for it?
@shilpagoel4525
@shilpagoel4525 3 года назад
how can we give relative path in extent.properties file because i want my report through jar file in outside folder of project????
@deepanshuaggarwal7042
@deepanshuaggarwal7042 3 года назад
When I run my code with maven using "mvn verify" command, then it can't find testcases. 0 count is comming as test cases.. why??
@govindreddy180
@govindreddy180 3 года назад
Thanks Naveen.. can we execute same test cases for multiple environments(instances) on pipelines
@santhoshveluri4200
@santhoshveluri4200 3 года назад
Thanks alot Naveen.. Could you please create series on serenity bdd framework..
@deeptibedi6500
@deeptibedi6500 Месяц назад
Hi Naveen how to limit the number of browser instances?
@waahresindhiyon4689
@waahresindhiyon4689 3 года назад
Not sure why in spite of following everything as per the video many times we are not able to get the exact output? Anyone else facing the same??
@Nykster
@Nykster 3 года назад
I'm suspecting maybe changes were made offline...
@naveenautomationlabs
@naveenautomationlabs 3 года назад
And you are suspecting it wrong.
@Nykster
@Nykster 3 года назад
No it's correct, just that there are some subtle imports that need to be changed which aren't mentioned in the videos so program doesn't run like yours. But everything you did is right. Please keep it up, your videos are very helpful!
@ravikumargupta4649
@ravikumargupta4649 3 года назад
Thanks @Naveen , how to control number of thread while running all in parallel ?
@krishnasep3
@krishnasep3 3 года назад
Did you get answer for your question? How to set thread count in testng
@mnsayeed999
@mnsayeed999 3 года назад
@@krishnasep3 The default thread count of the dataprovider in parallel mode is 10. To change this the dataproviderthreadcount property needs to be added to the configuration section of the Surefire or Failsafe plugin in the POM. dataproviderthreadcount 20
@Naveenacheanz1
@Naveenacheanz1 Год назад
@@mnsayeed999 Hi, I tried this, But it did not reduce the thread count. Could you please share your POM file for reference?
@Shiva-sq1jk
@Shiva-sq1jk Год назад
@@Naveenacheanz1 Use 3.0.0MD9 version of plugin it's working
@tester9586
@tester9586 11 месяцев назад
@@Shiva-sq1jk Hi, I tried this but it did not work. Can anyone handle this problem?
@lewnidasmitrou7247
@lewnidasmitrou7247 2 года назад
Naveen hi. Great video!!!! I'm building a Cucumber + Maven + Selenoid framework, without parallel enabled. I try now to run it in multiple threads and as can you imagine i have problems.But the debugging is hard, because logs are not produced live. Do you have any idea or solution to have live logs while i run test in parallel? Ty
@Sakthidxm
@Sakthidxm 6 месяцев назад
I need to run my features in parallel using TestNG. Any idea on that
@hikmetsekerci3923
@hikmetsekerci3923 3 года назад
don't sure what am i doing wrong. I did eveything same expect the test scenarios. I can't run parallel with junit always run at sequence but ican generate extent pdf report. At testng i can run paralel but can't generate extend pdf report
@Nykster
@Nykster 3 года назад
change "import io.cucumber.junit.CucumberOptions" to "import io.cucumber.testng.CucumberOptions" in ParallelRun.java
@abhijeetgalphat9502
@abhijeetgalphat9502 3 года назад
Thanks, Naveen. Do you have any plan to make a video on QMETRY BDD
@HarishM-fw9nq
@HarishM-fw9nq Год назад
Hi, I am getting error when i run the file that JNI error as occured, can u help me out on this. I am using java 8
@stepikzyal1662
@stepikzyal1662 3 года назад
In cucumber Runner file, tags concept is not allowed to use when using TestNG. Is there any options available like tags? Please add your comment.
@Shiva-sq1jk
@Shiva-sq1jk Год назад
mvn test -Dcucumber.options="--tags @tagname"
@kavithananjundappa7011
@kavithananjundappa7011 3 года назад
hi naveen, can you update your framework in git, with complete pom.xml some plugins are missing
@jss9803
@jss9803 Год назад
Hi Naveen I have requirement for parallel test to run different features parallely to reduce time. I am using cucumber ruby , can you help me
@shiprasharma3089
@shiprasharma3089 3 года назад
hi sir how to convert this cucumber project to run as TESt NG can you please elaborate more on this do we need to do convert to TESTNG ?
@baluzen
@baluzen 3 года назад
Can you please do the same stuff with gradle parallel execution of features and scenarios
@biplabghosh1380
@biplabghosh1380 2 года назад
Hi Balaji, did you get any solution for that?
@WINSLATE3
@WINSLATE3 2 года назад
@Naveen - My tests are running in sequence instead of running in parallel. From eclipse its running in parallel mode but from surefire plugin its running in sequence. Can you pls help?
@taetjomampa2000
@taetjomampa2000 2 года назад
remove the RunWith class and it will run in parallel
@Shiva-sq1jk
@Shiva-sq1jk Год назад
@@taetjomampa2000 thanks bro
@sudhakarthangavelu7164
@sudhakarthangavelu7164 3 года назад
Naveen, Can you pls tell me how to execute the same test cases in different browse at a time in TestNG
@Shiva-sq1jk
@Shiva-sq1jk Год назад
running all tags number of tags=number of threads. threadcpunt is not getting acted
@somikghosh1005
@somikghosh1005 3 года назад
Hi Sir, can we execute cucumber features parallely using testng?
@PoojaChauhan-ms5ht
@PoojaChauhan-ms5ht 3 года назад
Yes , you can do that just use classes
@somikghosh1005
@somikghosh1005 3 года назад
@@PoojaChauhan-ms5ht thanks a I will try this. I faced another issue if I run cucumber tests through Testng in testng extent report the actual feature names are not getting printed. The test names are getting printed as "feature".
@akonsantosh
@akonsantosh 3 года назад
Naveen, Element Actions class was not included in this series :(
@nishitabhatt5776
@nishitabhatt5776 3 года назад
Hi naveen, this code is not generating any reports or test-output folder
@hemangishelake9849
@hemangishelake9849 3 года назад
Hi Naveen, In run as testNG option is not showing.Plz Help
@ashutoshsingh-uh4io
@ashutoshsingh-uh4io 3 года назад
how can we run parallel cross browsing Cucumber framework, like 1 feature in iOS and 1 in Android using lamda test
@AmitPal-vu1ft
@AmitPal-vu1ft Год назад
Hi Naveen , can we please get the Full project Repo to download?
@vijaykaushal9311
@vijaykaushal9311 3 года назад
Hello Naveen, One request.. could you please add the Element Util class with some basic generic functions for web operations .. Thanks in Advance!!
@ManmathDeshmukh-fo3ej
@ManmathDeshmukh-fo3ej 5 месяцев назад
How to control thread count here?
@balakrishnapulaparthi
@balakrishnapulaparthi 3 года назад
Thanks Naveen, Could you tell how to run parallel scenarios using tags.
@biplabghosh1380
@biplabghosh1380 2 года назад
Hi Balakrishna, did you get any solution for that?
@phanibharadwaj9627
@phanibharadwaj9627 3 года назад
Hai Naveen, Can you Please explain about the Taking the screenshot for every step in this cucumber framework
@aravind1129
@aravind1129 3 года назад
Use afterstep hooks scenario.embed()
@tulasiramsunkara
@tulasiramsunkara 3 года назад
@Naveen.... I have read somewhere we can give the name of excel file in feature file so that it can work like dataprovider.... Is this correct?
@naveenautomationlabs
@naveenautomationlabs 3 года назад
no its not correct as per my understanding. In cucumber we dont have any direct annotations to handle this, but it can be customized.
@tulasiramsunkara
@tulasiramsunkara 3 года назад
@@naveenautomationlabs : Thanks for confirmation
@coolsaty007
@coolsaty007 3 года назад
It can be done and its done in Quantum Framework.
@naveenautomationlabs
@naveenautomationlabs 3 года назад
@@coolsaty007 here we are not using Quantum framework, in cucumber library we dont have any such features. But you can surely create your own custom annotations which can be used in feature files to provide the reference of Excel sheets.
@tulasiramsunkara
@tulasiramsunkara 3 года назад
@@coolsaty007 can I get some references about this quantum framework
@priyankab.5548
@priyankab.5548 3 года назад
Naveen pls share how to use grid in real life for BDD framework...
@mertcanyuksekkaya6144
@mertcanyuksekkaya6144 3 года назад
Thanks Naveen. Can you please make with testng parameter item in xml file
@vijaykemi
@vijaykemi 3 года назад
Thanks Naveen.. Can i get the Github url where i can download this code.
@naveenautomationlabs
@naveenautomationlabs 3 года назад
Cucumber 6 latest: github.com/naveenanimation20/Cucumber6LatestFeatures Cucumber with POM and Selenium: github.com/naveenanimation20/LatestCucumber6WithPOM
@vijaykemi
@vijaykemi 3 года назад
@@naveenautomationlabs Thank you
@qatestingravi
@qatestingravi 3 года назад
@@naveenautomationlabs ​I have cloned the below repository and tried parallel run. parallel run is working but always running in 10 browser instances instead of 4 browser instances. Can you please check it? I have used below configuration for surefire plug in in POM.xml methods 4 false github.com/naveenanimation20/LatestCucumber6WithPOM
@lokeshsharma-gd1xo
@lokeshsharma-gd1xo 3 года назад
How to do the same for mobile app?
@sumeshm23
@sumeshm23 3 года назад
Wen i run mvn verify it s running twice
@PulagorlaSaikumar
@PulagorlaSaikumar 9 месяцев назад
can You share the pom.xml file please
@anandsinha6407
@anandsinha6407 3 года назад
Hi Naveen where can i implement time stamp so that each time i run the different extent reports get generated
@ishmamnaveel2198
@ishmamnaveel2198 2 года назад
Reports are not working for me
@ammarkhan1629
@ammarkhan1629 2 года назад
Hi Naveen Getting below error when I am trying to run cucumber with TestNG (Haven't even tried parallel execution): FAILED CONFIGURATION: @BeforeClass io.cucumber.testng.AbstractTestNGCucumberTests.setUpClass(org.testng.TestRunner@59d4cd39) java.lang.AbstractMethodError: Receiver class io.cucumber.testng.TestNGCucumberOptionsProvider$TestNGCucumberOptions does not define or inherit an implementation of the resolved method 'abstract boolean strict()' of interface io.cucumber.core.options.CucumberOptionsAnnotationParser$CucumberOptions. Have tried many things but none successful
Далее
Dora was kidnapped and then… 😨 #shorts
00:18
Просмотров 2,9 млн
Tutorial 10:TestNG with intelliJ IDE| Parallel Tests
28:01
Cross browser testing using Selenium and TestNG
15:02