0

I've a page which has list of messages say for example 20 messages and I am able to view only 4 at a time then I need to scroll down. If I use normal scrolling methods, it will scroll the page but I want to scroll the messages.

2

1 Answer 1

1

I have a suggestion - if messages are open after double click you can click at the first once and then switch by sending Key.ARROW_DOWN. Something like that:

firstMessage.click();
int i = 0;
while (i < 20) {
firstMessage.sendKeys(Keys.ARROW_DOWN);
i++;
}

Or you can tru to use JS for scrolling by pixels:

new Actions(driver).moveToElement(webelement).clickAndHold().moveByOffset(0, valueOfPixelsToScroll).release(webelement).build().perform();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.