ranorex xpath with or condition

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
sachin_mise
Posts: 9
Joined: Thu Mar 24, 2022 11:46 am

ranorex xpath with or condition

Post by sachin_mise » Tue Aug 02, 2022 9:46 am

Hi all

with OR condition ranorex xpath is not identifying the object ,please help how to write or condition for the below xpath


///a[@innertext='batqt0400_07252200_01_00_M00']/../..//div[4]/div[2]/*[@class = 'cm-chip-label processing ng-scope' or @class = 'undeline-text ng-binding md-default-theme']

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

Re: ranorex xpath with or condition

Post by odklizec » Mon Aug 08, 2022 7:59 am

Hi,

Please post a Ranorex snapshot (NOT screenshot) of the problematic element. Without seeing, at very least, a Ranorex snapshot, there is not much anyone here can do or suggest. Thanks.

My best guess is that there are different (more or less) properties in given Class attribute or the problem is caused by indexes. But as said above, it's impossible to tell for sure without seeing snapshot.
Last edited by odklizec on Tue Aug 09, 2022 2:33 pm, edited 1 time in total.
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

sachin_mise
Posts: 9
Joined: Thu Mar 24, 2022 11:46 am

Re: ranorex xpath with or condition

Post by sachin_mise » Tue Aug 09, 2022 12:16 pm

hi
Thank you so much for replying on our query and helping ,

i have attached the snapshot , i need to bind the xpath with or condition

since i pass this element pandax100_08082200_01_00_M00 then it should pick the subsequent order number
for that we have written two class xpath with Or but its showing syntax error

we are trying some thing like this but looks like this is not correct

///a[@innertext='batqt0400_07252200_01_00_M00']/../..//div[4]/div[2]/*[@class = 'cm-chip-label processing ng-scope' or @class = 'undeline-text ng-binding md-default-theme']
kindly help
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: ranorex xpath with or condition

Post by odklizec » Tue Aug 09, 2022 2:52 pm

Hi,

Unfortunately, the snapshots you posted does not contain screenshots, so it's pretty hard to orient in the GUI, which appears t be quite complex.
Could you please create new snapshots with screenshots?

Also, neither of the snapshots return anything for this xpath:

Code: Select all

///a[@innertext='batqt0400_07252200_01_00_M00']/../..//div[4]/div[2]/*[@class='cm-chip-label processing ng-scope']
not even this:

Code: Select all

/dom[@domain='beta.compasquality.siemens-info.com']//tag[#'main-container']//tag[@class='md-padding _md layout-xs-column layout-sm-column layout-row']//a[@innertext='batqt0400_07252200_01_00_M00']
or this:

Code: Select all

/dom[@domain='beta.compasquality.siemens-info.com']//tag[#'main-container']//tag[@class='md-padding _md layout-xs-column layout-sm-column layout-row']//*[@class='cm-chip-label processing ng-scope']
So there is most probably a problem with the class part of the xpath you trying to use as a condition? Or neither of the snapshots is in expected state?

And finally, there is no element with inner text a[@innertext='batqt0400_07252200_01_00_M00'] in either snapshot.

The only thing which works is something like this:

Code: Select all

/dom[@domain='beta.compasquality.siemens-info.com']//tag[#'main-container']//a[@class='undeline-text ng-binding md-default-theme']
But this returns 16 elements, which is most probably not what you are looking for? ;)

So please, create new snapshots, containing visible screenshots and element, from which you want to start search for required elements.
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