Recorded RxPaths are too exact and too hard to change

Ranorex Spy, Recorder, and Studio.
torlin
Posts: 8
Joined: Mon Feb 02, 2009 2:05 pm

Recorded RxPaths are too exact and too hard to change

Post by torlin » Mon Feb 02, 2009 2:57 pm

I am testing a web application by recording test scripts. In doing so I find that the paths that are stored in the Global Repository are unnecessarily detailed.

Example:
I want to test that a certain radio button is checked. In the Global Repository the button is identified by an RxPath that might go something like

"Base: /form[@title~'^MyApp']"
and
"container/container/dom/body/*/div[@id='Main']/*/div[3]/form[@id='MyForm']/*/tr[2]/td[2]/input[@name='something']"

If I now refactor my application to get a nicer layout my test will probably fail, not because the radio button is not checked but because the form tag's parent tag is no longer the third among its siblings. But that is irrelevant to the test! The test target was the status of the radio button, not its exact location in the dom tree.

This is the paths after manual rewriting:

"Base: /form[@title~'^MyApp']container/container/dom"
and
".//self::input[@name='something']"

This must be done manually, but changing a path in the Global Repository is not always easy. E.g. changes will not be accepted if the element is not currently available. So I have to open the relevant web page, possibly going through a long login process, and navigate to the form before I can make changes. With many changes to make this takes time...

What if Ranorex could at least leave out everything in the relative path before the last tag with an id attribute? Like this:

"Base: /form[@title~'^MyApp']container/container/dom"
and
".//self::form[@id='MyForm']/*/tr[2]/td[2]/input[@name='something']"

That would save me a lot of time.

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

Post by Support Team » Mon Feb 02, 2009 6:29 pm

The good news is that (in the upcoming release)

1) we already addressed a few issues in the repository editor to make editing less painful.
In any case, it should not be necessary that the element is "live" for its path to be edited.

2) web pages ("dom" elements) will also be visible in the root of the element tree. as a result, the web dom is available as a top-level folder in the repository, making grouping easier.
e.g. Application Folder: "/dom[@title='mywebpage']", folders are now created for in-between containers. (for example some div)

However, path generation wont change substantially;
We are planning to make it more tweakable in the future.

If you want to skip certain levels in the dom, just use .//tag in the folder path.

Michael
Ranorex Team

torlin
Posts: 8
Joined: Mon Feb 02, 2009 2:05 pm

Post by torlin » Tue Feb 03, 2009 9:45 am

Thank you. It's good to hear that Ranorex is being developed further.

The .//tag trick is good. Put it in the User Guide!

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

Post by Support Team » Tue Feb 03, 2009 10:51 am

torlin wrote:The .//tag trick is good. Put it in the User Guide!
It was already there, but maybe to hard to find :-)
http://www.ranorex.com/support/user-gui ... html#c1792

Regards,
Alex
Ranorex Support Team