Test clicks fixed header instead of element

4 posts, 1 answers
  1. Jennifer
    Jennifer avatar
    11 posts
    Member since:
    Sep 2016

    Posted 15 Sep Link to this post

    When a page has a fixed header, the click element step does not work. The browser scrolls the element to the top of the viewport, behind the fixed header, and the mouse click occurs on an element in the fixed header. I have attached a sample test for a public site with a fixed header.
  2. Answer
    Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    81 posts

    Posted 16 Sep Link to this post

    Hello Jennifer,

    Thank you for your feedback and for the project.

    The work around in this case is to convert the "Click" step into code and to comment the line containing ScrollToVisible in the code (it is usually the middle line as shown at the attached screenshot). 

    Let me know if this works for you.

    Regards,
    Nikolay Petrov
    Telerik by Progress
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Jennifer
    Jennifer avatar
    11 posts
    Member since:
    Sep 2016

    Posted 19 Sep in reply to Nikolay Petrov Link to this post

    The Edit In Code workaround worked. Is there any way to remove the ScrollToVisible by default when working with a site with a fixed header? It would be nice not to have to edit in code on each text or click step. Alternatively, maybe it could be added as a checkbox option in the step.
  4. Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    81 posts

    Posted 22 Sep Link to this post

    Hello Jennifer,

    There is no way to remove generally this option because it is a pro-active action. The ScrollToVisible is performed if you use option SimulateRealClick from the "Click" step properties. If you don't use this option it is not performed.

    The problem in this case will be if you'll need this action despite the fixed header. Then you have to change the the scroll to be not to the top of the page but to its bottom.
    Pages.TheCanterburyDictionaryOf.SubscribeLink.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementBottomAtWindowBottom);

    I hope this explanation is helpful.

    Regards,
    Nikolay Petrov
    Telerik by Progress
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top