Wednesday, August 5, 2015

Implementation of Page Object Model in Appium C#

  • Initialize the web driver in a separate class.
  • Make auto implemented IwebDriver type property.
  • We can use this property in all the other places thru out this project by simply calling “InitialiseAppium.driver






  • In another class find the elemenats using below mechanism.

  1. ·Create propertyes for all the elemant (text box, lable,button,dropdownlist) that you need to cominuicate / identify.
  2. ·Add attributes to find the elemant using Id,Name,Xpath or anyother mechanisam in the selenium.
User can maintain multiple class files to locate elements in each and every web page in the project.



  • In the same class write your test steps, including clicks, scrolls, enter text ..etc.










  • Create another class file and write the test code with the relavant test attibutes ([TestFixtureSetUp], [Test]).

For the below exapleim I have use Nunit.



More test attributes in Nunit test: http://www.nunit.org/index.php?p=attributes&r=2.4.8