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

4 posts, 0 answers
  1. Vairamuthu
    Vairamuthu avatar
    2 posts
    Member since:
    Oct 2012

    Posted 02 Nov 2012 Link to this post

    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.
  2. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 07 Nov 2012 Link to this post

    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
  3. Vairamuthu
    Vairamuthu avatar
    2 posts
    Member since:
    Oct 2012

    Posted 07 Nov 2012 Link to this post

    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


  4. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 12 Nov 2012 Link to this post

    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
Back to Top