Error msg while running same action twice

Ask general questions here.
elis
Posts: 15
Joined: Sun Nov 10, 2013 10:27 am

Error msg while running same action twice

Post by elis » Sun Nov 10, 2013 10:32 am

Hi All,

I am running an action (7zip program) and al the actions are successful.
When running the same action twice I got the following error:

"Item '_7_ZipRepository.FormC.Text1003' could be found using its absolute path, but not using its relative path from the cached element of parent folder '_7_ZipRepository.FormC'. This can happen if either the item search timeout is too small or if items within a rooted folder do not share a common parent element. To fix this problem, first increase the item search timeout. If this does not help, create a separate rooted folder for this item or disable caching for the specified folder."

Any help will be appriciated :)

Thank you!

Swisside
Posts: 92
Joined: Thu Oct 10, 2013 10:40 am

Re: Error msg while running same action twice

Post by Swisside » Mon Nov 11, 2013 9:20 am

Hello

In Spy you can edit the properties for the elements that cause the warning as shown in the attached screen shot.


If you don't use Spy you can still do it at the bottom of the screen where you have your items (Right Click => Properties)



Have a nice day
Attachments
Spy_MiseEnCache_SearchTimeOut.png
Spy_MiseEnCache_SearchTimeOut.png (80.72 KiB) Viewed 1100 times
A simple thank you always does wonders !

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Error msg while running same action twice

Post by krstcs » Mon Nov 11, 2013 3:26 pm

elis wrote:Hi All,

I am running an action (7zip program) and al the actions are successful.
When running the same action twice I got the following error:

"Item '_7_ZipRepository.FormC.Text1003' could be found using its absolute path, but not using its relative path from the cached element of parent folder '_7_ZipRepository.FormC'. This can happen if either the item search timeout is too small or if items within a rooted folder do not share a common parent element. To fix this problem, first increase the item search timeout. If this does not help, create a separate rooted folder for this item or disable caching for the specified folder."

Any help will be appriciated :)

Thank you!
The problem is that Ranorex is looking for the cached elements and not finding them. It then looks for the non-cached version and finds it.

The first time Ranorex sees an object, if that repository object is set to use caching, it will cache the object so it is easier and faster to find it the next time it needs to use it. But if you close the object, or restart the application under test, the new object is not the same as the cached object so Ranorex cannot find it using the cache and must search using the absolute path.

You can turn off caching for the repository object or it's parent folder, or the app, by going into the properties and setting Use Cache to False.

Note that this will make Ranorex search for the object every time it is needed, so it will be slower than caching.


I would recommend that you use caching as much as possible. Given your situation, it may be better to run the "stop and restart" tests from a different repository object than your other regressions.

So you could have a repository like:

MyApp (\form[@title='MyApp'] - Caching on
--MyAppsObjects...
MyApp_RESTART (\form[@title='MyApp']) - Caching off

Use "MyApp" for all tests that do not require restarts, and "MyApp_RESTART" for the ones that do. You might want to use separate repositories in order to make sure the objects are not miss-used unintentionally.
Shortcuts usually aren't...