I am here just to mention how beautifully you take one task , one agenda in hand and explain it without deviating from the topic. I always search for your videos if I am not clear about any concept. Thanks for your efforts .
You always explain wat it's required..I could see some channel explained same concepts in 1 hour..but you covered in 13 mints ..so our time also saved 😍
Hi Raghav, You have provided example with one class in each .can you please let me help how we can run multiple class files in each by running parallel in tests as i am running but get nullpointer exception as driver is not found by other class
Hi Ankit, you can use testng.xml file and then add all the classes/tests you want to run and can also run in parallel. there are videos in this playlist for that.
@@RaghavPal Hi Raghav, Thanks for reply ..i am already using testng.xml file and added two class in each .But when i am running test in larallel then each threaf assigned to each test but each test have two classes so when second class running then null pointer exceprtion is coming on driver instance.I am initiating driver by @BeforeTest throgh another class that called TestBaseClass..so please help me it is most urgent for my project i am stuck from couple of days
Hi Ankit, you can also have multiple testng.xml and make them run in parallel from command line. ( in diff cmd windows). It will be difficult for me now to take out extra time. I will try to help you online.
@@RaghavPal Thanks a lot Raghav, Actually i am confused to use multiple testng.xml file as in my framework there are multiple classes and issue comes from second class file on driver instance. Yes Raghav,Please help me online..we can do through webex or as you comfort
The process remains same for cucumber, the script to use browser based on options can be given in a common class, can also use cloud service providers like SauceLabs, Browserstack etc
Hi Raghav, is there a video that shows how to use selenium webdriver with appium client on virtual device? use case is interaction between mobile device and desktop browser.
Hi Meherprasad, you can do that if you have required infrastructure. Usually multiple systems will be required for running lots of instances in parallel. You can also take help from cloud services like Saucelabs, Browserstack
Hi, How can create common library class to launch multiple browser .I have multiple test class , I am looking common method to call in my each class .can you plz share video on this?
Another great video! I hope you read my previous post on your other video where I requested if you could create a video on thread local/safe. Parallel execution has issues on anything but these super simple test cases. So such a video would help solve lots of these issues. Thanks in advance!
how can we run different test methods belonging to same/different class in parallel? i.e. 3 tests in parallel, which opens browser and actually do something
Hello my beloved, can you help me ?. When I put @Parameters ("browserName") I get the following message: The annotation @Parameters is disallowed for this location.
Hi , Appreciate your effort for the wonderful videos. I have implemented the same. Can you let me know how can we implement Logging for all the test cases executed here parallely? I tried logging but all logs of different test cases mixed into one. How can we create seperate logging for all test case that execute in parallel?
Sir i have a question. Suppose, in a real life project we have to generate the report as well so when we run the project in parallel, how will it work? They will generate the report for multiple browser separately or how it will works? Thank you sir for your wonderful video that is really helpful for me.
When running Selenium tests in parallel, generating reports can be a bit tricky, but it's definitely doable Let me guide you through the process. 1. Parallel Execution Basics: - When you run tests in parallel, each test runs independently in its own thread or process. - For example, if you're testing multiple browsers simultaneously, each browser instance runs as a separate test. - The challenge is to collect and organize the test results from all these parallel executions. 2. Extent Reports: - Extent Reports is a popular reporting library for Selenium. - It provides detailed HTML reports with rich visuals, including test status, logs, screenshots, and more. - To generate separate reports for each browser, follow these steps: 3. Implementation Steps: - Configure Maven Plugins: - In your project's `pom.xml`, add the following plugins: ```xml
``` - Adjust the configuration according to your project structure. - Add Extent Reports: - In your test code, initialize Extent Reports and create a report for each browser. - You can use `@BeforeClass` and `@AfterClass` hooks to set up and finalize the reports. - Example: ```java @BeforeClass public void setUp() { // Initialize Extent Reports ExtentReports extent = new ExtentReports("target/reports/report.html", true); ExtentTest test = extent.startTest("Test Name", "Test Description"); // Set up other configurations (e.g., system info, categories, etc.) // ... } @AfterClass public void tearDown() { // Finalize the report extent.endTest(test); extent.flush(); } ``` 4. Result: - When you run your tests in parallel, each browser will generate its own Extent Report. - The reports won't overwrite each other, and you'll have separate HTML files for each browser's test results. Remember to adapt the above steps to your specific project structure and requirements --
I have one question sir. How can I inject parameter to field using testng.xml. I have created dependency injection using google Guice and using annotation @Named("name here") in Webdriver field. Now by changing name I can inject whatever driver I want. Question is How can I sent name to @Named("name from properties file here") from properties or testng.xml file? Is it possible? Of course if you never used that approach nevermind me :)
Hi Raghav There's problem occurs with me when I put parameter tag inside test tag --> Parameter 'browserName' is required by @Configuration on method startDriver but has not been marked @Optional or defined
---------------- @Parameters({ "browserName" }) @BeforeSuite public void startDriver(String browserName) { if (browserName.equalsIgnoreCase("chrome")) { System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "/drivers/chromedriver.exe"); driver = new ChromeDriver(chromeOption()); } else if (browserName.equalsIgnoreCase("firefox")) { System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "/drivers/geckodriver.exe"); driver = new FirefoxDriver(firefoxOption()); } else if (browserName.equalsIgnoreCase("ie")) { System.setProperty("webdriver.ie.driver", System.getProperty("user.dir") + "/drivers/IEDriverServer.exe"); driver = new InternetExplorerDriver(); } else if (browserName.equalsIgnoreCase("safari")) { driver = new SafariDriver(); } } --------------- FAILED CONFIGURATION: @BeforeSuite startDriver org.testng.TestNGException: Parameter 'browserName' is required by @Configuration on method startDriver but has not been marked @Optional or defined in F:\eclipse-workspace\2D-3D-Analysis\testng.xml at org.testng.internal.Parameters.createParameters(Parameters.java:159) at org.testng.internal.Parameters.createParameters(Parameters.java:372) at org.testng.internal.Parameters.createConfigurationParameters(Parameters.java:90) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:199) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:140) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:296) at org.testng.SuiteRunner.run(SuiteRunner.java:259) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1200) at org.testng.TestNG.runSuitesLocally(TestNG.java:1125) at org.testng.TestNG.run(TestNG.java:1033) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Hi Raghav Sir, Thank you so much for your tutorials its very useful. Please can you give me sample script how to run same test cases on multiple envi like QA, Prod and demo using command promt
Hi Pooja, I do not have anything handy with me right now, In general, you will put your env dependent parameters in variables and get the values of these variables externally, from a config file or properties file and the same can be used from command line
Hi sir @Parameters("browsername") is showing error like attribute value is undefined for annotation type paramatarized.Parameters if know the solutiion please help
Vamshi The error message "The attribute value is undefined for the annotation type Parameters" usually occurs when the import statement is incorrect. Here's how you can fix it: 1. Check Your Import Statements: - Make sure you're importing the correct `@Parameters` annotation from TestNG. - Use this import statement: ```java import org.testng.annotations.Parameters; ``` - Remove any other conflicting import statements related to parameters (e.g., `import com.beust.jcommander.Parameters;`). 2. Update Your Code: - Replace the existing import with the correct one: ```java import org.testng.annotations.Parameters; ``` 3. Example Usage: - Here's how you can use `@Parameters` in your TestNG class: ```java import org.testng.annotations.BeforeTest; import org.testng.annotations.Parameters; public class MyTestClass { @BeforeTest @Parameters("browsername") public void setUp(String browser) { // Your setup logic here based on the browser parameter System.out.println("Running test on " + browser); } } ``` Make sure you've corrected the import statement, and your `@Parameters` annotation should work as expected -
Hi Raghav, I was running my testng.xml file.In that file I have added two tests that is one test on chrome and other on firefox with same class and the class has only one method and I run them in parallel mode, so according to that in testng report it should show one method of one test and one method of other test but for one test it is showing the same method run twice and for other test it is showing only one method which is working fine..The firefox browser is working fine but for the chrome the execution is stopping after sometime without completion .Can you help me with that.
@@RaghavPal Hi Raghav, I am having the same issue. After doing some research, I found that it may get solved if we Initialize the WebDriver object as a Thread Local for Parallel Test Execution. ThreadLocal driver = new ThreadLocal(); Can you help us on this? And thanks a lot for your videos, it helps me a lot.
Hi Raghav, Great explanation,. Thanks a lot. I have one doubt, I have browser invoke script base class( initialize function) and test script( here i am also extends the base class) in another class. But while executing testng.xml , its not picking the browsers browser returns null. .Can you advise how to do that. or can you share your mail id so that i can mailed my code.
@@RaghavPal Hi Raghav, Thanks for your reply. Its working fine when i have Browser Setup and test in single file. My issue is Browser setup(BaseCalss.java-initialize(String Browser) function)) in one file and test is in another file. While running Testng.xml file its failing there. I have to call the browser setup(-initialize(String Browser) function) file in testscript file. Browser value have to be passed to the test script file.
Hi Raghav, I am getting error when i put @parameters("browserName") i.e the attribute value is undefined for the annotation type parameterized.parameters testng. Please help me out !!
Hi Kuldeep, just check you imported Parameters from TestNG lib and not any other lib. Also check this stackoverflow.com/questions/47612476/the-attribute-value-is-undefined-for-the-annotation-type-parameters-error-is-d
Hi Raghav, I used the same to run on chrome and edge, but it is not running in parallel - it is executing one after other. What may be the reason. And how to resolve that.
Thanks a lot Sir . But in my case near my @Parameters annotation - it just gives me the error " Parameters is disallowed in this location" . After i copied everything as in the video . Anyone ? Any ideas?) Thanks..
Thanks for the tutorial. But you did not even bother to solve the IE issue. What was the actual issue? for IE? My Chrome and Firefox opened but not IE. I will really appreciate if you reply with an answer.
Hi, I covered IE separately in this video - th-cam.com/video/XrQ4fqg97GI/w-d-xo.html You can also check complete playlist here - automationstepbystep.com/
I have write same code but getting error in Test Method for void Test1() as invalid type .same error for void Teardown method (). Plz help for solving these errors.
Thank you for reply .plz help me to solve below error In testng.xml file I enter @para & press ctrl+spacebar but it shows message like no default proposals . On other way I enter the parameter syntax manually but shows error like "parameters" must be declared. I followed same step given by u . Any suggestion how to solve this error plz help.
Hi Satyanarayan Here are the steps on how to achieve multiple browser testing in parallel using TestNG with Cucumber BDD framework: 1. Create a Maven project in your favorite IDE adding Cucumber dependencies to the POM as detailed here and TestNG dependencies here. 2. Add the two feature files (scenarios.feature and scenario-outlines.feature) and step definition class as described in the JUnit section. 3. Create a TestNG XML file and add the following configuration: ```xml
``` This configuration will create two tests, one for Chrome and one for Firefox. The `browser` parameter will be passed to the CucumberTest class, which will use it to initialize the appropriate browser driver. 4. Run the TestNG XML file using the following command: ``` mvn test -DsuiteXmlFile=testng.xml ``` This will run the two tests in parallel, one for Chrome and one for Firefox. Here are some additional things to keep in mind when achieving multiple browser testing in parallel using TestNG with Cucumber BDD framework: * You need to have the correct browser drivers installed on your machine. * You need to specify the browser name in the TestNG XML file. * You need to create a separate step definition class for each browser. * You need to make sure that your code is thread-safe
Hi Sandeep, the best help for now can be to spread this free education to all who may need it, Share in all your groups - automationstepbystep.com/ Also if people can help in answering comments and helping users, it will be a great help
Hi Joshua, I think you did not see earlier videos. Pls check here - th-cam.com/play/PLhW3qG5bs-L8oRay6qeS70vJYZ3SBQnFa.html You can find all playlists here - automationstepbystep.com/online-courses/
I am here just to mention how beautifully you take one task , one agenda in hand and explain it without deviating from the topic. I always search for your videos if I am not clear about any concept. Thanks for your efforts .
Hi Sameer, most welcome
ye itna easy nahi hai jitna apne easy karke bataya..expalain very well Thank You
You always explain wat it's required..I could see some channel explained same concepts in 1 hour..but you covered in 13 mints ..so our time also saved 😍
Glad to see this Yogeesh.. keep learning
Searched this solution for long finally got the solution from your video. Thanks!!
Glad it helped Uday
Thank you Sir.. you really explain very nicely..
You are most welcome Debashish
Yet another great and concise explanation from you, sir. Highly appreciate it !!
Glad it was helpful!
helo raghav, will you please describe how to run test case in safari browser?
You will need to add Safari Driver. Check this www.javatpoint.com/selenium-webdriver-running-test-on-safari-browser
Excellent video mate. Really great, Just clean and simple
Thanks Kumar
Hi Raghav its my privilege to watch your video ! You really make things easy to learn .
Glad to know this Vimal
Hi Sir
How many diffrent testcases can we ran at a time?
It will depend on your infrastructure... how many parallel threads can it handle for your tests
@@RaghavPal Thanks for replay and also please make vedio on take screen shot of each web element(action) and save it to word document with headings
Sure
Thank you very much for making an excellent tutorial ... the best I found and perfect for understanding. Namaste
So happy to know this Brian
Hi Raghav,
You have provided example with one class in each .can you please let me help how we can run multiple class files in each by running parallel in tests as i am running but get nullpointer exception as driver is not found by other class
Hi Ankit, you can use testng.xml file and then add all the classes/tests you want to run and can also run in parallel. there are videos in this playlist for that.
@@RaghavPal
Hi Raghav,
Thanks for reply ..i am already using testng.xml file and added two class in each .But when i am running test in larallel then each threaf assigned to each test but each test have two classes so when second class running then null pointer exceprtion is coming on driver instance.I am initiating driver by @BeforeTest throgh another class that called TestBaseClass..so please help me it is most urgent for my project i am stuck from couple of days
Please let me know if i can connect with you personally
Hi Ankit, you can also have multiple testng.xml and make them run in parallel from command line. ( in diff cmd windows). It will be difficult for me now to take out extra time. I will try to help you online.
@@RaghavPal Thanks a lot Raghav,
Actually i am confused to use multiple testng.xml file as in my framework there are multiple classes and issue comes from second class file on driver instance.
Yes Raghav,Please help me online..we can do through webex or as you comfort
Hi Raghav as you have many testng.xml files created on project level but for automating at project level should we maintain a single XML file?
Hi Nayeem, you can have multiple testng.xml files with diff configurations as needed and can run a specific file based on the need
Thanks for the video. How can we do this cross browser testing with cucumber framework?
The process remains same for cucumber, the script to use browser based on options can be given in a common class, can also use cloud service providers like SauceLabs, Browserstack etc
Hi Raghav, is there a video that shows how to use selenium webdriver with appium client on virtual device? use case is interaction between mobile device and desktop browser.
Hi Francisco, you can check appium series here - automationstepbystep.com/
Hi sir, how can I apply parallel testing project level
Hi Meherprasad, you can do that if you have required infrastructure. Usually multiple systems will be required for running lots of instances in parallel. You can also take help from cloud services like Saucelabs, Browserstack
Excellent efforts Sir...
Plz share your details to connect
can send me your query here..
Hi,
How can create common library class to launch multiple browser .I have multiple test class , I am looking common method to call in my each class .can you plz share video on this?
I will try to do a session Ravish
Another great video! I hope you read my previous post on your other video where I requested if you could create a video on thread local/safe. Parallel execution has issues on anything but these super simple test cases. So such a video would help solve lots of these issues. Thanks in advance!
Will do!
@@RaghavPal Thanks again!
Hi Raghav, i need to run cross browser testing using parallel method in cucumber-junit. Can you guide me
Hi Shruthi, I will try and plan a session, try some online examples meanwhile
Nice explanation
Thanks Sai
I have my browsers initialised in base class. So can we get browserName from that base class instead of initialising them in @BeforeTest . ?
Hi Rajat, you can do that
how can we run different test methods belonging to same/different class in parallel? i.e. 3 tests in parallel, which opens browser and actually do something
You can use testng.xml for that, Pls check the videos here - th-cam.com/play/PLhW3qG5bs-L8oRay6qeS70vJYZ3SBQnFa.html
Hello my beloved, can you help me ?. When I put @Parameters ("browserName") I get the following message: The annotation @Parameters is disallowed for this location.
Hi Rebeka, Saw your other message, hope this is fine now.
Hi ,
Appreciate your effort for the wonderful videos.
I have implemented the same.
Can you let me know how can we implement Logging for all the test cases executed here parallely?
I tried logging but all logs of different test cases mixed into one.
How can we create seperate logging for all test case that execute in parallel?
Hi Neeraj, I will try to add a session on that. Pls take online help meanwhile
Sir i have a question. Suppose, in a real life project we have to generate the report as well so when we run the project in parallel, how will it work? They will generate the report for multiple browser separately or how it will works? Thank you sir for your wonderful video that is really helpful for me.
When running Selenium tests in parallel, generating reports can be a bit tricky, but it's definitely doable
Let me guide you through the process.
1. Parallel Execution Basics:
- When you run tests in parallel, each test runs independently in its own thread or process.
- For example, if you're testing multiple browsers simultaneously, each browser instance runs as a separate test.
- The challenge is to collect and organize the test results from all these parallel executions.
2. Extent Reports:
- Extent Reports is a popular reporting library for Selenium.
- It provides detailed HTML reports with rich visuals, including test status, logs, screenshots, and more.
- To generate separate reports for each browser, follow these steps:
3. Implementation Steps:
- Configure Maven Plugins:
- In your project's `pom.xml`, add the following plugins:
```xml
com.github.temyers
cucumber-jvm-parallel-plugin
2.2.0
generateRunners
validate
generateRunners
src/test/java/stepDefinition/baseDefinition
src/test/resources
target/cucumber-parallel
json,html
"~@ignored"
org.apache.maven.plugins
maven-surefire-plugin
2.19
10
true
/Parallel*IT.class
```
- Adjust the configuration according to your project structure.
- Add Extent Reports:
- In your test code, initialize Extent Reports and create a report for each browser.
- You can use `@BeforeClass` and `@AfterClass` hooks to set up and finalize the reports.
- Example:
```java
@BeforeClass
public void setUp() {
// Initialize Extent Reports
ExtentReports extent = new ExtentReports("target/reports/report.html", true);
ExtentTest test = extent.startTest("Test Name", "Test Description");
// Set up other configurations (e.g., system info, categories, etc.)
// ...
}
@AfterClass
public void tearDown() {
// Finalize the report
extent.endTest(test);
extent.flush();
}
```
4. Result:
- When you run your tests in parallel, each browser will generate its own Extent Report.
- The reports won't overwrite each other, and you'll have separate HTML files for each browser's test results.
Remember to adapt the above steps to your specific project structure and requirements
--
I have one question sir. How can I inject parameter to field using testng.xml.
I have created dependency injection using google Guice and using annotation @Named("name here") in Webdriver field. Now by changing name I can inject whatever driver I want.
Question is How can I sent name to @Named("name from properties file here") from properties or testng.xml file? Is it possible? Of course if you never used that approach nevermind me :)
Hi Bartłomiej, I will want to answer this after doing some analysis, So for now pls try online help
Hi Raghav, one doubt..whats the use of using thread count to 5 here in this video..whats the purpose of threads in general?
its like saying run 5 executions in parallel, So its like 5 users running the test at the same time
Great explanation
Thanks for watching
Hi Raghav There's problem occurs with me when I put parameter tag inside test tag
--> Parameter 'browserName' is required by @Configuration on method startDriver but has not been marked @Optional or defined
Pls show your code, any detailed error you have ?
----------------
@Parameters({ "browserName" })
@BeforeSuite
public void startDriver(String browserName) {
if (browserName.equalsIgnoreCase("chrome")) {
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "/drivers/chromedriver.exe");
driver = new ChromeDriver(chromeOption());
}
else if (browserName.equalsIgnoreCase("firefox")) {
System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "/drivers/geckodriver.exe");
driver = new FirefoxDriver(firefoxOption());
}
else if (browserName.equalsIgnoreCase("ie")) {
System.setProperty("webdriver.ie.driver", System.getProperty("user.dir") + "/drivers/IEDriverServer.exe");
driver = new InternetExplorerDriver();
}
else if (browserName.equalsIgnoreCase("safari")) {
driver = new SafariDriver();
}
}
---------------
FAILED CONFIGURATION: @BeforeSuite startDriver
org.testng.TestNGException:
Parameter 'browserName' is required by @Configuration on method startDriver but has not been marked @Optional or defined
in F:\eclipse-workspace\2D-3D-Analysis\testng.xml
at org.testng.internal.Parameters.createParameters(Parameters.java:159)
at org.testng.internal.Parameters.createParameters(Parameters.java:372)
at org.testng.internal.Parameters.createConfigurationParameters(Parameters.java:90)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:199)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:140)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:296)
at org.testng.SuiteRunner.run(SuiteRunner.java:259)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1200)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1125)
at org.testng.TestNG.run(TestNG.java:1033)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Hi Ahmed, are you running the base class file or testng.xml file
Hi Raghav Sir,
Thank you so much for your tutorials its very useful.
Please can you give me sample script how to run same test cases on multiple envi like QA, Prod and demo
using command promt
Hi Pooja, I do not have anything handy with me right now, In general, you will put your env dependent parameters in variables and get the values of these variables externally, from a config file or properties file and the same can be used from command line
Hi Raghav thanks for the video.I have a question, can we do same thing in pytest?
Yes, you can do
Hi sir
@Parameters("browsername") is showing error
like attribute value is undefined for annotation type paramatarized.Parameters
if know the solutiion please help
Vamshi
The error message "The attribute value is undefined for the annotation type Parameters" usually occurs when the import statement is incorrect. Here's how you can fix it:
1. Check Your Import Statements:
- Make sure you're importing the correct `@Parameters` annotation from TestNG.
- Use this import statement:
```java
import org.testng.annotations.Parameters;
```
- Remove any other conflicting import statements related to parameters (e.g., `import com.beust.jcommander.Parameters;`).
2. Update Your Code:
- Replace the existing import with the correct one:
```java
import org.testng.annotations.Parameters;
```
3. Example Usage:
- Here's how you can use `@Parameters` in your TestNG class:
```java
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
public class MyTestClass {
@BeforeTest
@Parameters("browsername")
public void setUp(String browser) {
// Your setup logic here based on the browser parameter
System.out.println("Running test on " + browser);
}
}
```
Make sure you've corrected the import statement, and your `@Parameters` annotation should work as expected
-
@@RaghavPal thanks very much
Hi Raghav,
I was running my testng.xml file.In that file I have added two tests that is one test on chrome and other on firefox with same class and the class has only one method and I run them in parallel mode, so according to that in testng report it should show one method of one test and one method of other test but for one test it is showing the same method run twice and for other test it is showing only one method which is working fine..The firefox browser is working fine but for the chrome the execution is stopping after sometime without completion .Can you help me with that.
Hi Apeksha, I will need error details and logs to troubleshoot this. You can try some online help as well
@@RaghavPal Hi Raghav, I am having the same issue. After doing some research, I found that it may get solved if we Initialize the WebDriver object as a Thread Local for Parallel Test Execution. ThreadLocal driver = new ThreadLocal(); Can you help us on this?
And thanks a lot for your videos, it helps me a lot.
Sir do u have birds around you while recording... a beautiful environment around you !
Yes, many, thanks for watching Raj
how to fix that last configuration failure while i am running please provide the solution for that
Need more details and examples
Hi Raghav,
Great explanation,. Thanks a lot. I have one doubt, I have browser invoke script base class( initialize function) and test script( here i am also extends the base class) in another class. But while executing testng.xml , its not picking the browsers browser returns null. .Can you advise how to do that. or can you share your mail id so that i can mailed my code.
Hi Ranjit, can you recheck all the steps from the video. I believe something is missing.
@@RaghavPal Hi Raghav, Thanks for your reply. Its working fine when i have Browser Setup and test in single file.
My issue is Browser setup(BaseCalss.java-initialize(String Browser) function)) in one file and test is in another file. While running Testng.xml file its failing there. I have to call the browser setup(-initialize(String Browser) function) file in testscript file. Browser value have to be passed to the test script file.
Okay, may be I will need to have a session on this. For now you can continue with the concepts and revisit this later
Hi Raghav, I am getting error when i put @parameters("browserName") i.e the attribute value is undefined for the annotation type parameterized.parameters testng. Please help me out !!
Hi Kuldeep, just check you imported Parameters from TestNG lib and not any other lib. Also check this stackoverflow.com/questions/47612476/the-attribute-value-is-undefined-for-the-annotation-type-parameters-error-is-d
I was not able to import it so alternatively used this @org.testng.annotations.Parameters("browserName") and now its worked. Thank you again
Great to know this Kuldeep
Hi Raghav, I used the same to run on chrome and edge, but it is not running in parallel - it is executing one after other. What may be the reason. And how to resolve that.
will need to check your setup Puneet, Try some online examples
Thanks a lot Sir . But in my case near my @Parameters annotation - it just gives me the error " Parameters is disallowed in this location" . After i copied everything as in the video . Anyone ? Any ideas?) Thanks..
Hi Stas, will need to see the details, can check some online examples
Thanks for the tutorial. But you did not even bother to solve the IE issue. What was the actual issue? for IE?
My Chrome and Firefox opened but not IE.
I will really appreciate if you reply with an answer.
Hi, I covered IE separately in this video - th-cam.com/video/XrQ4fqg97GI/w-d-xo.html
You can also check complete playlist here - automationstepbystep.com/
I have write same code but getting error in Test Method for void Test1() as invalid type .same error for void Teardown method ().
Plz help for solving these errors.
Hi Minakshi, will need to check the error and logs, Try to check all required libraries are added
Thank you for reply .plz help me to solve below error
In testng.xml file I enter @para & press ctrl+spacebar but it shows message like no default proposals .
On other way I enter the parameter syntax manually but shows error like "parameters" must be declared. I followed same step given by u . Any suggestion how to solve this error plz help.
@RaghavPal
How to achieve this using testng with cucumber BDD framework. Kindly through some light.
Hi Satyanarayan
Here are the steps on how to achieve multiple browser testing in parallel using TestNG with Cucumber BDD framework:
1. Create a Maven project in your favorite IDE adding Cucumber dependencies to the POM as detailed here and TestNG dependencies here.
2. Add the two feature files (scenarios.feature and scenario-outlines.feature) and step definition class as described in the JUnit section.
3. Create a TestNG XML file and add the following configuration:
```xml
```
This configuration will create two tests, one for Chrome and one for Firefox. The `browser` parameter will be passed to the CucumberTest class, which will use it to initialize the appropriate browser driver.
4. Run the TestNG XML file using the following command:
```
mvn test -DsuiteXmlFile=testng.xml
```
This will run the two tests in parallel, one for Chrome and one for Firefox.
Here are some additional things to keep in mind when achieving multiple browser testing in parallel using TestNG with Cucumber BDD framework:
* You need to have the correct browser drivers installed on your machine.
* You need to specify the browser name in the TestNG XML file.
* You need to create a separate step definition class for each browser.
* You need to make sure that your code is thread-safe
@@RaghavPal How to make the cucumber test runner class as @Test annotation of TestNG. So that it will execute from TestNG xml suite
@RaghavPal could you please make video on that. It will be really helpful.
Gracias hermano
Most welcome Daler
my tearDown() is not quitting IE browser in either case, parallel or multi :(
Hi Deepak, I will need to see code and logs for troubleshooting
👍
I would like to help you out . Would it be possible for you to answer my questions? How can I help your cause?
Hi Sandeep, how exactly do you wish to help
@@RaghavPal Financially I can spare a bit. not too much though. A little bit.
I want my questions answered too.
@@RaghavPal Raghav?
Hi Sandeep, the best help for now can be to spread this free education to all who may need it, Share in all your groups - automationstepbystep.com/
Also if people can help in answering comments and helping users, it will be a great help
Excuse me, I discovered my mistake.
Glad to know this Rebeka
facing same whats the solution
This is video is really not that helpful as you've already created most crucial aspect of the framework off-camera.
Hi Joshua, I think you did not see earlier videos. Pls check here - th-cam.com/play/PLhW3qG5bs-L8oRay6qeS70vJYZ3SBQnFa.html
You can find all playlists here - automationstepbystep.com/online-courses/
:)