I am having some trouble with the behaviour of Ranorex in identification of elements within my repository.
I have within my code a WaitForExistence method to wait for a repository item before proceeding with the AUT.
The code snippet is in fact from this forum. I pass in a repository item to wait for a specified timout.
Code: Select all
public static bool WaitForExistance(RepoItemInfo repoItem, TimeSpan timeout)
{
System.DateTime abortTime = System.DateTime.Now + timeout;
Report.Info("Waiting for existance of repository item " + repoItem.FullName);
while (!repoItem.Exists())
Report.Info("Inside the while loop...item does not exist.");
{
if (System.DateTime.Now > abortTime) {
Report.Info("Timeout reached for your repository item " + repoItem.FullName);
return false;
}
}
Report.Info("Found repository item " + repoItem.FullName);
return true;
}
My use of this method is as follows so it will loop until it finds the object I'm interested in.
Code: Select all
while(CommonMethods.WaitForExistance(repo.FormTraffic.MainContent.Contacts.CompanyForm.LeftContent.RelationshipInfo, new TimeSpan(0, 0, 15)) == false){
}
Code: Select all
currentListSelection = repo.FormTraffic.MainContent.Contacts.CompanyForm.LeftContent.Relationship.SelectedItemText;
I have attached the output log with the error. The error is in the 'AddContacts' Test Case.
Another error from my jenkins run is as follows but for a different repository object however the symptoms are exactly the same. It finds the object via the WaitForExistance method (excuse spelling!) and then fails on the very next line which tries to do something with that same repository item.
[2013/08/22 01:13:33.573][Info ][User]: Waiting for existance of repository item TrafficLIVERepository.FormTraffic.MainContent.Contacts.CompanyForm.LeftContent.Owner
[2013/08/22 01:13:34.356][Info ][User]: Found repository item TrafficLIVERepository.FormTraffic.MainContent.Contacts.CompanyForm.LeftContent.Owner
[2013/08/22 01:14:04.420][Error ][Module]: Failed to find item 'TrafficLIVERepository.FormTraffic.MainContent.Contacts.CompanyForm.LeftContent.Owner' within the specified timeout of 1m. The folder 'TrafficLIVERepository.FormTraffic.MainContent' was not found within the specified timeout of 30s. No element found for path 'container/container[@automationname='dynamicContentGroup']' within 30s.
I also have a screenshot of my repository folder structure. I have unique paths for each of the folders. I have been forced to build it this way but I am now at a loss since Ranorex stops executing when it fails to find the parent folder.
Is it as simple as increasing the timeout to 5 minutes? Any help will be appreciated.
Thanks