2

Unable to perform scrolling in a webpage and windows using LeanFT lib.

Code works fine, but It doesn't perform any scroll action.

import com.hp.lft.sdk.ScrollOrientation;
import com.hp.lft.sdk.ScrollType;
import com.hp.lft.sdk.Scrollable;

public class Sample {
    Scrollable scrollTo;
public void scrollDownUsingNative() throws GeneralLeanFtException {
scrollTo.scroll(ScrollOrientation.VERTICAL_SCROLL, ScrollType.LAST);
    }      
}

its quiet difficult to understand, kindly provide an explanation with examples.

  • _"Unable to perform"_ is very vague. Are you seeing any kind of exception (which one)? Or does the code run successfully, but does not scroll as much as intended? Maybe it does not scroll at all? – Petr Janeček Jul 16 '18 at 12:13
  • Hi @PetrJaneček , I have updated the question with code explanation. I am not getting any exception, but the scroll action doesn't work. – RUDRA GANESH SUBBARAYULU Jul 16 '18 at 12:28

1 Answers1

2

Leanft provides Scrollbar class to work with scrollbars Leanft Java SDK Scrollbar. You can use it to scroll the window.

For web, you need to use javascript.

Sample code:

Scrollbar scroll; public void scrollPage() { scroll.nextLine(); }

Web

Dim jvs jvs="window.scrollBy(0, 100);" Browser("").Page("").RunScript(myjs)

PS: Do not forget to catch exceptions.