how do I find the end of the scroll bar using Java in RFT

1.2k views Asked by At

My application has the web page, which is longer than the browser size. This needs the application shld be scrolled down to view the complete Web page. I need to know how do I find the end of the Web Page unsing Java in RFT code?

2

There are 2 answers

0
Alessandro Da Rugna On BEST ANSWER

Is there some special object in your page footer? Like an image or a particular link? You can continue to scroll down until it becomes visible.

This is some sample code using LowLevelEvents, scrolling down with the mousewheel instead of dragging the scrollbar:

while(!your_object.isVisible()) {
    LowLevelEvent llEvents[] = new LowLevelEvent[1];
    llEvents[0] = MouseWheel(-25)
    getRootTestObject().emitLowLevelEvent(llEvents);
}

Some docs: PlayingBackLowLevelMouseandKeyboardActions

0
Cagin Uludamar On

If your_object.isVisible() always returns true, you can click on an object at the end of the page; this will browse the page to its and.

If there is no object clickable, you can press "END" to scroll to the end. Use browserObject.inputKeys method for this.