PageObject Pattern

Best practices, code snippets for common functionality, examples, and guidelines.
sirfak
Posts: 1
Joined: Wed Aug 13, 2014 6:37 am

PageObject Pattern

Post by sirfak » Wed Aug 13, 2014 7:17 am

Hi
I would like to develop my framework very similar to page objects[screens]
Lets say i open a applicaiton which has login screen, search member screen and logout screen.

I would like to create my loginScreen.cs which will have following methods

Code: Select all

LoginScreen.cs
public void typeUserName(){  Keyboard.Press("usrename");};
pubic void typePassword(){ Keyboard.Press("submit");};
public void clickSubmit() {Keyboard.Press("{Return}");};
and in my module i would like to call

Code: Select all

 LoginScreen.typeUserName()
LoginScreen.typePassword()
LoginScreen.clickSubmit()
How can i achieve this in ranorex ?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: PageObject Pattern

Post by Support Team » Mon Aug 25, 2014 12:39 pm

Hi sirfak,

I am afraid I am not totally sure what you are trying to do, but since Ranorex is based on the .Net Framework and supports code modules you shouldn't face any issues to create these page objects in Ranorex.
When I got your approach correctly the following blog post could also be of help, to get an idea how you could model this with Ranorex: Keyword-Driven Test Automation Framework.

Regards,
Markus