Back to Browse

Selenium with C# | Create project to automate test | Specflow

4.2K views
Jul 31, 2020
9:31

In this video we will create an NUnit project to automate the test using Selenium and Specflow. Specflow is the Cucumber for .Net. So we will use Specflow with selenium to automate the test using c# .net. Steps : 1. Create an NUnit project 2. Download below packages through nuget manager specflow.nunit SpecFlow.Tools.MsBuild.Generation SpecFlow.NUnit.Runners Selenium.WebDriver Selenium.Support Selenium.Chrome.WebDriver 3. Add/download extension 'Specflow for visual studio ' 4. Create a feature file from add item menu 5. Provide your feature file name 6. Create your steps in feature file using below gherkin keywords And, When, Then , Given 7. Provide parameters in the keyword using double quotes For example : Given User navigate to " " 8. Once done, generate the step definitions by doing right click on the keywords. 9. Copy all the step definitions to clipboard. 10. Create a new class and add class attribute as [Binding]. 11. Now paste all the step definitions in that class. 12. Write code to perform all the operation like click, navigate, input text 13. Once done, build the project. 14. When successfully build, open test explorer window 16. This window will display all the test available in feature file. 17. Select the test which you want to run. 16. And the click on run. 17. Test case will get executed and you will get the result on output console. Please comment your queries. Also, please hit like and subscribe button. Please watch my other videos - Selenium with C# - Klov server : https://youtu.be/Y6_TmWOq_Xk Selenium with C# - Parallel Execution and Screenshot : https://youtu.be/bv5yLSDI6H0 Selenium with C# - All about feature files - Gherkin - BDD : https://youtu.be/aUD6W9U9b0c Selenium with C# - Extent Report : https://youtu.be/NITDKukdhgo Serilog - Logging in Automation Framework : https://youtu.be/EYK3Q4emSZQ Selenium with C# - Specflow - External Bindings : https://youtu.be/FjsOLQBbM7k Selenium with C# Working with Excel - Part 1 : https://youtu.be/5EwNG5aI8w4 Selenium C# - Visual Studio Code : https://youtu.be/UbgUNOe2R00

Download

0 formats

No download links available.

Selenium with C# | Create project to automate test | Specflow | NatokHD