Hi,
I want to wait the repository element until invisible from usercode.
I create a repository element from usercode
[ String alertBox = "/form/titlebar[@text='Downloading' and @accessiblerole='TitleBar']";]
and then I don't know how to wait that the repository element until does not exists.
Please help me.
wait a element until invisible
Re: wait a element until invisible
Hi,
At first, please edit the xpath in repo like this:
Then this method (used as UserCode action in recording) should do what you want:
Where repoInfoElement should be connected to the repository element in question.
If you want to use Code module, then the code should look like this:
You can replace 30000ms with whatever duration you like.
At first, please edit the xpath in repo like this:
Code: Select all
/form/titlebar[@text='Downloading' and @accessiblerole='TitleBar' and @visible='True']
Code: Select all
public void WaitForElementNotExists(RepoItemInfo repoInfoElement)
{
repoInfoElement.WaitForNotExists(30000);
}
If you want to use Code module, then the code should look like this:
Code: Select all
repo.ElementNameInfo.WaitForNotExists(30000);
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: wait a element until invisible
Hi odklizec ,
Thanks you for your help.
But I don't know how to use Code module.
This is My User code,
According to my user code, validate function is finished after 30000ms. But I want to wait until the element does not exist.
Thanks you for your help.
But I don't know how to use Code module.
Code: Select all
repo.ElementNameInfo.WaitForNotExists(30000);
Code: Select all
String alertBox = "/form/titlebar[@text='ファイルのダウンロード' and @accessiblerole='TitleBar' and @visible ='True']";
Validate.NotExists(alertBox,30000);
Re: wait a element until invisible
Hi,
You can't use Validate then. Just create a repository element with given xpath...
And then use the code I advised:
WaitForNotExists is a RepoItemInfo method and it does not accept xpath. So you must create repository element if you want to use this method.
Another possibility would be using Exists() method, in some kind of custom loop. But this would require somewhat more coding. And if you are not skilled in coding, using repository and WaitForNotExists is the best approach. BTW, you can do the same much more easily with recording. You don't have to use code module for this specific task.
You can't use Validate then. Just create a repository element with given xpath...
Code: Select all
/form/titlebar[@text='ファイルのダウンロード' and @accessiblerole='TitleBar' and @visible ='True'
Code: Select all
// you must instantiate the repository in code module (this is done automatically in recording modules)
private static SolutionName.SolutionNameRepository repo = SolutionName.SolutionNameRepository.Instance;
...
//then you can call repository item like this...
repo.ElementNameInfo.WaitForNotExists();
Another possibility would be using Exists() method, in some kind of custom loop. But this would require somewhat more coding. And if you are not skilled in coding, using repository and WaitForNotExists is the best approach. BTW, you can do the same much more easily with recording. You don't have to use code module for this specific task.
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: wait a element until invisible
Hi,
I know Validate method is wrong. I also want to use WaitForNotExists in the code. But I don't know well how can I do this.
What is ElementNameInfo?
I know Validate method is wrong. I also want to use WaitForNotExists in the code. But I don't know well how can I do this.
What is ElementNameInfo?
Code: Select all
repo.ElementNameInfo.WaitForNotExists();
Re: wait a element until invisible
Hi,
ElementNameInfo is just a name placeholder, which needs to be replaced with name (complete path) to your RepoItemInfo element, stored in repository. RepoItemInfo is a special Ranorex repository object, for accessing repo elements without risking "element not found" exception. You must replace ElementName, with the name of repository element. Basically, if you type repo., Ranorex should offer you a list of available repo elements, in which you need to find the titlebar element, you want to wait for (its not-existence). But this would happen only if you have repository instantiated in the code module of your choice (as I suggested in my previous post). The code should look like this:
ElementNameInfo is just a name placeholder, which needs to be replaced with name (complete path) to your RepoItemInfo element, stored in repository. RepoItemInfo is a special Ranorex repository object, for accessing repo elements without risking "element not found" exception. You must replace ElementName, with the name of repository element. Basically, if you type repo., Ranorex should offer you a list of available repo elements, in which you need to find the titlebar element, you want to wait for (its not-existence). But this would happen only if you have repository instantiated in the code module of your choice (as I suggested in my previous post). The code should look like this:
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