Hi,
When i use XML Spy to determine an specific object in my application (Java application) it returns the following:
/form[@type='AuthorStudio']/container[@name='contentPane']/container[@name='hsplitPane']/container[@name='leftComponent']/container[@name='tabDock']/container[11]/container[@type='XVJViewport']/tree[@type='XVTree']//treeitem[@text~'^users_2450_2500:\ Leidings']
This object is dynamically created during a test, so the container (now 11) will be different during the next test.
The object mentioned above is active on my screen, but how can i determine before my next test is running the new xpath definition, because it is different now.
in general steps to be executed:
1) determine the xpath for the active element on my screen during test (just like xml spy is doing)
2) next test steps can use the real active xpath as it has been determined
3) next testrun starts with determination of active object.
thx. Remko
Dynamic xpath Determination
Re: Dynamic xpath Determination
Hi,
Could you please post a Ranorex snapshot (NOT screesnhot!) of the problematic element, ideally, two snapshots from different runs?
At next, in most cases (but not always), it's safe to simply remove indexes from the xpath. The rest of the xpath you posted looks quite descriptive, so you I think you can freely remove the index. But after you do it, re-check if the xpath returns correct (and unique) element.
And finally, I would suggest you to read this blog about automating apps with dynamic IDs...
https://www.ranorex.com/blog/automated- ... namic-ids/
Could you please post a Ranorex snapshot (NOT screesnhot!) of the problematic element, ideally, two snapshots from different runs?
At next, in most cases (but not always), it's safe to simply remove indexes from the xpath. The rest of the xpath you posted looks quite descriptive, so you I think you can freely remove the index. But after you do it, re-check if the xpath returns correct (and unique) element.
And finally, I would suggest you to read this blog about automating apps with dynamic IDs...
https://www.ranorex.com/blog/automated- ... namic-ids/
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Dynamic xpath Determination
Hi,
run 1:
/form[@type='AuthorStudio']/container[@name='contentPane']/container[@name='hsplitPane']/container[@name='leftComponent']/container[@name='tabDock']/container[11]/container[@type='XVJViewport']/tree[@type='XVTree']//treeitem[@text~'^users_2450_2500:\ Leidings']
run 2:
/form[@type='AuthorStudio']/container[@name='contentPane']/container[@name='hsplitPane']/container[@name='leftComponent']/container[@name='tabDock']/container[12]/container[@type='XVJViewport']/tree[@type='XVTree']//treeitem[@text~'^users_2450_2500:\ Leidings']
so container will change per run
with removing the index:
/form[@type='AuthorStudio']/container[@name='contentPane']/container[@name='hsplitPane']/container[@name='leftComponent']/container[@name='tabDock']/container/container[@type='XVJViewport']/tree[@type='XVTree']//treeitem[@text~'^users_2450_2500:\ Leidings']
the object could not be found anymore
run 1:
/form[@type='AuthorStudio']/container[@name='contentPane']/container[@name='hsplitPane']/container[@name='leftComponent']/container[@name='tabDock']/container[11]/container[@type='XVJViewport']/tree[@type='XVTree']//treeitem[@text~'^users_2450_2500:\ Leidings']
run 2:
/form[@type='AuthorStudio']/container[@name='contentPane']/container[@name='hsplitPane']/container[@name='leftComponent']/container[@name='tabDock']/container[12]/container[@type='XVJViewport']/tree[@type='XVTree']//treeitem[@text~'^users_2450_2500:\ Leidings']
so container will change per run
with removing the index:
/form[@type='AuthorStudio']/container[@name='contentPane']/container[@name='hsplitPane']/container[@name='leftComponent']/container[@name='tabDock']/container/container[@type='XVJViewport']/tree[@type='XVTree']//treeitem[@text~'^users_2450_2500:\ Leidings']
the object could not be found anymore
Re: Dynamic xpath Determination
Hi,
By snapshot, I meant this:
www.ranorex.com/support/user-guide-20/l ... files.html
Please post the snapshot, so I, or anyone else here, can suggest the best solution.
By snapshot, I meant this:
www.ranorex.com/support/user-guide-20/l ... files.html
Please post the snapshot, so I, or anyone else here, can suggest the best solution.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Dynamic xpath Determination
snapshot is 'not' possible, it will contain all data from the database (Gb's)
Re: Dynamic xpath Determination
Hi,
Well, I'm afraid, that without snapshot, there is nothing else I can do for you. You can still contact Ranorex support (via their support form) and request a remote session with them. Good luck.
Well, I'm afraid, that without snapshot, there is nothing else I can do for you. You can still contact Ranorex support (via their support form) and request a remote session with them. Good luck.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Dynamic xpath Determination
Hello Team,
I am also facing the same issue while creating dynamic path for the click of one of the buttons. Please find the snapshot of the application.
Please let me know how to create dynamic Ranorex xpath for the unique feature identifier button.
Any help will be greatly appreciated.
Thanks and regards
Bishikh Pal
I am also facing the same issue while creating dynamic path for the click of one of the buttons. Please find the snapshot of the application.
Please let me know how to create dynamic Ranorex xpath for the unique feature identifier button.
Any help will be greatly appreciated.
Thanks and regards
Bishikh Pal
You do not have the required permissions to view the files attached to this post.
Re: Dynamic xpath Determination
Hi,
I'm not exactly sure what's the problem with creating xpath in your case? Basically, you can identify the button by its Text attribute, so the xpath could look like this:
I'm not exactly sure what's the problem with creating xpath in your case? Basically, you can identify the button by its Text attribute, so the xpath could look like this:
Or am I missing something important? Please describe, in more details, what exactly is your problem? Thanks./form[@title='Process Information']//button[@text='Unique Feature Identifier']
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Dynamic xpath Determination
Hi remkobol,
Could you try this
BR
Manish
Could you try this
I guess this should help you out/form[@type='AuthorStudio']/container[@name='contentPane']/container[@name='hsplitPane']/container[@name='leftComponent']/container[@name='tabDock']/?/container[@type='XVJViewport']/tree[@type='XVTree']//treeitem[@text~'^users_2450_2500:\ Leidings']
BR
Manish
Last edited by manish on Wed Jul 17, 2019 3:12 pm, edited 1 time in total.
Re: Dynamic xpath Determination
Hi Bishikh,
Can you try the below Xpath:
BR
Manish
Can you try the below Xpath:
/form[@title='Process Information']/.//element[@accessiblename='UGS::UICOMP_button']/buttton[@accessiblename='Unique Feature Identifier']
BR
Manish
-
- Posts: 2
- Joined: Thu Aug 29, 2019 8:40 pm
Re: Dynamic xpath Determination
snapshot is 'not' possible, it will contain all data from the database (Gb's)
Ücretsiz PDF belgeleri
Gratis PDF-dokumenter
Darmowe dokumenty PDF
Gratis PDF Documenten
Ücretsiz PDF belgeleri
Gratis PDF-dokumenter
Darmowe dokumenty PDF
Gratis PDF Documenten
Re: Dynamic xpath Determination
Hi,
Unfortunately, it's impossible to provide a reasonable help without snapshot, and somewhat more detailed description of your problem. Generally speaking, you must edit recorded xpaths to make them independent from dynamic changes. So in your case, simply remove index of problematic container, or replace it with something else. Just make sure the xpath without index number still returns desired and unique element.
Unfortunately, it's impossible to provide a reasonable help without snapshot, and somewhat more detailed description of your problem. Generally speaking, you must edit recorded xpaths to make them independent from dynamic changes. So in your case, simply remove index of problematic container, or replace it with something else. Just make sure the xpath without index number still returns desired and unique element.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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