Can't detect a button in a tabber...

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
ducarpit
Posts: 23
Joined: Thu Apr 23, 2020 1:48 pm

Can't detect a button in a tabber...

Post by ducarpit » Tue Apr 28, 2020 8:43 am

Hi,
i am recording a web test but i have a problem:
after some click on some buttons, i have to click on a button in a tabber in a workarea (seei the picture in the attachments):
Cattura.JPG
I tryed to register the test with Chrome and Firefox but the problem is the same, the action is present in the rxrec list but the test blocks itself at the time of the click because Ranorex can't find the button.
i also tryed with Spy to track the button....

In the attachments, i also make a Ranorex Snapshot of the button.
How can i solve the problem or a walkaround to solve?
Thanks in advance

Christian

Ranorex: 9.3 latest version
OS: Windows 10
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: Can't detect a button in a tabber...

Post by odklizec » Tue Apr 28, 2020 8:58 am

Hi,

Please show us the full xpath for given element (as is stored in repository). I guess that the problem is either in "iframe" src attribute or "li" unique ID, whci appears to be highly volatile to changes?

In the snapshot, Li element shows unique ID "tab7". My guess is, that the Li element stored in your repo has different number? ;) Eventually, there is changing the string in iframe src attribute? So, here is an example of xpath, which should work, regardless of iframe or li ID dynamic changes...
/dom[@domain='127.0.0.1']//div[#'workAreasContainer']//iframe[@class='main-iframe']//li[@id~'tab']/a[@innertext='Sicurezza']
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

ducarpit
Posts: 23
Joined: Thu Apr 23, 2020 1:48 pm

Re: Can't detect a button in a tabber...

Post by ducarpit » Tue Apr 28, 2020 9:13 am

odklizec wrote:
Tue Apr 28, 2020 8:58 am
Hi,

Please show us the full xpath for given element (as is stored in repository). I guess that the problem is either in "iframe" src attribute or "li" unique ID, whci appears to be highly volatile to changes?

In the snapshot, Li element shows unique ID "tab7". My guess is, that the Li element stored in your repo has different number? ;) Eventually, there is changing the string in iframe src attribute? So, here is an example of xpath, which should work, regardless of iframe or li ID dynamic changes...
/dom[@domain='127.0.0.1']//div[#'workAreasContainer']//iframe[@class='main-iframe']//li[@id~'tab']/a[@innertext='Sicurezza']
Hi, thanks for the response...
I'm not sure if the xpath is the first or the second field:
Cattura.JPG
So i post both:

Code: Select all

/dom[@domain='127.0.0.1']//div[#'workAreasContainer']//iframe[@src='http://127.0.0.1/www/enc_url?u=DclU9UjOcpolTIDdXzmBHHSwZLuwQDabIIwJ2WBZeYhZoKtkMMVuNh_sOmfuLo7EzSEr9jGLWVkyvFU=&isRunningInNewContainer=1&wapid_=workarea_2_1588061161018&client_width=1920&client_height=957&x_az_id__=0']//form[#'myform']/table//div/ul/li[2]/a[@innertext='Sicurezza']

/dom[@domain='127.0.0.1']//div[#'workAreasContainer']//iframe[@src='http://127.0.0.1/www/enc_url?u=DclU9UjOcpolTIDdXzmBHHSwZLuwQDabIIwJ2WBZeYhZoKtkMMVuNh_sOmfuLo7EzSEr9jGLWVkyvFU=&isRunningInNewContainer=1&wapid_=workarea_2_1587997266406&client_width=1920&client_height=957&x_az_id__=0']//form[#'myform']/table//ul/li[2]/a[@innertext='Sicurezza']
Thanks a lot,
Christian
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: Can't detect a button in a tabber...

Post by odklizec » Tue Apr 28, 2020 9:33 am

Hi

The first xpath is the actual one, the second one is previously stored/used xpath. As you can see, both have differences in iframe src attribute. You should definitely replace src attribute with something else, for example the class attribute I suggested. Also, in your xpath, there are used index numbers, which often changes too. Simply use the xpath I suggested and it should work.
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

ducarpit
Posts: 23
Joined: Thu Apr 23, 2020 1:48 pm

Re: Can't detect a button in a tabber...

Post by ducarpit » Tue Apr 28, 2020 10:25 am

odklizec wrote:
Tue Apr 28, 2020 9:33 am
Hi

The first xpath is the actual one, the second one is previously stored/used xpath. As you can see, both have differences in iframe src attribute. You should definitely replace src attribute with something else, for example the class attribute I suggested. Also, in your xpath, there are used index numbers, which often changes too. Simply use the xpath I suggested and it should work.
Hi,
i tryed your xpath in two ways:

Code: Select all

/dom[@domain='127.0.0.1']//div[#'workAreasContainer']//iframe[@class='main-iframe']//li[@id~'tab']/a[@innertext='Sicurezza']

