The entire framework consists of three projects:
1. Mapping – a set of classes for interaction with Selenium tool, classes which represent application under testing, its parts, and web elements.
2. Logger – a set of classes which write down in a log file all the events occurred during the testing process.
3. Tests – tests and auxiliary test classes/methods.
To start creating my own framework, I launched Visual Studio and created a new solution:
File -> New Project
Programming language for the solution – C#
Project type – Class Library
Solution name – I named my own SeleniumFramework Project name (Name) – mine is Tests.
I didn’t specify the path for files of the solution (Location) – default is ok
Create a directory for solution checkbox is selected
View -> Solution Explorer or Ctrl+W, S
Class1.cs is the default name for newly created classes generated automatically. I renamed the file in short to something more suitable.
A class name is changed from ‘Class1’ to a new name as well.
Add -> New Project…
A new project is added to the solution. Then the same for project Logger
At the moment I’ve got the solution (framework) with three empty projects. Obviously, the tests will be located in the Tests project. Therefore, the Tests project should be launched for running tests. I designed the framework in the manner to be able running my tests both with NUnit and MSTest tools. But I also must have the ability to debug the tests. I personally do it with MSTest tool right inside the Visual Studio. But for some reasons, I also want to have the ability to debug the tests with NUnit. VS Express edition does not allow installing extensions like NUnit Test Adapter. The workaround is described below.
[row]
[column lg=”4″ md=”12″ sm=”12″ xs=”12″ ]
Software and Tools for framework [/column]
[column lg=”4″ md=”12″ sm=”12″ xs=”12″ ]
Table Of Content
[/column]
[column lg=”4″ md=”12″ sm=”12″ xs=”12″ ]
NUnit Console Runner
[/column]
[/row]