Hello,
i am trying to get a Container from the windows FORM using FindSingle method, but Ranorex is throwing an error message NoElement found for path
This is the Actual path for the container /form[@automationid='LoginWindow']/container[1]
Below is how i am trying to get it
public Form LoginForm
{
get
{
return DNA2UIMapsRepository.Instance.LoginWindow.Self;
}
}
public Container UserNameContainer
{
get
{
string rxPath = "/container[1]";
return LoginForm.FindSingle(rxPath,25);
}
}
Note: I have saved the LoginWindow Xpath in the repository and trying to do the find single using that path
Can someone help me here please?
How does FindSingle method works?
Re: How does FindSingle method works?
Hi,
Please post a Ranorex snapshot (not screenshot) of the problematic element. This would help us to analyze and better understand your problem and provide an adequate solution. Without (at very least) snapshot, we can only guess what's wrong. Thanks.
Please post a Ranorex snapshot (not screenshot) of the problematic element. This would help us to analyze and better understand your problem and provide an adequate solution. Without (at very least) snapshot, we can only guess what's wrong. Thanks.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How does FindSingle method works?
You need to change this to a relative path by letting it start with "." -> "./container[1]".RekhaG wrote:string rxPath = "/container[1]";
However, that may not be the best path to use because of the index in there. It is usually better to search for some specific attribute value - if there are attributes to check
Additionally, a timeout of "25" milliseconds(!) is way to small. When you don't want to wait, just omit the timeout altogether, then Ranorex will just search once for the element.
Regards,
Alex
Ranorex Team
Re: How does FindSingle method works?
Thanks ahoisl. It helped!