Forum Discussion

funmay's avatar
funmay
Contributor
7 years ago

How can i Scroll to view an element and click in TestComplete with Javascript?

How can i Scroll to view an element and click in TestComplete with Javascript for web testing? Does TestComplete supports this control(Scroll into view element ).   See the example of selenium code...
  • AlexKaras's avatar
    7 years ago

    Hi,

     

    Yes, scrollIntoView(true/false) is a native method that is supported by all browsers and can be used to scroll the element into view. Something like that:

    var element = page.FindChild(...);

    if (element.Exists)

    {

      element.scrollIntoView(true);

      element.click();

    }

     

    Update: ah, just noted that I duplicated reply from cunderw...