Forum Discussion

tmahender12's avatar
tmahender12
Frequent Contributor
8 years ago
Solved

Scroll a Panel

how to scroll atached panel using Name mapping. can u please help

  • Simply call object.scrollIntoView(true) right before you interact with whatever object is.  

7 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    FYI TestComplete scrolls web pages automatically before interacting with objects that are out of view. So, say, if you have obj.Click() and obj is currently out of view, TestComplete will automatically bring it into view and there's no need to scroll the page explicitly.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      I would contradict HKosova rarely... but this is one case. :) 

      If it's the whole page, TestComplete does things very well.  However, if it's a scroll bar in a panel on the page where, you need to make an explicit call to make sure that the sub-panel scrolls since the whole page will not.

      • tsan123's avatar
        tsan123
        Occasional Contributor

        You make Sense robert. Could some one explain how to use scrollintoview in this scenario.

  • shankar_r's avatar
    shankar_r
    Community Hero

    First of all, you have capture the navigation pane into your namemapping.

     

    For ex:

     

    you have mapped the navigation pane as ObjectNav then you can use below code scroll up and scroll down

     

    ObjectNav.Position = ObjectNav.Max

    ObjectNav.Position = ObjectNav.Min

    ObjectNav.Position = ObjectNav.Position + 100

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      You probably don't need to scroll the panel necessarily.  If you want to access a particular object that is currently scrolled out of view, call "scrollIntoView" on that object and that should bring it into view for being able to operate.