Regarding XPath Index removal clarification

Ranorex Studio, Spy, Recorder, and Driver.
amitgupta
Posts: 54
Joined: Sun Mar 28, 2021 7:58 pm

Regarding XPath Index removal clarification

Post by amitgupta » Fri Jun 18, 2021 1:55 pm

Dear Team,

Could you please guide to share best trick and tips where ranorex tool didn't give any index element in XPath during recording or using ranorex spy tool /Track button and also use any good attribute with value because while using any index property it will be failed if there is enhancement and also run same script in another environment .

XPath :- /dom[@domain='testing']/body/div[3]/div[3]/div/div[3]//form[@name='api.frmAddPersonalInformation']/div[2]/div[2]/div[2]/?/?/span[@title='']/span/span[2]

Could you please help me on this?


Apart from this ,Could you guide us as better way how we can utilized xpath advance setting as attribute scaling and attribute weight bec i changed attrubte scaling and set weight but i did n;t notice any changes
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Regarding XPath Index removal clarification

Post by odklizec » Fri Jun 18, 2021 2:00 pm

Hi,

To get a reasonable help for this kind of question, please attach a Ranorex snapshot (NOT screenshot) of the UI you are working with. This would help you to provide best examples and xpath tips. Thanks.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

amitgupta
Posts: 54
Joined: Sun Mar 28, 2021 7:58 pm

Re: Regarding XPath Index removal clarification

Post by amitgupta » Fri Jun 18, 2021 10:00 pm

odklizec wrote:
Fri Jun 18, 2021 2:00 pm
Hi,

To get a reasonable help for this kind of question, please attach a Ranorex snapshot (NOT screenshot) of the UI you are working with. This would help you to provide best examples and xpath tips. Thanks.
i got confusion because i have shared all ranorex snap shot with xpath value as attachment for same question .could u please look in to it?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Regarding XPath Index removal clarification

Post by odklizec » Fri Jun 18, 2021 11:14 pm

Hi,

Unfortunately, what you’ve posted are screenshots and not snapshots. Please read this user guide chapter about Ranorex snapshots…
https://www.ranorex.com/help/latest/ran ... hot-files/
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Julie.Toussaint
Posts: 15
Joined: Wed Feb 08, 2023 10:47 am

Re: Regarding XPath Index removal clarification

Post by Julie.Toussaint » Wed May 10, 2023 8:11 am

Is it possible to remove occurences of index being used as capabilities' attribute in xpath.

Example:

Code: Select all

/MenuItem[0]
Goal:

Code: Select all

/MenuItem[@text='Test_Main_MainForm_mnuMore']
Creating a weight rule that sets MenuItem's Text attribute to very important does not seem to replace the index by its text attribute?
As seen on this screenshot:
Image

Seemingly the Ranorex Attributes Overview is not adjusted after adjusting the rule, only after adjusting Expert Settings does the weight change there.
Image

Kind regards,
Julie

---
Current Compiler Version: C# 5.0
Current Target Framework: .NET Framework 4.8
Current Ranorex Version: 10.7.0
Last edited by Julie.Toussaint on Fri Jun 09, 2023 7:45 am, edited 1 time in total.
Application Engineer 🇧🇪
The workaround experience, awaiting a reply

Julie.Toussaint
Posts: 15
Joined: Wed Feb 08, 2023 10:47 am

Re: Regarding XPath Index removal clarification

Post by Julie.Toussaint » Fri Jun 09, 2023 7:45 am

Bump: It has been a full month of no replies and this is urgent :!:
Application Engineer 🇧🇪
The workaround experience, awaiting a reply

Julie.Toussaint
Posts: 15
Joined: Wed Feb 08, 2023 10:47 am

Re: Regarding XPath Index removal clarification

Post by Julie.Toussaint » Fri Jun 09, 2023 7:57 am

Find attached a snapshot of a menuitem with text getting assigned an index attribute [1] instead...
You do not have the required permissions to view the files attached to this post.
Application Engineer 🇧🇪
The workaround experience, awaiting a reply

Julie.Toussaint
Posts: 15
Joined: Wed Feb 08, 2023 10:47 am

Removing Index in RxPath, how?

Post by Julie.Toussaint » Wed Jun 21, 2023 10:25 am

Bump: Weight rules still are not applied, as seen in the provided snapshot as well as the screenshots... :(
Application Engineer 🇧🇪
The workaround experience, awaiting a reply

User avatar
doke
Posts: 112
Joined: Fri Mar 29, 2019 2:33 pm

Re: Regarding XPath Index removal clarification

Post by doke » Fri Jun 23, 2023 9:50 am

Hi Julie,

When I look at my Rx atrribute overview, and scroll down, I see:
Web plugin:
Webelement Id 200

Could it be that your weight value needs to be over 200 ?

Don

Julie.Toussaint
Posts: 15
Joined: Wed Feb 08, 2023 10:47 am

Re: Regarding XPath Index removal clarification

Post by Julie.Toussaint » Tue Jun 27, 2023 7:56 am

Hello,

First of all thank you for replying.

No, for these reasons:
1. The software I am using Ranorex Test Automation on does not contain web elements and therefore this shouldn't have an impact.
1.1. This is confirmed by the fact Ranorex Spy does not see webelement id of any object (used in RxPath) in Overview or Advanced attributes tab

2. If it were to be webelement ID that I need to eliminate, I would need to set the weight value under 100 in order to do so (not 200).

Perhaps there exists a General Object Index Weight Rule for all objects that don't contain an index attribute*?
*By this I mean an index attribute which the weight rules can hide from RxPath, so Ranorex Spy quits using it while composing RxPath.

3. Just in case the weight rule I am attempting to assign is indeed webelement, I gave it a try, but this did not work.

In case a solution is found I will post it below.
Application Engineer 🇧🇪
The workaround experience, awaiting a reply

Julie.Toussaint
Posts: 15
Joined: Wed Feb 08, 2023 10:47 am

Re: Regarding XPath Index removal clarification

Post by Julie.Toussaint » Fri Oct 27, 2023 12:32 pm

Bump: More than four months have passed and this issue is still a daily struggle when building objects with RxPaths in the repositories...
Application Engineer 🇧🇪
The workaround experience, awaiting a reply