I'm doing tests with "dynamic id"

Ask general questions here.
jecardenasri01
Posts: 23
Joined: Tue Feb 13, 2018 2:33 pm

I'm doing tests with "dynamic id"

Post by jecardenasri01 » Tue Mar 20, 2018 7:55 pm

I'm doing tests with "dynamic id"

I already create a corresponding rule but when I want to assign values ​​and do not take them.

when I run xpath and change the value of "id" to = 0, I do not care about "inner text" and apply changes but when validating again it is still the main "id" and not the "inner text"

I'm reviewing:
https://www.ranorex.com/blog/automated- ... namic-ids/

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

Re: I'm doing tests with "dynamic id"

Post by odklizec » Tue Mar 20, 2018 8:37 pm

Hi,

Please post a Ranorex snapshot of the problematic element a screenshot of the xpath weight editor with your actual settings. I’m afraid, there is not much anyone here can do or suggest without more details.
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

jecardenasri01
Posts: 23
Joined: Tue Feb 13, 2018 2:33 pm

Re: I'm doing tests with "dynamic id"

Post by jecardenasri01 » Wed Mar 21, 2018 9:43 pm

odklizec wrote:Hi,

Please post a Ranorex snapshot of the problematic element a screenshot of the xpath weight editor with your actual settings. I’m afraid, there is not much anyone here can do or suggest without more details.

I made a video in which I have 2 failures

1) I do not recognize the dynamic id when I select it from the repository, I should take the "most wanted list"

2) when I change the attribute id = 0 it does not change and it remains 200 and the inner text value remains the 2nd value and not the main one

https://www.youtube.com/watch?v=nAUHahm ... e=youtu.be

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

Re: I'm doing tests with "dynamic id"

Post by odklizec » Thu Mar 22, 2018 9:15 am

Hi,

I now see what's your problem. There are two problems. Firstly, you need to Apply the change in weight editor, before making another changes. Also, if you want to both decrease a weight value of an attribute and at the same time increase weight value of another attribute, you need to create TWO new rules. It can't be done in one rule! Selecting another attribute, in the same rule, simply resets the weight value (for selected attribute) back to its original state!

So in your case, you should decrease ID weight to 0 and press Apply. Then if you want to increase weight value of InnerText, you need to create another rule and in this new rule you can increase innertext's value. Yeah...the xpath weight editor is far from perfect and it would be nice to see some (heavy) improvements ;)

Now after setting the weight rule, you need to refresh the spy! Otherwise, you will still see the xpath with IDs.
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

jecardenasri01
Posts: 23
Joined: Tue Feb 13, 2018 2:33 pm

Re: I'm doing tests with "dynamic id"

Post by jecardenasri01 » Tue Mar 27, 2018 1:20 pm

odklizec wrote:Hi,

I now see what's your problem. There are two problems. Firstly, you need to Apply the change in weight editor, before making another changes. Also, if you want to both decrease a weight value of an attribute and at the same time increase weight value of another attribute, you need to create TWO new rules. It can't be done in one rule! Selecting another attribute, in the same rule, simply resets the weight value (for selected attribute) back to its original state!

So in your case, you should decrease ID weight to 0 and press Apply. Then if you want to increase weight value of InnerText, you need to create another rule and in this new rule you can increase innertext's value. Yeah...the xpath weight editor is far from perfect and it would be nice to see some (heavy) improvements ;)

Now after setting the weight rule, you need to refresh the spy! Otherwise, you will still see the xpath with IDs.

I do it like that but I do not know if I'm doing it wrong, because it's still not working

https://w ww.youtube.com/watch?v=Zr92EQtRnO4

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

Re: I'm doing tests with "dynamic id"

Post by odklizec » Tue Mar 27, 2018 1:29 pm

Hi,

The problem is that changing xpath weight is only a first step! After creating new xpath weight rules, you must recreate all existing xpaths in repo! You see, xpath weight is applied only to newly recorded elements, not the already existing elements (their xpaths). Eventually, you must open an existing repo element in Spy, and refresh its xpath. So then the xpath should change from using IDs to InnerTexts.
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

jecardenasri01
Posts: 23
Joined: Tue Feb 13, 2018 2:33 pm

Re: I'm doing tests with "dynamic id"

Post by jecardenasri01 » Tue Mar 27, 2018 7:37 pm

odklizec wrote:Hi,

The problem is that changing xpath weight is only a first step! After creating new xpath weight rules, you must recreate all existing xpaths in repo! You see, xpath weight is applied only to newly recorded elements, not the already existing elements (their xpaths). Eventually, you must open an existing repo element in Spy, and refresh its xpath. So then the xpath should change from using IDs to InnerTexts.


sorry I did not understand, could you give me an example

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

Re: I'm doing tests with "dynamic id"

Post by odklizec » Wed Mar 28, 2018 7:31 am

Hi,

There is not much to explain. You must re-create already recorded elements in repo (those with IDs in xpath).

Simply open each single xpath with ID in spy, make sure the app is in expected state (the element you want to update must be visible in GUI), switch to "Browser & Results" tab, right click the element, which xpath you would like to update and from the context menu select "Update path". That's all.
updatepath.png
You do not have the required permissions to view the files attached to this post.
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

jecardenasri01
Posts: 23
Joined: Tue Feb 13, 2018 2:33 pm

Re: I'm doing tests with "dynamic id"

Post by jecardenasri01 » Mon Apr 02, 2018 1:30 pm


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

Re: I'm doing tests with "dynamic id"

Post by odklizec » Tue Apr 03, 2018 8:12 am

Hi,

I'm afraid, I don't speak Spanish, but from what I've understand, your use of xpath weight editor is correct. The only thing I would do differently is that instead of deleting existing repo items (with dynamic IDs in their xpaths), I would simply open the items in Spy and update their xpaths, instead of re-recording them. Hope this helps?
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