Page 1 of 1

Double tree nodes in DOM

Posted: Wed Jul 26, 2017 10:14 am
by arutscheidt
Hello everybody,

I'm writing tests for the ETS5 Programm (proprietary KNX tool) and having problems with the DOM.

As you can see in the screenshot I have the same node two times. Even if I use an index in the path it will detect two identical nodes.

Inside the nodes are lists of elements (Buttons, TreeItems,...). Now I want to iterate over these element lists and do something.

If I search for these elements I will get them twice, too. So I have to use List.Distinct() and implement an IEqualityComparer for every list to get only one element each for the iteration.

Because the double nodes are so high in the hierarchy I have to handle that very often.
Search operations cost very much time and thwart my tests.

The only option I found is to use the ChildIndex Property, because this is constant. But it dosn't seem to work or I am too dumb?

Are ther any other options?

Is it a Ranorex error or ETS5 ?

Thx in advance

Re: Double tree nodes in DOM

Posted: Wed Jul 26, 2017 10:45 am
by RobinHood42
Hi arutscheidt,

Reg. your signature: "Using Ranorex Studio 5.3.2" - I guess this needs to be updated :lol:

Reg. the snapshot, I would recommend restoring all Rx settings and also maybe performing a clean re-install of Rx Studio. The snapshot works fine for me:
doubletreenodes.png
Cheers,
Robin 8)

Re: Double tree nodes in DOM

Posted: Wed Jul 26, 2017 10:50 am
by arutscheidt
Ah yeah... using 7.1 is correct :-)

I'll try and post again. Thanx Robin.

Re: Double tree nodes in DOM

Posted: Wed Jul 26, 2017 10:56 am
by odklizec
Robin, the reason why you see just one tablist is the index at the end of xpath ;) Remove it and you will see everything under WorkspaceDocking list doubled.

I think it's actually a bug in the AUT? I would suggest to examine the AUT with MS Inspect tool. If Inspect shows the controls doubled too, then the problem is most probably in the AUT itself.

Re: Double tree nodes in DOM

Posted: Wed Jul 26, 2017 11:22 am
by RobinHood42
Hi odklizec,
Robin, the reason why you see just one tablist is the index at the end of xpath ;) Remove it and you will see everything under WorkspaceDocking list doubled.
The point from arutscheidt was, that he sees the duplicate entries, even when he's using the index (See picture from initial post)
I think it's actually a bug in the AUT? I would suggest to examine the AUT with MS Inspect tool. If Inspect shows the controls doubled too, then the problem is most probably in the AUT itself.
I agree with that :)

Cheers,
Robin

Re: Double tree nodes in DOM

Posted: Wed Jul 26, 2017 12:03 pm
by odklizec
RobinHood42 wrote:Hi odklizec,
Robin, the reason why you see just one tablist is the index at the end of xpath ;) Remove it and you will see everything under WorkspaceDocking list doubled.
The point from arutscheidt was, that he sees the duplicate entries, even when he's using the index (See picture from initial post)
Mea culpa! I missed the part about indexes ;)
Now looking att he screenshot form the original post, it's really weird. The info in status bar says that there was just one element found, but Spy actually shows two tabpagelists? So this alone could very well be a Ranorex 5.x bug? Something indexes-related? Anyway, doubled controls are most probably an AUT issue.

Re: Double tree nodes in DOM

Posted: Wed Jul 26, 2017 12:19 pm
by arutscheidt
Hello all,

I've got news but no solution.

I reinstalled Ranorex 7.1 -> still double entries.
Ranorex 7.0.1 on another machine -> the same

I inspected the app with Snoop (CodePlex). The tree in Snoop is ok. Only single entries.

Maybe Ranorex has a bug? It shows doubles in Spy and cannot distinct under test, but the snapshot function is working fine? I downloaded the snap here again and opened it:

Without the SUT open, I have the same like RobinHood and can even distinct with index 1-4. The snap seems to be correct. But when opening the app and the "real" Spy... same behavior.

Maybe you are interested in testing with SUT. It can be downloaded here (https://my.knx.org/) with a demo version, but you have to register.
In it create and open a project. The double nodes are underneath th toolbars in the main area

Re: Double tree nodes in DOM

Posted: Wed Jul 26, 2017 2:12 pm
by Support Team
Hello all,

RobinHood42 reported the behavoir to us and it seems to be a bug within Ranorex 7.1.

Currently, we do not know if and when a bug fix will be implemented. This depends on various factors. Nevertheless, all reported bugs and feature requests are documented in the release notes, with every new version release of Ranorex.

As a workaround, we suggest using our UIA plugin which seems to work flawlessly:
WPFSettings.png
Please note that the UIA plugin is not compatible with the WPF plugins

Thank you for your understanding.

Sincerely,
Robert

Re: Double tree nodes in DOM

Posted: Wed Jul 26, 2017 2:44 pm
by arutscheidt
Oh nooo, so I have to rebuild two repositories.

Ok, thanks anyway. I'll look forward to the fix. For now I try the solution with the Distinct()-Method.

If there is time I'll build a second bunch of repos.

Thank you all for help.

Re: Double tree nodes in DOM

Posted: Wed Jul 26, 2017 2:51 pm
by arutscheidt
Last question:

What will be the future technology for recognition?

Will WPF be the state of the art? or the UI thing?

So I can decide which one I will actively develop and which I use for workarounds.

Thx in advance.

Sincerely,

A. Rutscheidt

Re: Double tree nodes in DOM

Posted: Thu Jul 27, 2017 9:39 am
by Support Team
Hello A. Rutscheidt,

To be honest, it highly depends on the application under test.

The UIA plugin relies on the actual UI Automation implementation of the AUT. This accessibility framework provides access to the WPF UI.

The WPFImproved plugin does not rely on this accessibility framework, but rather directly fetches elements from the AUT. This also allows to get elements, which do not have a UIA implementation (no automation peer).

The UIA implementation of your AUT seems pretty good. So, if you can get all elements with UIA, I would currently stick to that plugin.

Further reading on UI Automation: UI Automation Overview

I hope this helps.

Sincerely,
Robert