In this post we will learn about writing multiple test cases (Scenarios) in a Feature file. This post is going to be an extension to the previous post First Test Case in Selenium with Cucumber. So please go through it to understand the current post better. Let's get started step by step...
Step 1: This time we are taking "Gmail valid login validation" as our test. Please copy the below code snippet in our feature file created "gmailLogin.feature" file and save it.
Step 2: Now go to TestRunner.java Right click > Run As > Junit Test
Step 1: This time we are taking "Gmail valid login validation" as our test. Please copy the below code snippet in our feature file created "gmailLogin.feature" file and save it.
Step 2: Now go to TestRunner.java Right click > Run As > Junit Test
Step 3: Check out the Junit results, The first scenario is executed and passed but the second scenario is stopped at the 3rd step in the second scenario and failed. This because the last three steps are missing in the Step Definitions.
In the console we will find the three missed steps, add the three in step definitions file and define their functionalities.
Step 4: Add the steps in Step Definition file and define their actions.
Step 5: Go to TestRunner.java Right click > Run As > Junit Test.
Step 6: Check out the Junit results now, two scenarios are executed successfully and are Passed also.
This is how we can add multiple tests in the feature file. And we need not execute all the scenarios for adding a new scenario. Comment all the previous scenarios > add the new scenario and run it as Junit test > add missed step definitions. That's how we can add the multiple scenarios.
thanks,this is good link
ReplyDeleteI am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts. Python Projects for Students Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account. Project Center in Chennai
DeleteThanks for providing the information . The articles in your blog helped me a lot for improving the knowledge on the subject. Also check my small collection on this at selenium Online Training Hyderabad blog
ReplyDeleteThank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
ReplyDeleteSelenium certification training
Individuals will become a skilled writer only writing and writing some more. Further, writing is not a linear process. It is messy and frequently, time consuming.resume template
ReplyDeleteWrite my Paper I am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here.
ReplyDeleteGreat job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. type my essay
ReplyDeletePretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. essay writing services
ReplyDeleteWhoa! I’m enjoying the template/theme of this website. It’s simple, yet effective.
ReplyDeleteSelenium Training in chennai | Selenium Training in anna nagar | Selenium Training in omr | Selenium Training in porur | Selenium Training in tambaram | Selenium Training in velachery
Crystal clear explanation.Eagerly waiting for future updates.
ReplyDeleteJava training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training
I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts.
ReplyDeletePython Training in Chennai
Python Training in Training
Python Training in Bangalore
Python Hyderabad
Python Training in Coimbatore
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.
ReplyDeleteSoftware Testing Services
Software Testing Services in USA
Software Testing Companies in USA
Software Testing Company
QA Testing Services
QA Software Testing Services
QA Testing Companies in USA
Functional Testing Services
Test Automation Services
Functional Testing Company
Performance Testing Services
Good Post! , it was so good to read and useful to improve my knowledge as an updated one, keep blogging.After seeing your article I want to say that also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts likethis. https://www.3ritechnologies.com/course/sap-online-training-certification-course/
ReplyDeleteGood Post! , it was so good to read and useful to improve my knowledge as an updated one, keep blogging.After seeing your article I want to say that also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts likethis. https://www.3ritechnologies.com/course/aws-online-training/
ReplyDelete