The next step in the framework development is the creation of a web application class. The class is a projection of a web application under test. It is located in the Mapping project. It’s assumed that there should be only one instance of the class during a test run session. But actually it is non-static and it is not implemented Singleton design pattern, therefore, you can create a number of application instances and run them all in parallel. You can do experiments with it if you wish. As far as the experiment is out of the scope of the current topic I will count it out here.
So, for testing I use the only one instance of WebApplication and, therefore, there will be the only one instance of IWebDriver interface used during the testing which is instantiated in WebApplication’s constructor.
WebApplication class contains:
• An instance of the Selenium IWebDriver;
• Instances of all pages which real tested application consists of. Every single page instance is a projection of a real web page;
• Auxiliary variables which reflect the application’s status and are utilized inside the class;
• A method for initialization of necessary web page instances;
• A method for quitting the application and closing the browser.
I added new WebApplication class to the Mapping project.