Repository items as parameters

Class library usage, coding and language questions.
Anu
Posts: 13
Joined: Tue May 10, 2011 5:10 pm

Repository items as parameters

Post by Anu » Thu May 12, 2011 9:54 pm

I have a list of menu items in my web browser and each item has sub menus. I want to create a function where I want to tell the user defined method to click on the menuname and then click on the submenu name just by passing parameters to the function like as follows:

public void selectmenutab (string menuname, string submenu)
{
repo.menuname.submenu.click();
}

The only other way I can think of is FindSingle as below: but the objects are identified with id ONLY, and for that I will have to use a string array(underlined number) and select them in a tideous way.

webDocument.submenutab = "/dom[@domain='mydomain']";
Atag submenulink = submenutab.FindSingle(".//td[@id='ltd1']/a[@id='lsnb1']");
submenulink.Click();

I know QTP has this facility of selecting a menuitem thru repository. How can I make this happen in Ranorex? Is there a better way to add property to the objects in the repository?

Thanks
Anu

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

Re: Repository items as parameters

Post by Support Team » Fri May 13, 2011 10:57 am

Hi,

To make your repo items variable, please take a look to following links
http://www.ranorex.com/support/user-gui ... html#c3112
http://www.ranorex.com/support/user-gui ... html#c2970

Regards,
Peter
Ranorex Team