Page 1 of 1

different mapping of the same web element in Chrome

Posted: Fri Jul 31, 2015 12:22 am
by c676228
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

Re: different mapping of the same web element in Chrome

Posted: Fri Jul 31, 2015 7:25 am
by odklizec
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

Re: different mapping of the same web element in Chrome

Posted: Mon Aug 03, 2015 5:43 pm
by c676228
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

Re: different mapping of the same web element in Chrome

Posted: Mon Aug 03, 2015 5:58 pm
by krstcs
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.

Re: different mapping of the same web element in Chrome

Posted: Mon Aug 24, 2015 3:36 pm
by Speedboat
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

Re: different mapping of the same web element in Chrome

Posted: Mon Aug 24, 2015 3:42 pm
by krstcs
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.

Re: different mapping of the same web element in Chrome

Posted: Wed Aug 26, 2015 5:46 pm
by c676228
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

Re: different mapping of the same web element in Chrome

Posted: Wed Aug 26, 2015 6:08 pm
by krstcs
Just change the XPath for any buttontag objects to explicitly use 'buttontag[]' instead of 'button[]'.

Re: different mapping of the same web element in Chrome

Posted: Wed Aug 26, 2015 9:15 pm
by c676228
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

Re: different mapping of the same web element in Chrome

Posted: Thu Aug 27, 2015 2:45 pm
by krstcs
Yeah, I would send it to Ranorex.