Hi. i need help. how to change search time of elements from user code if i search element like this.
example: Host.Local.FindSingle<ListItem>("/form[@name='OpenProj']/?/?/listitem[@name='"+projectsName+"']").Select();
repository doesn't have this element.
i am testing desktop app.
change searchtime
Re: change searchtime
hi,
could you post a Ranorex Snapshot of the element you are talking about?
In general, elements will most likely be found faster, the more detailed the path is defined.
regards, qwertzu
could you post a Ranorex Snapshot of the element you are talking about?
In general, elements will most likely be found faster, the more detailed the path is defined.
regards, qwertzu
Re: change searchtime
Hi,
FindSingle has a parameter "Duration". Just set it according your needs. I'm curious, why you are not using repository instead? I think it makes things a lot easier
FindSingle has a parameter "Duration". Just set it according your needs. I'm curious, why you are not using repository instead? I think it makes things a lot easier
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: change searchtime
I wanna make multipurpose methods open(string value) and i give this values to method. i thing when i write code it's easier for example:
Open("one or two"){
do something
}
Open("one or two"){
do something
}
Re: change searchtime
Hi,
I'm not quite sure I understand what you mean, but you can easily pass repo element along with variable to method of your choice. So let's say you have a repo element with this xpath:
Now you can pass the repo element to method of your choice like this:
I'm not quite sure I understand what you mean, but you can easily pass repo element along with variable to method of your choice. So let's say you have a repo element with this xpath:
Code: Select all
/form[@name='OpenProj']/?/?/listitem[@name=$projectsName]
Code: Select all
public static void DoSomethingWithRepoElements(RepoItemInfo repoElement, string projectsName)
{
if (repoElement.Exists()) // you can eventually apply custom timeout in Exists() method
{
// do whatever you want...
repoElement.CreateAdapter<Ranorex.Unknown>(false).Click();
}
}
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