I have to check the existence of an element on WebPage - element should not be visible.
If i write following code:
(...)
Validate.NotExists(repo.Folder.ElementName);
(...)
or
var Element1= repo.(...);
Validate.NotExists(Element1);
Result is Error: Failed to find item '(...)'.
No element found for path '(...)'
Test should prove that element does not exist, but if the element does not exist test will fail.
How to handle this situation in code ?
Validate.NotExists vs 'Failed to find item'
Re: Validate.NotExists vs 'Failed to find item'
Hi,
Make sure you are using RepoItemInfo repo element, instead of Adapter! RepoItemInfo does not throw an exception if does not exists. So the code should look like this:
Make sure you are using RepoItemInfo repo element, instead of Adapter! RepoItemInfo does not throw an exception if does not exists. So the code should look like this:
Code: Select all
Validate.NotExists(repo.Folder.ElementNameInfo);
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: Validate.NotExists vs 'Failed to find item'
This is solution to the problem.
Thank you
Thank you