Page 1 of 1

Special character to override inherited Xpath

Posted: Wed Mar 18, 2015 10:20 pm
by jackrabbit
I need to build a large menu system in my Repository. To keep the Xpath to a minimum, I mimic the actual menu structure with Rooted folders, this also allows me to quickly find any menu option by browsing the Rooted folder, exactly like the actual menu system.

The problem I have is that I also need to create a FORM element for each option, so I can make sure the recording actually opened the right form. The Xpath to check my form is "/form[@title~'^Whatever title" but I would like to keep it as part of the same Repository structure to keep things well structured and together.

Right now I need to figure out how many "../" I need to add to my form Xpath to "backtrack" up to the root level, and then go look for the form. Is there a way to replace all those "../../../../../" by a special character that says "go back to the root node"?

I joined a PrintScreen of the Recording and the Repository that launches a menu option and validates that the right form is displayed at the end.

P.S. If such a "ROOT" code down not exists, it would be a nice feature to add in a subsequent release ...

Thanks

Re: Special character to override inherited Xpath

Posted: Fri Mar 20, 2015 5:38 pm
by Support Team
Hello jackrabbit,

Thank you for the detailed description, but I am afraid that this is not really recommended because your test run will get slower if you do this. Ranorex has to search first for the context menu and after that for the new form element.
I am not even sure if this works in general because usually the context menu closes after clicking and Ranorex can no longer find it, but maybe it depends on your application.
I my opinion it would be better to create a new rooted folder for the form which was opened form the context menu.


Regards,
Bernhard

Re: Special character to override inherited Xpath

Posted: Fri Mar 20, 2015 6:25 pm
by jackrabbit
OK, thanks