.Exists not working Properly

Class library usage, coding and language questions.
c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: .Exists not working Properly

Post by c676228 » Thu Apr 30, 2015 12:10 am

Actually I have the same problem. When the UI element searched for doesn't exist, it seems that it takes forever for the program to execute the next action step.
If the element do exist, no problem at all. When the element doesn't exist. I try to manually shorten the time out for the element as well as its ParentFolder. But still it takes about 50 seconds to get to the next step.
Anyway to shorten more?

repo.MyWebApp.UsersTable.ParentFolder.SearchTimeout=3000;
repo.MyWebApp.UsersTable.SearchedUserEmailInfo.SearchTimeout=3000;
if (repo.MyWebApps.UsersTable.SearchedUserEmailInfo.Exists())
{
//do things
}
else
{
//do other
}

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: .Exists not working Properly

Post by Support Team » Mon May 04, 2015 10:01 am

Hello

You could try to use the "WaitForExists()"-method:
try 
{
repo.MyWebApps.UsersTable.SearchedUserEmailInfo.WaitForExists(5000);
}
catch (Exception) {
	Report.Info("Element doesn't exist");
}
or "Exists()" with a specified timeout.
repo.MyWebApps.UsersTable.SearchedUserEmailInfo.Exists(5000);
Regards,
Robert
.
Image