This is a migrated thread and some comments may be shown as answers.

Selecting a tree node not visible in the current scrollview

3 Answers 155 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 04 Oct 2011, 04:00 PM
Hi,

I am trying to test the Silverlight toolkit samples application http://www.silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html and wish to click the last leaf node on the last treeitem of the treeview on the left hand side of the page. (this is the WrapPanel node under Toolkit)

Unless the node is in the visible scrollview , the tool is not able to click on the application. Is there a way by which the tool can automatically do this without having the need to scroll?  When a treeview has a dynamic size and one doesnt know where in the scrollview the treenode to be clicked on can be , I would consider an out-of-the-box feature such as this to be a valuable one to have.

Regards,
Rahul

3 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 04 Oct 2011, 05:55 PM
Hello Rahul,

Unfortunately, unlike plain HTML applications, Silverlight and WPF applications do not allow Test Studio, or any other external application, to inject mouse and keyboard events directly into the DOM. Test Studio must simulate desktop mouse moves, clicks, and key presses instead as if a real user had clicked the mouse. Thus the element must be visible for a desktop mouse click to be simulated on it.

For your dynamic example, you'll have to scroll the desired element into view (the WrapPanel node) and then click on it. Fortunately Test Studio has built-in Scroll To Visible functionality on all it's actions. Thus all you should need to do is record clicking on the node and, during playback, Test Studio will automatically scroll it into view then perform the desktop mouse click on the element.

Kind regards,
Anthony
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rahul
Top achievements
Rank 1
answered on 05 Oct 2011, 03:49 PM
I did the following
- For recording a click on  a treenode in the Silverlight toolkit samples application http://www.silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html which wasnt visible in the scrollview, I first scrolled down to it to make it visible
- I then clicked on it
- The test had so far recorded 2 steps . One for the scrollbar drag, one for the click. I removed the scrollbar drag step so that I just had one step now of clicking the treenode.
- I then played back the test several times but it consistently failed.

It seems that the built-in Scroll to Visible functionality that you mentioned is not working. I hope I understood you correctly.

Attached is a copy of my recorded test

Regards,
Rahul

0
Anthony
Telerik team
answered on 05 Oct 2011, 06:24 PM
Hi Rahul,

It seems you've stumbled upon a bug with what I believe to be Test Studio's generic Silverlight translators. I logged a bug report and you can find the PITS Issue here: Public URL.

To demonstrate how this should function, I tested the built-in Scroll to Visible functionality on a Telerik Silverlight RadTreeViewItem control and it worked as expected:

1. Navigate to http://demos.telerik.com/silverlight/#TreeView/LoadOnDemand
2. Expand "Confections" radtreeveiwitem
3. Drag scroll bar to bottom
4. Select "Scottish Longbreads" radtreeviewitem

I disabled step 3 and Test Studio automatically scrolled the element in step 4 to visible before selecting it.

For now you'll have to enable the "scrollbar drag" step to retain successful test execution.

All the best,
Anthony
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Rahul
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Rahul
Top achievements
Rank 1
Share this question
or