different mapping of the same web element in Chrome

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

different mapping of the same web element in Chrome

Post by c676228 » Fri Jul 31, 2015 12:22 am

Hi,

It seems to be a bug. I only see this in Chrome. But when I use Firefox. The mapping is right.
Here is the story.
I have the following web element.
<button class="icon-search" data-bind="css: $parent.iconSearch, click:$parent.search"></button>
Two months ago, it was mapped to ButtonTag. It can be recognized in Spy and runtime. No problem.

Today, I remapped for the same element in Chrome. However, it is mapped to"Button" in the screenshot area of the repository item. However it displays it as "ButtonTag" in the properties. It can be recognized in Spy, no problem at all. However, during runtime, I got the following error:
GroupSearch.IconSearch' is no Button.
The element does not support the required capability 'button'.

The I use Firefox to remapped the same element. It is consistent as before.

This Chrome 44.
Ranorex 5.4

thanks,
Betty

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

Re: different mapping of the same web element in Chrome

Post by odklizec » Fri Jul 31, 2015 7:25 am

Hi,

Any chance to post the Ranorex Snapshot showing the button both in FF and Chrome? Snapshots is often worth a thousands words ;)

Also, what's the xpath behind the button? Is it the same if you track it both in Chrome and FF? It does not matter what's the element name, what matters is the xpath. I tried your provided HTML code and the tracked xpath is (both in FF and Chrome) like this...
.//iframe[#'iframeResult']/body/button
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

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: different mapping of the same web element in Chrome

Post by c676228 » Mon Aug 03, 2015 5:43 pm

Hi Pavel,

Yes, the xpaths are the exactly same. I do think it does matter what object it is mapped to.
The capability for Button and ButtonTag are different. That's why the error "GroupSearch.IconSearch' is no Button.
The element does not support the required capability 'button'. presents.

Next time if I encounter the similar issue. I will get Ranorex snapshot.

Thanks,
Betty

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: different mapping of the same web element in Chrome

Post by krstcs » Mon Aug 03, 2015 5:58 pm

So, there were some changes made in a previous version (like 3.3 or something) that allow buttontag elements to be use button as an alias, and, for the most part, it worked. But, there are times when the alias doesn't work and thinks that the buttontag should be treated as a button.

This is probably a case of something in the back-end getting updated for 5.4/5.3.3, but causing a regression in this case that didn't get tested correctly before release.

Your best bet would be to force all buttontag elements to use buttontag in the XPath/properties.
Shortcuts usually aren't...

Speedboat
Certified Professional
Certified Professional
Posts: 31
Joined: Wed Mar 25, 2015 4:44 pm
Location: Switzerland

Re: different mapping of the same web element in Chrome

Post by Speedboat » Mon Aug 24, 2015 3:36 pm

Hi Betty

"The element does not support the required capability 'button'"
I had the same message on some buttons (Web Technology was Angular JS) and the button was not found with either browser. I replaced 'button' by 'unknown' in the RXPath

eg:
//button[@innertext='NameOfButton']

after replacing button by unknown it worked fine:
//unknown[@innertext='NameOfButton']

Hope this helps
Hugo

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: different mapping of the same web element in Chrome

Post by krstcs » Mon Aug 24, 2015 3:42 pm

The problem with using Unknown is that the Unknown object does not have the same set of capabilities as a ButtonTag object, so there could be a loss of functionality.

You should probably not use Unknown for elements where a better mapping is available, such as this case where ButtonTag is more appropriate.
Shortcuts usually aren't...

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: different mapping of the same web element in Chrome

Post by c676228 » Wed Aug 26, 2015 5:46 pm

Thanks for all your input.

Krstcs,
Can you explain a bit more for
"Your best bet would be to force all buttontag elements to use buttontag in the XPath/properties."?

Thanks,
Betty

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: different mapping of the same web element in Chrome

Post by krstcs » Wed Aug 26, 2015 6:08 pm

Just change the XPath for any buttontag objects to explicitly use 'buttontag[]' instead of 'button[]'.
Shortcuts usually aren't...

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: different mapping of the same web element in Chrome

Post by c676228 » Wed Aug 26, 2015 9:15 pm

Well, this won't work. I usually use explicit type.
Like today, I got the similar issue with Table with runtime error:
" UserTable is no Table.
The element does not support the required capability 'table'."

Actually I created the repo item directly in the repository with an xpath like ".//div[@id='something']/table
Ranorex shows Table in repository in the screenshot area. However if I open the item property, it shows TableTag, it also shows TableTag in Ranorex Spy. It can be identified in Ranorex Spy. But at run time, it throws an exception.

What I do to get around is not mapping to table, but to tbody beneath it in the html
.//div[@id='something']/table/tbody.

I am not sure if I need to report the bug. I can send the snapshot to Ranorex if I need to.

Thanks,
Betty

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: different mapping of the same web element in Chrome

Post by krstcs » Thu Aug 27, 2015 2:45 pm

Yeah, I would send it to Ranorex.
Shortcuts usually aren't...