Forum Discussion

Nick_Bradley's avatar
Nick_Bradley
New Member
3 days ago

Locating browser mapped objects currently off screen?

Hello,

What is the best way to get a mapped object on screen if they are either further down or up a webpage?

I'm using Keyword tests to test multiple webpages for the same information but the layouts are different.

Thank you

5 Replies

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    Providing the object appears in the Object Browser, and the action you want to perform - if performing a Click action, TestComplete will automatically scroll down the web page (start from top of page),

    VisibleOnScreen = false.

    until the VisibleOnScreen property becomes true, and then perform the Click action.

    TestComplete will automatically scroll down, until VisibleOnScreen = true

    You could also implement your own function (which can be called from your Keyword Test), and call scrollIntoView() on the object - providing web element has that method.

     

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Icon for Champion Level 3 rankChampion Level 3

    If this is a lazy load page (items only load when page is crolled) you first you need to scroll the page all the way down to load all items and be available in the Browser DOM.

    Before interacting with the element in question it needs to be visible on the screen and you need to call the ScrollIntoView() method.

    ๐Ÿ‘ Found it helpful? Click Like
    โœ… Issue resolved? Click Mark as Solution

  • scot1967's avatar
    scot1967
    Icon for Champion Level 3 rankChampion Level 3

    Hello Nick,

    The best bet is to use 'Call Object Method' on the scrollbar objects on your web page wVScrollBar and wHScrollBar.  There are methods on these objects to move the scrollbar.  Another way could be to use key combos.  You may want to use both ways to fully check it in the way a user would interact with it.

    ... If you find my posts helpful drop me a like! ๐Ÿ‘ Be sure to mark or post the solution to help others out and to credit the one who helped you. ๐Ÿ˜Ž