SWF Application - RanoreXPath

Ask general questions here.
Mirage
Posts: 11
Joined: Mon May 04, 2009 11:04 am

SWF Application - RanoreXPath

Post by Mirage » Thu May 07, 2009 9:52 am

Hi again,

I have a question about XPath. When I try to identify elements in our SWT application, it generates a pretty long XPath. This can't be helped since SWT uses many layers of controls. However, notice below that it contains unnecessary items. @processname='Harmony' is included in every element. It should be enough to include it once. I really hope this can be resolved somehow, because we use oemized applications which use the same test code, but they have a different process name.

Code: Select all

/form[@title~'^Harmony\ Eclipse\ 0\.2\.0\.336']/element[@processname='Harmony' and @class='SWT_Window0' and @instance='2']/element[@processname='Harmony' and @class='SWT_Window0' and @instance='1']/element[@processname='Harmony' and @class='SWT_Window0' and @instance='4']/*/*/*/*/element[@processname='Harmony' and @class='SWT_Window0' and @instance='1']/element[@processname='Harmony' and @class='SWT_Window0' and @instance='0']/element[@processname='Harmony' and @class='SWT_Window0' and @instance='1']/text[@processname='Harmony' and @class='Edit' and @instance='0']
Thanks

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 » Thu May 07, 2009 12:25 pm

Hi Mirage,
it`s not necessary to have "@processname" and "@class" attributes in every subelement.

e.g. for your element

Code: Select all

/form[@title~'^Harmony\ Eclipse\ 0\.2\.0\.336' and @processname='Harmony']/element[@instance='2']/element[@instance='1']/element[@instance='4']/*/*/*/*/element[@instance='1']/element[@instance='0']/element[@instance='1']/text[@class='Edit' and @instance='0']
For SWF applications there`s less element identification information, so our generated RanoreXPath is not optimized but we are working on a better solution for this issue.
However, you can use Ranorex Spy, select your element and modify the RxPath manually.

Regards,
Christian
Ranorex Support Team

Mirage
Posts: 11
Joined: Mon May 04, 2009 11:04 am

Post by Mirage » Thu May 07, 2009 2:46 pm

For now, I made a little application which cleans repositories in a pre-build of the testing application. It basically removes all process and SWT class attributes, because it is too much effort to do it manually.

Works so far.