Forum Discussion

acm's avatar
acm
Contributor
7 years ago
Solved

Clicking on web elements that are displayed after PageDown

Hello,

 

I have recorded a Keyword Test to click on web elements that appear/load after scrolling down the page, i.e. execute subsequent clicks on checkbox/radio button after PageDown keystrokes.

 

Is there a way to click on web elements without scrolling down or waiting for them to be viewable in the window?

 

 

 

 

 

 

 

 

 

 

(Screenshot is also attached below.)

 

Thanks in advance for any feedback.

 

Arlene

 

  • Generally speaking, for the most part, you don't need the "page down" keystrokes.  When executing web based tests, TestComplete automatically scrolls controls into view to click on them.

     

    There are rare occasions, especially if it's a scrolling panel within a page, where this doesn't always work.  What I do in those cases is call the "scrollIntoView" method on the object that I want to pull to the top of the page.  That method takes a parameter.  Simply set that parameter to "true" and that should do what you want.

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Generally speaking, for the most part, you don't need the "page down" keystrokes.  When executing web based tests, TestComplete automatically scrolls controls into view to click on them.

     

    There are rare occasions, especially if it's a scrolling panel within a page, where this doesn't always work.  What I do in those cases is call the "scrollIntoView" method on the object that I want to pull to the top of the page.  That method takes a parameter.  Simply set that parameter to "true" and that should do what you want.