In the previous lecture, we learned how can we work with tables to handle test data from the feature file.I will paste the feature and step definitions from earlier lecture and then we will talk about the shortcomings and how Specflow.Assist.Dynamic can help us to overcome them Feature File Feature : SpecFlowFeature2 In order to show specflow capabilities for working on tables We are going to write some scenarios here Scenario : Verify specflow can read data from table and print on console Given I have dummy student data as below | StudentId | StudentName | Division | Age | | 100 | James | Engineering | 30 | ...
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 ...
We may come across a scenario where we need to execute code after/before a particular event like given below We want to create some folder where we can store screenshots/ logfile before starting the test We may want to log details of the scenario in a log file after executing each step We want to know after each step if that step was successful and if not we want to take a screenshot as an evidence We want to clean up the database before/after each scenario/feature We may want to open/close browser for every scenario Hooks help us to execute logic when a certain event occurs, let's check how I will start with creating a new project called SeleniumHooks and added folders where we can keep our feature, feature definitions and hooks file We will add a feature file and implement the steps Feature : SpecFlowFeature1 In order to avoid silly mistakes As a math idiot I want to be told th...
Comments
Post a Comment