We have seen on way of Data Driven Testing in Data Driven Testing without Scenario Outline. Another way to perform Data Driven Testing in Cucumber is using 'Scenario Outline'. "Scenario Outline" is a keyword, if a test needs to be executed for more than one test data set it will be marked as "Scenario Outline" instead of "Scenario".
Step 6: Now add the different test data sets in the table as below
In the above screenshot, I am running the our scenario for two test data sets Google and Facebook in Firefox and Chrome browsers.
Step 7: Run the tests and checkout the results
Both Scenario and Scenario Outline are executed. And Scenario Outline is executed for two data sets.
That is all about achieving data driven using Scenario Outline. Please comment your queries ans suggestions on this pots. Thanks for reading!!
#qababu #HappyLearning #HappyTesting
The only difference between 'Scenario' and 'Scenario Outline' is, 'Scenario Outline' comes along with a keyword called 'Example' using which the test data sets are represented in data table format.
Consider the same scenario which we been using in our tutorial, now let us automated the same test with different test data sets.
Step 1: Write the scenario using 'Scenario Outline' keyword as below
Observe that, Scenario Outline is having a red underline. Place the cursor on it, compiler telling us that 'Examples' keyword is missing. Remember that 'Scenario Outline' should always be associated with Example keyword.
Step 2: Press 'Alt+Enter' and select 'Create Example Section'.
You should see 'Examples' keyword being added after the steps as below
Step 3: Now let us modify the steps. Write down the parameter names in the <> symbol in the steps. And use same names as column names in the Examples table as shown below
Step 4: Write the step definitions for the modified steps as we seen in the previous posts.
Here the arguments are not added automatically we need to write them manually. Also the parameter names should be converted as regular expression. Please check below screenshot
Step 5: If the step definitions are written properly, the Scenario Outline could look like below. The parameters appear in purple color.
Step 6: Now add the different test data sets in the table as below
In the above screenshot, I am running the our scenario for two test data sets Google and Facebook in Firefox and Chrome browsers.
Step 7: Run the tests and checkout the results
Both Scenario and Scenario Outline are executed. And Scenario Outline is executed for two data sets.
That is all about achieving data driven using Scenario Outline. Please comment your queries ans suggestions on this pots. Thanks for reading!!
#qababu #HappyLearning #HappyTesting
Really very informative and creative contents. This concept is a good way to enhance the knowledge of Autocad.thanks for sharing please keep it up
ReplyDeleteSoftware Testing Training in Gurgaon
I really enjoy the blog.Much thanks again. Really Great selenium Online course
ReplyDeleteI am Just Learning All the topics of Selenium Grid Through this blog.Very Thankful for this blog and also my respect to the author of blog.
ReplyDeleteHi,
ReplyDeletei am working with protractor with cucumber so i want to execute one scenario with multiple test data. i created feature file with one scenario outline and examples.
i provided 4 different test data in example. when i execute my test case my test is passed with 4 test scenarios but i am able to only 3 test cases on ui page not all 4
but test is passed.
i am not getting what is my problem.
Wondering how? In the first place, by being the creator of the problem – the volume, the velocity and the variety of data. Data Analytics Courses
ReplyDeleteEthical Hacking Course
ReplyDeleteThis is an awesome article. I really enjoyed reading this blog.
ReplyDeleteseo article writing
english in german
how to become a salesforce developer
software material testing
hacking books for beginners
This is the best post for this topic and Thank you!!!
ReplyDeletePLC Training in Chennai
Content Writing Training in Chennai
Sales Training in Chennai
React JS Training in Chennai
WordPress Training in Chennai
Google Analytics Training in Chennai
If you have a logical mind and a balanced attitude with realistic approach, then you can opt for a career in Home Science. data science course in india
ReplyDeleteNice post and I am very happy to visit your blog. Keep doing...!
ReplyDeleteOracle Training in Chennai
Oracle Training in Bangalore
Oracle Training in Coimbatore
Oracle DBA Training in Chennai
Very nice and interesting blog. You can also check my articles as well.
ReplyDeletestring functions in java
how to declare string in java
how to create string in java
date type in java
amazon cloud computing
software testing interview questions and answers pdf
php technical interview questions
thanks for the article
ReplyDeletebest embedded system training institute in chennai
plc training institute in chennai
best plc and scada training in chennai