Posts

Showing posts from April, 2019

Specflow -Part5(Specflow Sharing Data Between Steps)

While automating applications you may come across scenarios where you may need to share data between steps, we will talk about how one can do so in this lecture Let's say you are automating google search functionality and scenario is user types search string on the google search page and hits search and this takes him to the google result page where he asserts if the results match the search string. You can have a single step definition file for all these steps or you can have a separate one for each page. Ideally, you should have a separate step definition file for each page. We can share the data between steps using below ways Instance variables (Steps are in same file) Context Instance variables We will create a feature file for the above example and then we can talk over it Feature : SpecFlowFeature4 To demo how one can share data between steps Scenario : Verify user can share data between steps contained  in same step defination file Given  User opens

Specflow -Part4(Specflow Scenario Outline and Feature Background )

In the previous lecture, we talked about how we can pass multiple data to step using tables, suppose we want to run the same scenario for a different set of data, For example, you want to test the login functionality of an application, where you test login with Administrator, Project Manager, Product Owner etc Here the steps of scenario will remain the same only the login credentials will change according to the user. We can have the same scenario run multiple times for each user you want to test with the help of scenario outline, check below Feature file Feature : SpecFlowFeature3 In order to test the login functionality for multiple users, we will demo using scneario outline Scenario Outline : Verify login for different set of users Given  User trys to login into application using  <Username>  and  <Password> When  User enters the  <Username>  and  <Password> Then  User should be successfully logged as  <Role> Examples :  |  Username   |