Element

Class library usage, coding and language questions.
omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Element

Post by omayer » Mon Oct 31, 2011 8: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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Element

Post by Support Team » Tue Nov 01, 2011 10: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
.
Image

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Element

Post by omayer » Tue Nov 01, 2011 2: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