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

ScrollToView function is not working when some conrols hidden under the header section.

3 Answers 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vairamuthu
Top achievements
Rank 1
Vairamuthu asked on 02 Nov 2012, 02:31 PM
Hi,

In my web application there is a standard header section. Since there are more controls the page is big. when i go the bottom of the page some of the controls are hidden under the header section. If i scroll back to top those controls are visible. 

But If i use scrolltoView function, the page is not scrolling to that control, but instead it click at the position where it is hidden.

How can i resolve that issue.

3 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 07 Nov 2012, 01:05 PM
Hello Vairamuthu,

What application you are testing is this HTML or Silverlihght. Could you provide us with a test so we can investigate further. One thing that comes to my mind if you are testing an HTML application is to set the property SimulateRealClick of the click step ,this will first bring the element into view by using a ScrollToVisible() function and then perform the click. Please check the screenshot attached on how to set the property.

Looking forward to hear from you.

All the best,
Ivaylo
the Telerik team
Are you enjoying Test Studio? We’d appreciate your vote in the ATI automation awards.
Vote now
0
Vairamuthu
Top achievements
Rank 1
answered on 07 Nov 2012, 02:01 PM
Hi,

My application is the html application.

I am not using the Test Studio. I am using the free automation framework provided by telerik.
SimulateRealClick is available only in the test studio. Please let me know how can I do the same via code using the framework.

I followed the below steps:
Control.ScrollToVisible(); --> This moves the focus to some other location where control is not visible. If I use control rectangle it's not at all scrolling anywhere.
control.MouseClick(); --> This action clicking on the area where it is hidden. E.g clicking on the taskbar, browser window title bar.

Thanks & Regards,
Vairamuthu


0
Ivaylo
Telerik team
answered on 12 Nov 2012, 11:40 AM
Hello Vairamuthu,

Thank you for your clarification.
I have tested the ScrollToVisible method in a html website and I was not able to reproduce this behavior. I have used a public accessible website http://www.w3schools.com/. Here is a short video on how this is working on my end. I am providing you the code for your reference below:

HtmlAnchor link = Find.ByContent<HtmlAnchor>("Forum");
link.ScrollToVisible();
//link.MouseClick();
System.Threading.Thread.Sleep(2000);
 
HtmlAnchor link2 = Find.ByContent<HtmlAnchor>("Learn HTML");
link2.ScrollToVisible();
link2.MouseClick();

It seems that this malfunctioning is connected to something specific in your application. In order to investigate further we will need a local reproduction. Could you please provide access to your application and the code you are using. In case your application is not public available you can provide us with a fiddler trace. In case you would like to provide fiddler trace you can use FiddlerCap.

Kind regards,
Ivaylo
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Vairamuthu
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Vairamuthu
Top achievements
Rank 1
Share this question
or