I want to handle one table header object in generic way. Defining one oject i want to handle all tables similar object.
Issue :
xpath for header 1 :
/form[@title~'.*']/container[@caption='']/container[@controlname~'.*']/container[@caption='']//element[@class='AxHeaderCtrl']/list[@accessiblename='Header Control']/cell[@accessiblename='Name']
xpath for header 2 :
/form[@title~'.*']/container[@caption='']/container[@controlname~'.*']/container[@caption='']//element[@class='AxPaneWnd']/element[@instance='0']//element[@class='AxHeaderCtrl']/list[@accessiblename='Header Control']/cell[@accessiblename='Relation']
I tried with :
Cell tbTopCell=".//element[@class='AxHeaderCtrl']/list[@accessiblename='Header Control']/cell[@accessiblename='"+StrColumnName+"']";
StrColumnName: variable where i am passing column name.
This is not woring
Is there any way to identify this object which is present in different form and different dom structure?
how to identify same object in different dom path
Re: how to identify same object in different dom path
Hi,
Please upload a Ranorex snapshot of both forms. Without snapshot, it's hard to provide a reasonable help. Also, I'm not quite sure if you want to find elements in both forms simultaneously, i.e. if both (multiple) forms could be opened at the same time?
Generally speaking, your approach cannot work, because both forms returns different xpaths. What could eventually work, is something like this:
But as mentioned, without snapshot (NOT screenshot), it's hard to provide a precise answer.
Please upload a Ranorex snapshot of both forms. Without snapshot, it's hard to provide a reasonable help. Also, I'm not quite sure if you want to find elements in both forms simultaneously, i.e. if both (multiple) forms could be opened at the same time?
Generally speaking, your approach cannot work, because both forms returns different xpaths. What could eventually work, is something like this:
Code: Select all
Cell tbTopCell=".//element[@class='AxHeaderCtrl' or @class='AxPaneWnd']//list[@accessiblename='Header Control']/cell[@accessiblename='"+StrColumnName+"']";
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