Element : Automation API

Element

Class library usage, coding and language questions.

Element

Postby omayer » Mon Oct 31, 2011 9:04 pm

How to identify element (OK button) on Form and click on it, here is my the path-

/form[@title='Windows Internet Explorer']/button[@text='OK']
Tipu
omayer
 
Posts: 239
Joined: Thu Oct 28, 2010 7:14 pm

Re: Element

Postby Support Team » Tue Nov 01, 2011 11:51 am

Hi,

to identify and click on an element you can use following code:

Button okButton = "/form[@title='Windows Internet Explorer']/button[@text='OK']";
okButton.Click();


For further information please have a look at our user guide:
http://www.ranorex.com/support/user-gui ... mples.html

Regards,
Tobias
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Element

Postby omayer » Tue Nov 01, 2011 3:08 pm

Thank you Tobias, this worked-
Ranorex.Button button=null;
if (Host.Local.TryFindSingle("/form[@title='Windows Internet Explorer']/button[@text='OK']", 10000, out button))

Report.Screenshot("/form[@title='Windows Internet Explorer']");

button.Click();
throw new RanorexException("text");


}
-Beginner
Tipu
omayer
 
Posts: 239
Joined: Thu Oct 28, 2010 7:14 pm


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests