Validate.NotExists() does not wait for element to not exist
Posted: Wed Jul 05, 2017 1:45 pm
Hi,
I am currently using NotExists() method in my test and It does not wait for element to change state.
Element that I am testing waits for Push notification and is removed from list afterwards.
This push notification arrives in random period of time so I have to wait for it 1-7sec.
I checked NotExists() method implementation
Duration searchTimeout is passed in parameters to ExistsInternal() method
Yet SearchTimeout is not used anywhere in it.
Is there any other method I could use for my purpose?
I am currently using NotExists() method in my test and It does not wait for element to change state.
Element that I am testing waits for Push notification and is removed from list afterwards.
This push notification arrives in random period of time so I have to wait for it 1-7sec.
I checked NotExists() method implementation
Code: Select all
public static bool NotExists(string path, Duration searchTimeout, string message, Validate.Options options)
{
string text;
if (!(!string.op_Equality(message, Validate.DefaultMessage)))
{
message = "Element for path '{0}' does @ValidateTRUENOT@[email protected]@.";
}
text = Validate.ExistsInternal(path, searchTimeout);
message = message.Replace("@Validate.ExistsREASON@", text);
message = string.Format(message, path ?? Validate.NullString);
return Validate.IsTrueInternal(!string.IsNullOrEmpty(text), message, options, null);
}
Code: Select all
internal static string ExistsInternal(string path, Duration searchTimeout)
{
string result;
RanorexException ex;
result = string.Empty;
try
{
result = Validate.ExistsInternal(new RxPath(path), searchTimeout);
}
catch (ArgumentNullException)
{
result = " (path is null)";
}
catch (RanorexException ex)
{
result = string.Concat(" (", Validate.EscapeForFormat(ExceptionHelper.GetExceptionFullMessage(ex)), ")");
}
return result;
}
Is there any other method I could use for my purpose?