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 | ...
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...
One can manage a group of items/objects using arrays or collections, we have already talked about arrays in the previous lecture, today we will talk about collections Collections provide a more flexible way to work with a group of objects. Yes flexible, collections can grow and shrink dynamically . One of the greatest advantage over Arrays. There are many collections provided by .Net framework, we will look at the most used collection classes Generic List Strongly typed list of elements that can be accessed by using positional index number. Declaration List < string > EmpNameList ; Declared EmpNameList which will hold elements of type string Initialization EmpNameList = new List < string >(); Operations //Add Element EmpNameList . Add ( "Employee1" ); //Re...
Comments
Post a Comment