Man you have explained each and everything so beautifully and detail oriented, also when you mention the minute details like + sign or pess crtl A+ ctrl I. It's just amazing.
In case you face issues generating HTML REPORT then under target folder manually create a folder named HtmlReports and in the code add the following: plugin= {"pretty", "html:target/HtmlReports/report.html"} (names can be changed)
Every time I watch your videos you inspire me more and more to learn, my English is not perfect but I understand you very well, that has never happened to me, I paid some courses in my language and paused them, your videos are better. You are truly the best, thank you for all the material, you help me a lot.
Hello Raghav - I just finished watching this video. I must say the simplicity is your strength. You have designed your sessions in a very easy to understand manner. Thank you for sharing your knowledge with word. I loved your story of becoming full time teacher to follow your passion. More power to you.
i'm following ur courses for the past 4 days .. you have explained things clear and slowly.. and even u point out useful tips.. Specially end message interesting. you are far more than I expected.. thank you for sharing the knowledge
I am thoroughly enjoying these sessions, you explain everything so well with such level of details. Learn bunch on tricks working with mad Eclipse. You are wonderful, thank you for all the effort your are putting into your videos. I realize this is an older video, but still so relevant. Thank you!!!
Hi Raghav, your work is outstanding. I love watching all your videos, and the way you present ALL your tutorials. Are you going to make a complete E2E Cucumber Framework????
Simply wow just started to watching this channel ,,Amazing stuff,,,Mr:Raghav u r such an outstanding teacher,,Well explained each and every step,,Thats what all we needed,,,Hatsoff to ur efforts. pls keep up ur good work,,It is very useful for learners.
Hi Raghav, I have gone through session1 and session2. Both sessions are very well explained, I have executed and overcome all errors on my own. Thanks a lot!
Hi Mr Raghav, That is superb. step by step...... Perfectly working good and even i have modified my own search. it is perfect. Thanks for making it. Jeyakumar, Housto, Texas
Thanks Ragav, Thanks for your valuable information and valuable word's, I won't stop learning and will also share my knowledge 😃 for everyone like you.
I have 2 questions from your first two videos: 1. At the end I see only 1 test was run and JUnit report generated for Google Search test that you created in this video but why did it not run the test for Login feature which you created in the previous video? 2. This is a continuation of the previous question: The test runner class points to the folder containing of the feature files and the folder containing the step definition files but the feature file and step definition files do not have a 1:1 mapping. Then when running the JUnit test how will the feature file know which step definition file to look for if more than 1 step definition file have the same steps defined? For example common steps like opening a browser will be same across all tests. Thanks for the video! I hope to hear back from you on these questions!
Shreya 1. If you point the timestamps of the parts you are referring to it will be easier for me to check. I believe i ran the particular feature file, so it ran that feature only 2. Please elaborate on what is meant by 1:1 mapping Let me know so I can provide specific inputs
Thanks for your reply Raghav! I saw the video again and at 26:52 the feature file name was mentioned specifically and not the file location name. So that answers my first question. For the second question I mean that if I run the feature file, the glue code mentions the name of the step definition location folder and not the exact step definition file then how will the feature file know which of the step definition file to look for the steps mentioned? Will it check all the step definition files in that folder for the steps? And if so, what happens when 2 or more files have the same steps mentioned? For example one feature file is for login to Google and another is for Google search. Both will include the URL of navigating to Google page and step definition will contain the same steps for both. Then if I choose to run one of the feature file, how will it know which step definition file to run?
Shreya Great question! When you run a feature file in a Cucumber project, the glue code doesn't need to specify the exact step definition file. Instead, it specifies the package where the step definition files are located. Here's how it works: 1. Step Definitions Search: Cucumber will search through all the step definition files in the specified package for the steps mentioned in the feature file. It doesn't matter how many step definition files there are in the package, Cucumber will check all of them. 2. Duplicate Steps: If two or more step definition files have the same steps mentioned, Cucumber will throw an `AmbiguousStepDefinitionsException`. This is because Cucumber wouldn't know which step definition to use. It's best practice to ensure that each step is defined only once across all step definition files. 3. Shared Steps: In your example, if both the "login to Google" and "Google search" feature files include the step of navigating to the Google page, you can define this step in a common step definition file that both feature files can use. This way, you avoid duplicate step definitions and keep your code DRY (Don't Repeat Yourself). So, when you choose to run a feature file, Cucumber will look at the steps in the feature file, then search the specified package for step definition files that define those steps. It doesn't need to know ahead of time which specific step definition file to use. I hope this clears up your question
@@RaghavPal thank you so much for the detailed explanation. This really helps a lot! Thank you so much for your time and effort in answering my doubts, I really appreciate the help! 😊
SIr, pagetimeout and implicitwait is deprecated...What is this depcrecated means? how i can over come this issue?....Thank u for this beautiful vedio....
Hi Raghav , You have uploaded bdd framework of cucumber consists of totally 8 videos in playlists- Is it covers all the basics of this framework or some more you going to add lists ? And thanks of your valuable time with all of leavers to gain the knowledge about superb teaching the framework in simple/clear way of steps/videos which you have been taken taught us👌🏻👍🏻
Thanks a lot for the message Vishnu, As of now these are the videos that cover all the basics to get anyone started with Cucumber BDD. I will add more videos in some time to this list. All will be available here - automationstepbystep.com/
Great explanation! Although I've one query regarding getting the project path through the following line of code: String projectPath = System.getProperty("user.dir"); I am getting project path = null. How do I know what argument to give here?
Hira The reason you're getting `null` when using `System.getProperty("user.dir")` to get the project path within your Cucumber BDD test in Selenium Java could be due to several factors. Here are some possibilities and solutions: *1. Initializing the project path before Cucumber execution:* * `System.getProperty("user.dir")` retrieves the working directory at the time it's called. If you're calling it before your Cucumber test execution begins, the working directory might not be set to the project root yet. *Solution:* * Move the code fetching the project path to the *@Before* hook of your Cucumber test class. This ensures the `System.getProperty("user.dir")` call happens within the designated test execution context. *2. Maven build configuration:* * If you're using Maven to build your project, the working directory might not be set correctly during test execution. *Solution:* * Make sure your Maven build profile sets the working directory to the project root directory during testing. You can achieve this by using the `workingDirectory` property in your test pom.xml. *3. IDE configuration:* * Your IDE might be launching the tests from a different directory than the project root. *Solution:* * Ensure your IDE is launching the Cucumber tests from the correct project root directory. Check the run configuration settings and adjust accordingly. *4. Environment variables:* * In some cases, environment variables can override the default working directory behavior. *Solution:* * Check for any conflicting environment variables that might be setting the working directory to a different location. Here are some alternative ways to get the project path in your Cucumber BDD tests: *Cucumber options:* You can use the `--projectPath` option when running your Cucumber tests from the command line. *Resource files:* Store the project path in a resource file like `project.properties` and access it within your tests. *System properties:* Use `System.getProperties().getProperty("project.root")` to access a custom system property set earlier in your execution process. Remember to adapt the solution to your specific project and environment. If you provide additional details about your project setup and Cucumber configuration, I can offer more specific guidance.
Hi Raghav, I'm starting to learn automated testing, but I'm not very experienced. I followed all the Playwright videos and I thank you because I found them very interesting and very helpful. But if I also wanted to use cucumber in Visual Studio Code with Playwright to have the simplest part of being able to write with Gherkin language, but also the convenience of using the recording with Playwright and helping me with the code, can it be done? And how? Do you have a video where the two things work together and show how to set everything up? Thanks in advance
Melania Combining Cucumber with Playwright in your automated testing workflow is a great choice. It allows you to write tests in a human-readable format (Gherkin language) while leveraging Playwright's powerful capabilities. Let's get you started: 1. Setting Up Cucumber with Playwright in Visual Studio Code: - Here are the steps to set up Cucumber with Playwright in VS Code: - Step 1: Install Dependencies - Make sure you have Node.js and npm installed. - Create a new directory for your project and navigate to it in the terminal. - Run the following commands to install necessary dependencies: ``` npm init -y npm install playwright cucumber @types/cucumber ``` - Step 2: Create Feature Files - Create a new directory called `features`. - Inside the `features` directory, create `.feature` files that contain your Gherkin scenarios. - Step 3: Write Step Definitions - Create a new directory called `step-definitions`. - Inside the `step-definitions` directory, create TypeScript files that define your step definitions. - Map each Gherkin step to a corresponding Playwright action. - Step 4: Configure Cucumber - Create a `cucumber.config.js` file in your project root. - Configure Cucumber to use Playwright by specifying the path to your step definitions and feature files. - Step 5: Run Your Tests - Write your Gherkin scenarios in the `.feature` files. - Implement the step definitions in TypeScript. - Run your tests using: ``` npx cucumber-js ``` Can refer below videos and tutorials - "Create feature, steps & config | Playwright & Cucumber - Typescript | Part 1" by LetCode with Koushik: - "Automation using Playwright Library with Cucumber JS" by Business Process Incubator: all the best..
Thanks for this BDD tutorial Raghav. This is a very nice session for all levels. Thanks a lot. Do you have any sessions for TestNG(with all the required annotations) tutorials?
Hi sir this is sairam, first i have to thank you because of your videos I've gained so much knowledge, sir i I'm not able to enter the text in the search fields showing the null exception
Hi Sai there could be a few potential causes and solutions: Verify Element Identification: Ensure that you are correctly identifying the search field using a proper locator strategy such as ID, CSS selector, XPath, etc. Double-check that the locator you are using is correct and that it uniquely identifies the search field. Check Element Visibility: Make sure that the search field is visible on the page before attempting to interact with it. If the element is hidden or not yet rendered, you may need to add explicit waits to ensure it is available for interaction. Ensure Element Initialization: Ensure that you have properly initialized the WebElement object representing the search field before trying to interact with it. This involves using methods like driver.findElement() or using a Page Object pattern to initialize the element. Handle Frame or : If the search field is within a frame or , you need to switch the driver's context to that frame before interacting with the search field. Use the driver.switchTo().frame() method to switch to the correct frame. Handle Dynamic Elements: If the search field's attributes or location on the page are dynamically changing, you may need to adjust your locator strategy accordingly. Consider using more robust locator strategies or techniques like XPath axes or CSS selectors to locate the element reliably. Check for Interfering Elements: Ensure that there are no overlapping elements or pop-ups covering the search field. If there are any interfering elements, you may need to close or interact with them before accessing the search field. Check for JavaScript Errors: Check the browser's console for any JavaScript errors that could be interfering with the functionality of the search field. Resolve any errors that are present. I hope one of the solutions should work for you
Thanks Raghav, another great video. Interestingly, I noticed that if I omit the line System.setProperty("webdrive.chrome.driver", "src/test/resources/drivers/chromedriver.exe"), the code still works fine. Not sure that the setProperty is needed at all. Even if I delete the chromedriver.exe file from the project, it still managed to run OK. Not sure how that works!
REALLY INFORMATIVE. Much appreciated. I just have one hiccup, when I create reports with testrunner , i.e html, i tried it your way with the exact same steps, and I didnt get the htmlReport like yours. Is there an extension I need to type before running the testrunner? like .html?
Hi Rohan, that should be in the Cucumber library itself. Not sure if this can be due to diff version. Can try again with the ver I have used and also try some online help
For anybody following, and getting the 'cookies' message when the google page is loaded, a simple addition to the feature and steps file works wonders ;)
Thanks Raghav,i love your explatination but when i tried to do same i am unable to generate my html reports, it is depends on any version compatbility?
Sir..this is a great tutorial..extremely helpful. Looking forward for tour help on the issue I am facing. I have created single feature file and have created a java class with feature file annotations, however on running feature file, the code written in java file is not getting called. Pls suggest.
Hi Priyanka, most probably, it may be due the the location of the glue code you have mentioned in Cucumber Runner, Also check if the steps in feature file are same in step definition
@@RaghavPal as explained inyourvideo, i created a single feature file an given the same name in feature file annotations and in java class functions. I didnt create any runner fule as I only have one feature file.
Hi Rajesh, You can goto Help > Install New Software> In opened dialog click on Already Installed stackoverflow.com/questions/15265264/how-to-find-the-installed-plugins-in-eclipse/15265745
Hi Raghav, I tried same scenario but getting error message The driver executable does not exist: C:\Users\bajaj\eclipse-workspace\Dir\src\test esources\driver i printed user.dir command got this output C:\Users\bajaj\eclipse-workspace\Dir what i am using in path System.setProperty("webdriver.chrome.driver",path+"/src/test/resources/driver");
according to my understanding its taking backward slash and i am entering forward slash but when i try backward slash it gives me complie tim error
Hi Sonali, forward slash is fine, the path should be upto chromedriver.exe. Pls add that and also try to print the value of path+"/src/test/resources/driver to confirm
Man you have explained each and everything so beautifully and detail oriented, also when you mention the minute details like + sign or pess crtl A+ ctrl I. It's just amazing.
So happy to hear this Anmol
Thank You sir for Ctrl A + Ctrl I
In case you face issues generating HTML REPORT then under target folder manually create a folder named HtmlReports and in the code add the following:
plugin= {"pretty", "html:target/HtmlReports/report.html"}
(names can be changed)
One doubt. I am getting The method implicitlyWait(long, TimeUnit) from the type Web driver.Timeouts is deprecated. Any suggestions what to do?
Every time I watch your videos you inspire me more and more to learn, my English is not perfect but I understand you very well, that has never happened to me, I paid some courses in my language and paused them, your videos are better. You are truly the best, thank you for all the material, you help me a lot.
So happy and humbled to read this.. thanks Sara
Anyone got the teacher like you then no one want to Stop learning Raghav sir ..special thanks to you
So happy to read your message Sunil
Hello Raghav - I just finished watching this video. I must say the simplicity is your strength. You have designed your sessions in a very easy to understand manner. Thank you for sharing your knowledge with word. I loved your story of becoming full time teacher to follow your passion. More power to you.
Thanks a lot for the kind words Harsh.. humbled
A big salute to your Passion and Mission Raghav.
Thank you so much for teaching us each topic in depth ❤🙏
Most welcome Tejas
i'm following ur courses for the past 4 days .. you have explained things clear and slowly.. and even u point out useful tips..
Specially end message interesting. you are far more than I expected.. thank you for sharing the knowledge
So happy n humbled to see your message Sathish
Omg you are one of the best one. why didn't i see your post 2 years back? i really salute you
Thanks a lot
Hi Raghav, I have no words to express my gratitude about this tutorial and others .
Your tutorials are a reference to automation.
Amazing work.
You are most welcome
I am thoroughly enjoying these sessions, you explain everything so well with such level of details. Learn bunch on tricks working with mad Eclipse. You are wonderful, thank you for all the effort your are putting into your videos. I realize this is an older video, but still so relevant. Thank you!!!
Great to hear Sintia.. keep learning
Hi Raghav, your work is outstanding. I love watching all your videos, and the way you present ALL your tutorials. Are you going to make a complete E2E Cucumber Framework????
I will plan to cover most of the features. Thanks a lot for your message. Humbled
Thank you Mr. Raghav, you are great! I really learned a lot from your lectures . They are all excellent!
Most welcome Sayed
Your way of teaching is just fantastic....and you are truly justifying your You tube channel name as....Step by step...Thanks a lot
So nice of you Ishwar.. humbled
He is my Guru... i present things at work all because of your videos. 😊 🙏 😊 🙏 thanks again sir
All the best Mzamo
Very nicely explained Raghav Bhai. Awesome...Good presentation. I have run my first cucumber project with the help of your video.
So happy to know this Mayank. Keep learning
After finding you, I feel like I will "Never Stop Learning".
All the best Mandeep
Thanks Raghav , you saved my career. Thanks for your all quality sessions.
Most welcome Mitali. Humbled
Thank you so much. 3 days I trying to execute the cucumber code.
Now only I can able to open the chrome browser.
Thank you soooo much...
You are most welcome Revathi
Hi @Ragav I am facing issue.. Chrom is not launching getting error.. How can I connect with you
@@sabanamondal5829 What is the error showing in the console?
@Raghav Pal I love watching your video. Very Detailed & nicely articulated. Excellent place for beginners
So nice of you Rashmi
Hi Raghav your inspiring and motivational messages always wakes me up, also doing great help to all. Proud your Between us. Thank you, I appreciate.
So nice of you Swetha, humbled
brother you did the explenation better then others...God bless you ..
Thank you so much 😀 Humbled
Simply wow just started to watching this channel ,,Amazing stuff,,,Mr:Raghav u r such an outstanding teacher,,Well explained each and every step,,Thats what all we needed,,,Hatsoff to ur efforts. pls keep up ur good work,,It is very useful for learners.
So nice of you Nellai. i will..
Hats off to you Sir , in such simple terms you have explained the basic concepts. And the tag line is very motivating, never stop learning 🙂
Thanks a ton Kanchan
Thank you sir for the wonderful explanation. You are one of the best instructors.
You are very welcome Ahmad
Hello sir..
Very useful session.
I followed this steps continued to before session..
All are working without any errors..
Excellent
Thanks you raghav to give your knowledge to others.
Most welcome Suvin
Hi Raghav, I have gone through session1 and session2.
Both sessions are very well explained, I have executed and overcome all errors on my own.
Thanks a lot!
Glad to hear that Srikanth
I really appreciate your videos, the examples and explanation are very clear.
Most welcome Julio
For me u r Just brilliant out of all QA automation youtubers....
Thanks a lot
Hi Mr Raghav, That is superb. step by step...... Perfectly working good and even i have modified my own search. it is perfect. Thanks for making it. Jeyakumar, Housto, Texas
You are most welcome Jeyakumar, Houston was my first US city
Thank you sir, i really dont known how to thank you, after watching your vedio really felt like enlightened. and confident...
You are most welcome
Thank you Raghav Sir , i love u r teaching skill please make full playlist of Bdd cucumber frameworks and all concept 🙏🙏🙏
I will try my best Sahil
Thank you Mr Raghav Pal for your videos; it's amazing and yes it's the STEP BY STEP courses not like others channels ;) Thank you so much
So nice of you
Wow, just amazing tutorial, thank you. I don't comment on many videos I watch on RUclips, but I had to for this one. Thank you Raghav.
This is very humbling
Thanks alot Raghav for your outstanding way of explaining things.
So nice of you Monica
Hi Raghav, Your explanation is awesome,easily understandable by a beginner.Thanks for all your hard work.
You're most welcome. So happy to see this message Siddharthi
Thanks Ragav, Thanks for your valuable information and valuable word's, I won't stop learning and will also share my knowledge 😃 for everyone like you.
All the best
Truly awesome explanation Raghav !!!
Thanks a lot Kaushik
Thank you so much Raghav for this Cucumber BDD series.
Most welcome Pankaj
Hi Raghav, your videos are great source to learn, a big applause for your efforts. Thanks a lot.
You are most welcome Monisha
just start to learn Cucumber, very helpful, thanks for sharing, keep it up!
Glad it was helpful Hoang Le
Very nice and clearly explained each and every step. Thank you
How can I get in touch with you? I sent you DM on your Instagram
You' re welcome Zeshan, you can send me messages here
You are always positive . Thank you for your hard work..
most welcome Aylin
Super sir totally and easily understanble
Great to know
Awesome explanation sir. Thank you for sharing your knowledge with every one.!!
Thanks and welcome Belodu
Awesome, Ran my first cucumber test today. You Rock!
So happy to know this. All the best
Great video Sirji, Thank you!
Most welcome!
Thanks a ton raghav for all you videos. God bless you!!!
So nice of you Bala
Very impressed with your videos. Love the step by step guides. Keep up the good work
Glad you like them Anzo
Well explained. I am your big fan Raghav Bhai :)
Thanks a lot Deepak
Excellent explanation 🎉🎉🎉🎉🎉🎉
Thanks
Thanks a lot. Very informative.
You are welcome!
Excellent articulation .
Thanks Anantha
Hi Raghav, thank you very much for your great Job.
Most Welcome Saeed
Thanks a lot for your support with your videos ❤️
So nice of you
Thanks so much. love your kind explanation. Thanks so much
You are so welcome Stella
The ending was Great!
Thanks for watching Frank
GOAT of automation
Humbled, thanks for your kind words Akhil
Thank you Ragav , you given me a clear picture
Glad to know Madhu
Awesome explanation
Most welcome Suchi
Hi Ragav, Very nice session Thanks
Always welcome
I have 2 questions from your first two videos: 1. At the end I see only 1 test was run and JUnit report generated for Google Search test that you created in this video but why did it not run the test for Login feature which you created in the previous video? 2. This is a continuation of the previous question: The test runner class points to the folder containing of the feature files and the folder containing the step definition files but the feature file and step definition files do not have a 1:1 mapping. Then when running the JUnit test how will the feature file know which step definition file to look for if more than 1 step definition file have the same steps defined? For example common steps like opening a browser will be same across all tests.
Thanks for the video! I hope to hear back from you on these questions!
Shreya
1. If you point the timestamps of the parts you are referring to it will be easier for me to check. I believe i ran the particular feature file, so it ran that feature only
2. Please elaborate on what is meant by 1:1 mapping
Let me know so I can provide specific inputs
Thanks for your reply Raghav! I saw the video again and at 26:52 the feature file name was mentioned specifically and not the file location name. So that answers my first question.
For the second question I mean that if I run the feature file, the glue code mentions the name of the step definition location folder and not the exact step definition file then how will the feature file know which of the step definition file to look for the steps mentioned? Will it check all the step definition files in that folder for the steps? And if so, what happens when 2 or more files have the same steps mentioned? For example one feature file is for login to Google and another is for Google search. Both will include the URL of navigating to Google page and step definition will contain the same steps for both. Then if I choose to run one of the feature file, how will it know which step definition file to run?
Shreya
Great question! When you run a feature file in a Cucumber project, the glue code doesn't need to specify the exact step definition file. Instead, it specifies the package where the step definition files are located. Here's how it works:
1. Step Definitions Search: Cucumber will search through all the step definition files in the specified package for the steps mentioned in the feature file. It doesn't matter how many step definition files there are in the package, Cucumber will check all of them.
2. Duplicate Steps: If two or more step definition files have the same steps mentioned, Cucumber will throw an `AmbiguousStepDefinitionsException`. This is because Cucumber wouldn't know which step definition to use. It's best practice to ensure that each step is defined only once across all step definition files.
3. Shared Steps: In your example, if both the "login to Google" and "Google search" feature files include the step of navigating to the Google page, you can define this step in a common step definition file that both feature files can use. This way, you avoid duplicate step definitions and keep your code DRY (Don't Repeat Yourself).
So, when you choose to run a feature file, Cucumber will look at the steps in the feature file, then search the specified package for step definition files that define those steps. It doesn't need to know ahead of time which specific step definition file to use.
I hope this clears up your question
@@RaghavPal thank you so much for the detailed explanation. This really helps a lot! Thank you so much for your time and effort in answering my doubts, I really appreciate the help! 😊
Great sir thank you very much
Most welcome Akash
nice work Bro, You are life changer
Thanks Jay
Thank you so much for this sir! Very well explained👍
Most welcome
You are great sir👍☺️
Thanks Ankit Humbled
excellent work .......learned more !!!
glad to know Hari
SIr, pagetimeout and implicitwait is deprecated...What is this depcrecated means? how i can over come this issue?....Thank u for this beautiful vedio....
deprecated means this function was available in earlier version but is discontinued in this version, you can check the alternatives
Thank u so much raghav sir
Most welcome Shivani
Outstanding!
Glad you like it Thomas
informative lecture !! every thing is clear kudos to you :)
Thanks a ton Arpana
Hey there! Great video
Yes, we can do
Thanks raghav....
Could you please make video on Framework creations in selenium ...
Yes Amol, some are available here - automationstepbystep.com/
Hi Raghav ,
You have uploaded bdd framework of cucumber consists of totally 8 videos in playlists- Is it covers all the basics of this framework or some more you going to add lists ? And thanks of your valuable time with all of leavers to gain the knowledge about superb teaching the framework in simple/clear way of steps/videos which you have been taken taught us👌🏻👍🏻
Thanks a lot for the message Vishnu, As of now these are the videos that cover all the basics to get anyone started with Cucumber BDD. I will add more videos in some time to this list. All will be available here - automationstepbystep.com/
Great explanation! Although I've one query regarding getting the project path through the following line of code:
String projectPath = System.getProperty("user.dir");
I am getting project path = null. How do I know what argument to give here?
Hira
The reason you're getting `null` when using `System.getProperty("user.dir")` to get the project path within your Cucumber BDD test in Selenium Java could be due to several factors. Here are some possibilities and solutions:
*1. Initializing the project path before Cucumber execution:*
* `System.getProperty("user.dir")` retrieves the working directory at the time it's called. If you're calling it before your Cucumber test execution begins, the working directory might not be set to the project root yet.
*Solution:*
* Move the code fetching the project path to the *@Before* hook of your Cucumber test class. This ensures the `System.getProperty("user.dir")` call happens within the designated test execution context.
*2. Maven build configuration:*
* If you're using Maven to build your project, the working directory might not be set correctly during test execution.
*Solution:*
* Make sure your Maven build profile sets the working directory to the project root directory during testing. You can achieve this by using the `workingDirectory` property in your test pom.xml.
*3. IDE configuration:*
* Your IDE might be launching the tests from a different directory than the project root.
*Solution:*
* Ensure your IDE is launching the Cucumber tests from the correct project root directory. Check the run configuration settings and adjust accordingly.
*4. Environment variables:*
* In some cases, environment variables can override the default working directory behavior.
*Solution:*
* Check for any conflicting environment variables that might be setting the working directory to a different location.
Here are some alternative ways to get the project path in your Cucumber BDD tests:
*Cucumber options:* You can use the `--projectPath` option when running your Cucumber tests from the command line.
*Resource files:* Store the project path in a resource file like `project.properties` and access it within your tests.
*System properties:* Use `System.getProperties().getProperty("project.root")` to access a custom system property set earlier in your execution process.
Remember to adapt the solution to your specific project and environment. If you provide additional details about your project setup and Cucumber configuration, I can offer more specific guidance.
very well define keep uploading
Thank you, I will Amit
simple work, we can use for all browsers the magic webdrivermanager ;-))
Yes, I have shown it in Selenium tutorials - ruclips.net/video/8vWTgyoG0nc/видео.html
Hi Raghav, I'm starting to learn automated testing, but I'm not very experienced.
I followed all the Playwright videos and I thank you because I found them very interesting and very helpful.
But if I also wanted to use cucumber in Visual Studio Code with Playwright to have the simplest part of being able to write with Gherkin language, but also the convenience of using the recording with Playwright and helping me with the code, can it be done? And how?
Do you have a video where the two things work together and show how to set everything up?
Thanks in advance
Melania
Combining Cucumber with Playwright in your automated testing workflow is a great choice. It allows you to write tests in a human-readable format (Gherkin language) while leveraging Playwright's powerful capabilities. Let's get you started:
1. Setting Up Cucumber with Playwright in Visual Studio Code:
- Here are the steps to set up Cucumber with Playwright in VS Code:
- Step 1: Install Dependencies
- Make sure you have Node.js and npm installed.
- Create a new directory for your project and navigate to it in the terminal.
- Run the following commands to install necessary dependencies:
```
npm init -y
npm install playwright cucumber @types/cucumber
```
- Step 2: Create Feature Files
- Create a new directory called `features`.
- Inside the `features` directory, create `.feature` files that contain your Gherkin scenarios.
- Step 3: Write Step Definitions
- Create a new directory called `step-definitions`.
- Inside the `step-definitions` directory, create TypeScript files that define your step definitions.
- Map each Gherkin step to a corresponding Playwright action.
- Step 4: Configure Cucumber
- Create a `cucumber.config.js` file in your project root.
- Configure Cucumber to use Playwright by specifying the path to your step definitions and feature files.
- Step 5: Run Your Tests
- Write your Gherkin scenarios in the `.feature` files.
- Implement the step definitions in TypeScript.
- Run your tests using:
```
npx cucumber-js
```
Can refer below videos and tutorials
- "Create feature, steps & config | Playwright & Cucumber - Typescript | Part 1" by LetCode with Koushik:
- "Automation using Playwright Library with Cucumber JS" by Business Process Incubator:
all the best..
@@RaghavPal Thank you so much, I will follow your steps. Grazie grazie 😃
Thanks for this BDD tutorial Raghav. This is a very nice session for all levels. Thanks a lot.
Do you have any sessions for TestNG(with all the required annotations) tutorials?
Hi Joydeep, TestNG with Cucumber is yet to be done, You can check all here - automationstepbystep.com/
Thank you so much sir
Most welcome Neha
Thanks Raghav for your wonderful videos.I really learnt a lot.Are there any upcoming courses on tosca??
Hi Deepika, not yet planned, will add on my list
I am like your session
Thanks a lot Brijesh
Very good..
Thanks
Superb
Thanks 🤗
Hi sir this is sairam, first i have to thank you because of your videos I've gained so much knowledge, sir i I'm not able to enter the text in the search fields showing the null exception
Hi Sai
there could be a few potential causes and solutions:
Verify Element Identification: Ensure that you are correctly identifying the search field using a proper locator strategy such as ID, CSS selector, XPath, etc. Double-check that the locator you are using is correct and that it uniquely identifies the search field.
Check Element Visibility: Make sure that the search field is visible on the page before attempting to interact with it. If the element is hidden or not yet rendered, you may need to add explicit waits to ensure it is available for interaction.
Ensure Element Initialization: Ensure that you have properly initialized the WebElement object representing the search field before trying to interact with it. This involves using methods like driver.findElement() or using a Page Object pattern to initialize the element.
Handle Frame or : If the search field is within a frame or , you need to switch the driver's context to that frame before interacting with the search field. Use the driver.switchTo().frame() method to switch to the correct frame.
Handle Dynamic Elements: If the search field's attributes or location on the page are dynamically changing, you may need to adjust your locator strategy accordingly. Consider using more robust locator strategies or techniques like XPath axes or CSS selectors to locate the element reliably.
Check for Interfering Elements: Ensure that there are no overlapping elements or pop-ups covering the search field. If there are any interfering elements, you may need to close or interact with them before accessing the search field.
Check for JavaScript Errors: Check the browser's console for any JavaScript errors that could be interfering with the functionality of the search field. Resolve any errors that are present.
I hope one of the solutions should work for you
Awesome
Thanks Priya
wow that was great tutorial
Glad you liked it Faridoon
Thanks Raghav, another great video. Interestingly, I noticed that if I omit the line System.setProperty("webdrive.chrome.driver", "src/test/resources/drivers/chromedriver.exe"), the code still works fine. Not sure that the setProperty is needed at all. Even if I delete the chromedriver.exe file from the project, it still managed to run OK. Not sure how that works!
Please check your env variables on your system, Most probably the path of your chromedriver.exe is added in the PATH env variable
REALLY INFORMATIVE. Much appreciated. I just have one hiccup, when I create reports with testrunner , i.e html, i tried it your way with the exact same steps, and I didnt get the htmlReport like yours. Is there an extension I need to type before running the testrunner? like .html?
Hi Rohan, that should be in the Cucumber library itself. Not sure if this can be due to diff version.
Can try again with the ver I have used and also try some online help
@@RaghavPal yes,Raghav .
Problem is version, even I got same problem, if I change the version same like yours, then it creates a folder for html..
For anybody following, and getting the 'cookies' message when the google page is loaded, a simple addition to the feature and steps file works wonders ;)
What exactly is the addition in script, Pls comment for helping others
Thanks Raghav,i love your explatination but when i tried to do same i am unable to generate my html reports, it is depends on any version compatbility?
Hi Bhavani, do you see any logs for this
@@RaghavPal no
Great session , really :)
Thanks a lot Ram
Hi Raghav, Thanks for awesome video.
After opening HTML report using system editor it is showing text for report. what I am missing?
Hi Hemangi, did you get the other supporting files created (css etc) You can try other browser to open
Thank you sir. .
Most welcome
Sir..this is a great tutorial..extremely helpful. Looking forward for tour help on the issue I am facing. I have created single feature file and have created a java class with feature file annotations, however on running feature file, the code written in java file is not getting called. Pls suggest.
Hi Priyanka, most probably, it may be due the the location of the glue code you have mentioned in Cucumber Runner, Also check if the steps in feature file are same in step definition
@@RaghavPal as explained inyourvideo, i created a single feature file an given the same name in feature file annotations and in java class functions. I didnt create any runner fule as I only have one feature file.
will need to check the setup
Hi Raghav could you please let us know how to check weather Cucumber plugin is installed or not in Eclipse?Thanks in advance
Hi Rajesh, You can goto Help > Install New Software> In opened dialog click on Already Installed
stackoverflow.com/questions/15265264/how-to-find-the-installed-plugins-in-eclipse/15265745
Hi please let us know when to define in Base class, utilities class and their use in Cucumber framework
Hi Samir, I will do a session on this, meanwhile can check some online examples
thank u sir
Most welcome Nagalakshmi
for this test page u haven't created the Test Runner class....can u tell me why??
is one test Runner class is enough to run all the tests
Hi Karthik, yes you can use one test runner class or create multiple as per your needs
Hi Raghav,
I tried same scenario but getting error message
The driver executable does not exist: C:\Users\bajaj\eclipse-workspace\Dir\src\test
esources\driver
i printed user.dir command got this output
C:\Users\bajaj\eclipse-workspace\Dir
what i am using in path
System.setProperty("webdriver.chrome.driver",path+"/src/test/resources/driver");
according to my understanding its taking backward slash and i am entering forward slash but when i try backward slash it gives me complie tim error
Hi Sonali, forward slash is fine, the path should be upto chromedriver.exe. Pls add that and also try to print the value of path+"/src/test/resources/driver to confirm