XPath changes

Ask general questions here.
UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

XPath changes

Post by UgaAga » Wed Feb 20, 2013 11:24 am

Hi,
sadly i can't reproduce this issue well enough, but sometimes my ranorex tests are stopping to work. This is because of a change in the xpath which occurs suddenly after running a ranorex test. When ranorex gets in touch with the form elements, "something" is happening. Are you already aware of this issue?

Bye

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: XPath changes

Post by Ciege » Wed Feb 20, 2013 4:10 pm

Can you post an example of two XPaths that have changed (both for the same element)? Off the cuff, it sounds like maybe you are using the auto generated ID instead of a uniquely identifiable attribute.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: XPath changes

Post by UgaAga » Wed Feb 27, 2013 5:04 pm

Hi Ciege,
sorry for my late reply. My question was asked unclear. The xpath doesn't really change. If i look at my elements in the repository, then i can highlight them. But if i have for example three buttons in a test, then the first button is pressed, but the second button will not be found. But i can press the second button in a new test and the third will not be found...

Bye

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: XPath changes

Post by Ciege » Wed Feb 27, 2013 5:08 pm

What type of AUT is it?

Could it be that when you press a button (say button one) the page changes, therefore the xpath to the other buttons are no longer valid?

I would check the path to the buttons before and after a press of one of the other buttons and make sue that the path has not changed.

Also, make sure that this is not a timing issue, like the page has not refreshed by the time you are looking for the next button.

Without seeing your AUT, code, error messages or a RanorexSpy snapshot it will be hard to diagnose with the brief information you have provided.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: XPath changes

Post by UgaAga » Wed Feb 27, 2013 6:00 pm

Hi,
thanks for your reply. I will check your suggestions. Meantime i was able to encircle the problem. It appears when another application is loaded into my original app. The new application is a child process and embedded into the parent or shown as child dialog. And the buttons are part of the child process. So the related process of the buttons changes, but i always use the buttons in the content of the parent process.

Bye
Last edited by UgaAga on Wed Feb 27, 2013 6:13 pm, edited 2 times in total.

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: XPath changes

Post by UgaAga » Wed Feb 27, 2013 6:02 pm

Ok the path doesn't change and it isn't a timing problem.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: XPath changes

Post by Ciege » Wed Feb 27, 2013 6:23 pm

Well, if you can't figure it out, and don't want to publicly share your code and RanorexSpy snapshot I think this is the proper place for the Support Team to step in and help you figure it out.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

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

Re: XPath changes

Post by Support Team » Fri Mar 01, 2013 2:02 pm

Hi,

Could you send us the report file which includes the error messages?
Could you please try the following:
Click the first button and then search in code for the second button, but please use the full RxPath without the help of one of the repository items. Search for the second button after you clicked on the first one.

Are you using repository folders and did you enable the caching for the folders?
If yes, please set the Use Cache property to false.

Regards,
Markus
.
Image

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: XPath changes

Post by UgaAga » Wed Mar 13, 2013 3:02 pm

Hi Markus,
disabling the folder caching didn't work but the full rxPath did it.

Thanks a lot

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

Re: XPath changes

Post by Support Team » Thu Mar 14, 2013 12:41 pm

Hi,

You're welcome!
Are you sure you disabled it for all folders (especially for the rooted folder)?

Regards,
Markus
.
Image

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: XPath changes

Post by UgaAga » Fri Mar 15, 2013 5:29 pm

Hi,
Global Settings -> Repository Defaults -> Uncheck "Enable folder caching" is what i did. So i would appreciate it if there was another way to get this working, because using the full path isn't the best way to do it.

Bye

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

Re: XPath changes

Post by Support Team » Mon Mar 18, 2013 2:06 pm

Hi,

This setting will just change the default values for new repositories not for existing ones.
You have to open your repository and manually change the "Use Cache" property for each of your folders, there is no such property for "Simple Folders".

Regards,
Markus
.
Image