/dom[@domain='127.0.0.1']//div[#'workAreasContainer']//iframe[@class='appframe']//li[@id~'tab']/a[@innertext='Sicurezza']
But unfortunatly doens't work :cry:
Maybe i have to change other parameters in the xpath? Maybe the iframe class?
Christian

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

Re: Can't detect a button in a tabber...

Post by odklizec » Tue Apr 28, 2020 11:09 am

Hi,

The first one (the one I suggested) definitely works with the snapshot you posted.
/dom[@domain='127.0.0.1']//div[#'workAreasContainer']//iframe[@class='main-iframe']//li[@id~'tab']/a[@innertext='Sicurezza']
The other one is incorrect, because class attribute for given iframe is 'main-iframe'. The 'appframe' you used belongs to 'name' attribute, so the xpath should look like this:
/dom[@domain='127.0.0.1']//div[#'workAreasContainer']//iframe[@name='appframe']//li[@id~'tab']/a[@innertext='Sicurezza']
If neither xpath works for you, then please add "Create Snapshot" action directly before the failing action and point it to entire DOM element. And then please post the entire report you get after failure. Thanks.
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

ducarpit
Posts: 23
Joined: Thu Apr 23, 2020 1:48 pm

Re: Can't detect a button in a tabber...

Post by ducarpit » Tue Apr 28, 2020 12:34 pm

odklizec wrote:
Tue Apr 28, 2020 11:09 am
Hi,

The first one (the one I suggested) definitely works with the snapshot you posted.
/dom[@domain='127.0.0.1']//div[#'workAreasContainer']//iframe[@class='main-iframe']//li[@id~'tab']/a[@innertext='Sicurezza']
The other one is incorrect, because class attribute for given iframe is 'main-iframe'. The 'appframe' you used belongs to 'name' attribute, so the xpath should look like this:
/dom[@domain='127.0.0.1']//div[#'workAreasContainer']//iframe[@name='appframe']//li[@id~'tab']/a[@innertext='Sicurezza']
If neither xpath works for you, then please add "Create Snapshot" action directly before the failing action and point it to entire DOM element. And then please post the entire report you get after failure. Thanks.
Hi,
i build the long path in this way:

Code: Select all

/dom[@domain='127.0.0.1']//div[@id='content']//div[@id='content-column']/div[@id='workAreasContainer']/div[3]/div[2]/div[1]/iframe[@name='appframe']//form[@name='myform']//div[@class='tabberlive']//ul[@class='tabbernav']/li[@id='tab7']/a[@title='Sicurezza']
and it works! It's a little bit difficult, i want to try your solution because it is smaller than this xpath.

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

Re: Can't detect a button in a tabber...

Post by odklizec » Tue Apr 28, 2020 12:41 pm

Hi,

While this xpath might work right now, I would strongly recommend to remove all divs with indexes and replace @id='tab7' with @id~'tab'. Try this xpath instead...
/dom[@domain='127.0.0.1']//div[@id='content']//div[@id='content-column']/div[@id='workAreasContainer']//iframe[@name='appframe']//form[@name='myform']//div[@class='tabberlive']//ul[@class='tabbernav']/li[@id~'tab']/a[@title='Sicurezza']
Anyway, the original xpath I posted should work too. But it may be a good idea to make the xpath a bit more precise.
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

ducarpit
Posts: 23
Joined: Thu Apr 23, 2020 1:48 pm

Re: Can't detect a button in a tabber...

Post by ducarpit » Tue Apr 28, 2020 1:57 pm

odklizec wrote:
Tue Apr 28, 2020 12:41 pm
Hi,

While this xpath might work right now, I would strongly recommend to remove all divs with indexes and replace @id='tab7' with @id~'tab'. Try this xpath instead...
/dom[@domain='127.0.0.1']//div[@id='content']//div[@id='content-column']/div[@id='workAreasContainer']//iframe[@name='appframe']//form[@name='myform']//div[@class='tabberlive']//ul[@class='tabbernav']/li[@id~'tab']/a[@title='Sicurezza']
Anyway, the original xpath I posted should work too. But it may be a good idea to make the xpath a bit more precise.
Hi,
that's strange, i tryed your last xpath but doesn't work:
Capture.PNG
I don't know why, i'm sorry, i use Ranorex Studio from 7 days....
With the my long xpath yes....
Christian
You do not have the required permissions to view the files attached to this post.

Elena_v
Posts: 18
Joined: Tue Jun 25, 2019 4:27 pm

Re: Can't detect a button in a tabber...

Post by Elena_v » Thu May 14, 2020 1:29 pm

Hi ducarpit!
Try to Track your button again and after this to delete extra parameters in XPath. Also check all / and // (maybe somewhere extra).
P.s.: did you change parameters of identification? Plugins?