Getting environment ready:
Before we can start writing scripts with selenium lets just see how to get the environment ready for this. I hope that you are already having visual studio installed on your system.
Instead of just starting basic things with console program, we will be creating an environment which can later be used to build framework and write tests, otherwise we have to setup the environment again later when we start building framework.
So, here it goes...
- Open visual studio
- Select File->New->Project as shown below:

- From new project window, Select visual c# then
- Select Class Library
- Enter name, select location and click ok as shown below:

- Now in solution explorer, under your added project, right click on References
- Select Manage NuGet Packages...option from window as shown below:

- From NuGet window install Selenium.WebDriver and Selenium.Support packages as shown below:

- Now, add another project i.e. a unit test project in this solution. Right click on the solution on right window and then select "Add->New project" from context window. This is the place where we will write tests. See the screenshot below:

- Your solution will be having now two projects, one for building framework and other for writing tests. It will look like as below:

- In UITests project add reference for TestFramework so that it can access required things from TestFramework. It can be done as explained below:
- Right click on References in UITests
- Select "Add reference.."
- Select Projects->Solution in dialog
- Select TestFramework checkbox and click ok

That's it. your environment is ready for writing tests and framework.
In this post we learnt about getting our development environment ready for creating automation framework. Now, in next post we will create a "Hello Selenium" test to check whether our environment is correctly configured.
Thanks for reading this post. See you in next post. Cya!
Comments
Post a Comment