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
FindFromUID
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: FindFromUID
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:
Regards,
Bernhard
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
Re: FindFromUID
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.
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.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: FindFromUID
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)
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)
Re: FindFromUID
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 ?
Is there a way of doing this ?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: FindFromUID
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)
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)