Page 1 of 1

Validation without writing to the log

Posted: Thu Apr 03, 2014 10:28 pm
by Mayra
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.

Re: Validation without writing to the log

Posted: Thu Apr 03, 2014 10:37 pm
by Mayra
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

Posted: Fri Apr 04, 2014 1:48 pm
by krstcs
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;