FindFromUID

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
IanKnight
Posts: 33
Joined: Thu Feb 21, 2013 12:52 pm

FindFromUID

Post by IanKnight » Wed Mar 27, 2013 5:35 pm

Hi,

I am trying to find a reference to a repository item by finding it via it's name (string value) and wondered if someone can help with the FindFromUID Method which is what I think I need.

I have tried this -

Element findelement = Ranorex.Core.Element.FindFromUID("ComboReferralType");

However this does not compile as Ranorex.Core.Element does not have this method but the documentation seems to say it does have it.

http://www.ranorex.com/Documentation/Ra ... romUid.htm

Any help / examples on how to use FindFromUID would be appreciated.

Ian

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

Re: FindFromUID

Post by Support Team » Thu Mar 28, 2013 5:52 pm

Hello,

Unfortunately it is not possible to get the object from a specific repository item using its name.
I am afraid that FindFromUID is not what you need because this method is searches for a unique identifier of a specific element in e.g. web element.

For example:
WebElement doc = "/dom[@domain='www.domain.com']/iframe";
Element result;
bool found = doc.Element.FindFromUid("yourID", out result);
Why do you search the repository item by its name?

Regards,
Bernhard

IanKnight
Posts: 33
Joined: Thu Feb 21, 2013 12:52 pm

Re: FindFromUID

Post by IanKnight » Tue Apr 02, 2013 8:44 am

I want to search by name as I want to execute some user code and pass the repository object as a parameter.

As far as I understand it I can only pass a string value as a parameter, hence my attempt to find the repository object by name.

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

Re: FindFromUID

Post by Support Team » Wed Apr 03, 2013 3:35 pm

Hello,

Currently, it's only possible to pass string parameters to a User Code method.
We are evaluating to implement a way to pass repository items in a future release.

Regards,
Markus (T)

IanKnight
Posts: 33
Joined: Thu Feb 21, 2013 12:52 pm

Re: FindFromUID

Post by IanKnight » Wed Apr 03, 2013 4:16 pm

Thankyou for the reply, I don't mind passing string values in parameters, what I want to do is find the object from that string parameter.

Is there a way of doing this ?

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

Re: FindFromUID

Post by Support Team » Thu Apr 04, 2013 4:30 pm

Hello,

Unfortunately, we don't provide a direct method to get the repository item by its name, but you could use reflection instead. More info about reflection can be found on MSDN.

The following post should give you an idea how to use it with Ranorex: Using reflection to get repository item

Regards,
Markus (T)