Question

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?

Était-ce utile?

La solution

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

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top