help on TryFindSingle : General Questions

help on TryFindSingle

Ask general questions here.

help on TryFindSingle

Postby sdimbre » Wed Sep 07, 2011 1:50 pm

Hi Team,

New to this forum and to ranorex. Presently evaluating ranorex and found good tool.

I am using TryFindSingle to check existance of my object as follows.

Ranorex.Core.Element elem = null;
bool isBtnAvailable = editDig.TryFindSingle("xpathtoElement", out elem);

But this is not giving expected result to me. Is this right code? What should be the second argument expected here? In my case I gave 'out elem' looking at some examples on your site. What is out here?

Please forgive me for dumb questions.

Thanks,
Dimbre.
sdimbre
 
Posts: 16
Joined: Wed Sep 07, 2011 1:38 pm

Re: help on TryFindSingle

Postby sdaly » Wed Sep 07, 2011 2:23 pm

If the item is found then elem will be set to that item and you can use it.

Example -

Code: Select all
Ranorex.Button btn = null;
if(Host.Local.TryFindSingle("rxPath", 10000, out btn){
//path was found and you have a valid adapter
btn.Click();
}else{
Report.Info(rxPath + " didn't exist");
}
User avatar
sdaly
 
Posts: 213
Joined: Mon May 10, 2010 12:04 pm
Location: Dundee, Scotland

Re: help on TryFindSingle

Postby Support Team » Wed Sep 07, 2011 2:53 pm

Hi,

You can also use the Validation class, for more information take a look at the following link.
I would also recommend to read all the chapter of our UserGuide, it describes the most important parts of Ranorex.

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

Re: help on TryFindSingle

Postby sdimbre » Thu Sep 08, 2011 12:21 pm

Thankyou very much for quick reply. I will try and keep you posted on this.
sdimbre
 
Posts: 16
Joined: Wed Sep 07, 2011 1:38 pm


Return to General Questions

Who is online

Users browsing this forum: No registered users and 0 guests