Adapter.Find<T>() Method on TableTag in Internet Explorer

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Patrick Hollerbach
Posts: 21
Joined: Thu Jan 02, 2014 4:00 pm

Adapter.Find<T>() Method on TableTag in Internet Explorer

Post by Patrick Hollerbach » Tue Feb 23, 2016 9:43 am

Hi there,

I have an unexpected result when using the Adapter.Find<T>() Method on a TableTag_Element in Internet Explorer.

My testcase: I have to count all tr-elements with a specific class-attribute.


I created following usercode:

Code: Select all

public void findTableEntries()
{
	// Path to foooo: /dom[@caption='Table Test']//tabletag[#'foooo']
        var foooo = repo.TableTest.Foooo;
	IList<TrTag> trs = foooo.Find<TrTag>("//tr[@class='tableBody']");
	Report.Info(trs.Count.ToString());
}
This code works fine in Chrome Browser (trs.Count == 4 for attached example html file).
When using Internet Explorer, 8 elements are found.
When I search for //tr[@class='tableBody'] in Ranorex Spy, I find only the expected 4 elements.
I tried Host.Local.Find with the whole path, and it finds the expected count of TrTag-elements.

Is this a Bug in IE or in Ranorex?
I attached a sample html file.

Best regards
Patrick
Attachments
tableTest.zip
Sample Html-File
(470 Bytes) Downloaded 37 times

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

Re: Adapter.Find<T>() Method on TableTag in Internet Explorer

Post by odklizec » Tue Feb 23, 2016 10:13 am

Hi,

Try to change this line:

Code: Select all

IList<TrTag> trs = foooo.Find<TrTag>("//tr[@class='tableBody']");
to this:

Code: Select all

IList<TrTag> trs = foooo.Find<TrTag>(".//tr[@class='tableBody']");
At least it works for me in IE11 and Ranorex 5.4.5. What version of Ranorex do you use?
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

Patrick Hollerbach
Posts: 21
Joined: Thu Jan 02, 2014 4:00 pm

Re: Adapter.Find<T>() Method on TableTag in Internet Explorer

Post by Patrick Hollerbach » Tue Feb 23, 2016 10:33 am

Hi odklizec,

thanks for your reply.

I'm using Ranorex 5.4.3.

I tested it with a "." at the beginning of the path an it works!
Thank you!

best Regards
Patrick

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

Re: Adapter.Find<T>() Method on TableTag in Internet Explorer

Post by odklizec » Tue Feb 23, 2016 10:43 am

Nice to hear that. Some long time ago, I struggled with similar Find-related issue and I was told by support, that there must be used '.' in front of the searched path, which starts with '/' character.

Anyway, I'm curious why it returned '8' if you searched the TrTags without '.' in searched xpath? When I tried your code, Ranorex just stuck at search, until I stopped it manually?
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

Patrick Hollerbach
Posts: 21
Joined: Thu Jan 02, 2014 4:00 pm

Re: Adapter.Find<T>() Method on TableTag in Internet Explorer

Post by Patrick Hollerbach » Tue Feb 23, 2016 12:13 pm

Hi,

yes, it was very slow while finding the elements with my code. I was patient and waited until Ranorex finished ;-)

Regards
Patrick

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Adapter.Find<T>() Method on TableTag in Internet Explorer

Post by Support Team » Tue Feb 23, 2016 1:04 pm

Searching an RxPath with "//" at the beginning without the initial "." means you search all elements (including all children and descendants) from the very root. So you will find all(!) TrTag elements currently available on the desktop, from all open applications.

Using the "." at the beginning tells Ranorex to search on relatively to the specified element you invoke the Find method on.

Regards,
Alex
Ranorex Team
.
Image