Page 1 of 1

Regarding XPath Index removal clarification

Posted: Fri Jun 18, 2021 1:55 pm
by amitgupta
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

Re: Regarding XPath Index removal clarification

Posted: Fri Jun 18, 2021 2:00 pm
by odklizec
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.

Re: Regarding XPath Index removal clarification

Posted: Fri Jun 18, 2021 10:00 pm
by amitgupta
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?

Re: Regarding XPath Index removal clarification

Posted: Fri Jun 18, 2021 11:14 pm
by odklizec
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/

Re: Regarding XPath Index removal clarification

Posted: Wed May 10, 2023 8:11 am
by Julie.Toussaint
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

Re: Regarding XPath Index removal clarification

Posted: Fri Jun 09, 2023 7:45 am
by Julie.Toussaint
Bump: It has been a full month of no replies and this is urgent :!:

Re: Regarding XPath Index removal clarification

Posted: Fri Jun 09, 2023 7:57 am
by Julie.Toussaint
Find attached a snapshot of a menuitem with text getting assigned an index attribute [1] instead...

Removing Index in RxPath, how?

Posted: Wed Jun 21, 2023 10:25 am
by Julie.Toussaint
Bump: Weight rules still are not applied, as seen in the provided snapshot as well as the screenshots... :(

Re: Regarding XPath Index removal clarification

Posted: Fri Jun 23, 2023 9:50 am
by doke
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

Re: Regarding XPath Index removal clarification

Posted: Tue Jun 27, 2023 7:56 am
by Julie.Toussaint
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.

Re: Regarding XPath Index removal clarification

Posted: Fri Oct 27, 2023 12:32 pm
by Julie.Toussaint
Bump: More than four months have passed and this issue is still a daily struggle when building objects with RxPaths in the repositories...