Page 1 of 1

Element

Posted: Mon Oct 31, 2011 8:04 pm
by omayer
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']

Re: Element

Posted: Tue Nov 01, 2011 10:51 am
by Support Team
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

Re: Element

Posted: Tue Nov 01, 2011 2:08 pm
by omayer
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