I am not finding a way to check if an element exists without writing a failure to the log.
If something exists in my UI, I delete it, if not I dont. By no means it is a failure/error if that item exists or
not.
I can only see using Validate.Exists, which writes the result to the log, is there other method that I can use?
I basically need a boolean returned and depending on the result I go ahead and delete the item.
Thanks.
Validation without writing to the log
Re: Validation without writing to the log
ok, I found it: <RepoItemInfo>.exists(); however, how can I modify the Duration search time out, like the way it is done in ValidateExists()?
Re: Validation without writing to the log
You would need to change the item (and all of its parent's if you really want to shorten it) "SearchTimeout" property.
Code: Select all
Duration oldDuration = myElementInfo.SearchTimeout;
myElementInfo.SearchTimeout = new Duration(<new time in ms>);
if (myElementInfo.Exists()) {
<do your stuff here>
}
myElementInfo.SearchTimeout = oldDuration;
Shortcuts usually aren't...