Failed To find item the Folder was not found error

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
bobbydazzler
Posts: 6
Joined: Tue Apr 30, 2013 9:38 am

Failed To find item the Folder was not found error

Post by bobbydazzler » Thu Aug 22, 2013 11:13 am

Hello,

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){			
			}
I have had to build it this way since Ranorex will not always find objects the way I expect it too. Once the object has been found I move on with my test script. Unfortunately my very next line of code which is...

Code: Select all

currentListSelection = repo.FormTraffic.MainContent.Contacts.CompanyForm.LeftContent.Relationship.SelectedItemText;
fails because it does not find the parent folder in the specified time. I know Ranorex will create a new adapter with this new line of code but I am totally flumoxed as to why in the very next line it will fail to find a parent folder when that same object has just been found.

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
You do not have the required permissions to view the files attached to this post.

bobbydazzler
Posts: 6
Joined: Tue Apr 30, 2013 9:38 am

Re: Failed To find item the Folder was not found error

Post by bobbydazzler » Thu Aug 22, 2013 12:04 pm

I have since increased the 'search timeout' to 5 minutes and it has made no difference.

I have also manually performed the automated steps on the AUT and inspected via the Spy the rooted folder in question exists, which it always does.

I am hoping someone might have a bright idea to help me proceed.

Regards,

Chris

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Failed To find item the Folder was not found error

Post by odklizec » Thu Aug 22, 2013 1:12 pm

Hi Chris, did you try to disable the "Folder Caching"? In repository, click the folder containing the problematic element and then in properties set "Use Cache" to False.
Image
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

bobbydazzler
Posts: 6
Joined: Tue Apr 30, 2013 9:38 am

Re: Failed To find item the Folder was not found error

Post by bobbydazzler » Thu Aug 22, 2013 1:29 pm

Hi,

Thank you for taking the time to respond.

Yes All of my repository rooted folders have the 'Use Cache' property set to False.

Regards,

Chris

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Failed To find item the Folder was not found error

Post by Support Team » Fri Aug 23, 2013 3:44 pm

Hello,

Could you please try to track an element using Ranorex Spy and compare the RanoreXPath with the RanoreXPath in your repository. It could be that the RanoreXPath to the element changes dynamically.
Is it possible to send us a Ranorex Snapshot from the application and is it also possible to send us your repository in order to analyze the issue?
Thank you!

Regards,
Bernhard

bobbydazzler
Posts: 6
Joined: Tue Apr 30, 2013 9:38 am

Re: Failed To find item the Folder was not found error

Post by bobbydazzler » Tue Sep 03, 2013 4:00 pm

Hello Bernhard,

I have changed the RXPath to include a '?' in the path for the RootedFolder that is not found. I have yet to try it on the Virtual machine however early signs seem positive.

Thanks for your help. It is still a mystery why it is not found. I have not taken a snapshot yet but if this new approach fails I will need to capture those further details and get back to you.

Regards,

Chris