Java web page scrolling with Robot Framework

1,541 views
Skip to first unread message

sami.sa...@q-factory.fi

unread,
Jun 6, 2017, 3:26:37 AM6/6/17
to robotframework-users
Moi,

I have searched in this group and also generally via google, how to scroll java page with Robot Framework. But i haven't been lucky so far.
I have tried to scroll down like this:

Execute JavaScript    window.scrollTo(0, 500)

But it doesn't work like this. 
When i try manually same, PageDown or ArrowDown keys are not working. 
After using application own refresh in web page, manually i can use PageDown or ArrowDown keys.
But using application own refresh with Robot, PageDown or ArrowDown keys are not working in that page.

What would be alternative ways to scroll page or how to activate page, that Robot could send scrolling commands to browser?

-Sami

Tatu Aalto

unread,
Jun 12, 2017, 2:13:34 AM6/12/17
to sami.sa...@q-factory.fi, robotframework-users
Ugh

Selenium will automatically try to focus on the element which it's performing interaction and therefore there should not be, usually, need to scroll to the element. Also I know that it's possible to build a web application in such way that selenium s rolling doesn't work or interaction will fail often. Unfortunately there is not a silver bullet which would solve the problem with all possible web applications. But usually using the Focus keyword has worked relatively well for me, but it's really hard to give good advice without an access to the application. If my problem has been hard to solve, then I usually talk with the developer and together we have been able to find a good solution to the problem.

-Tatu
Send from my mobile

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

sami.sa...@q-factory.fi

unread,
Oct 17, 2017, 3:57:33 AM10/17/17
to robotframework-users
Hi,

Focus works nicely in Windows environment and Docker in Windows 8.1 (Kinematic). But Focus keyword has problem in Docker+Ubuntu 16.04: 
Wait Until Element Is Visible    --> OK
Focus --> OK
Click Element --> Fails

So I assume, that problem is in Focus scrolling functionality with Chrome in Docker Ubuntu environment. That's why Click Element cannot work if element is no visible without scrolling page. 
Or is the problem in chromedriver in Ubuntu?
Browser env: Selenium 3.6.0+latest Chrome stable+latest chromedriver

Br
Sami
To post to this group, send email to robotframe...@googlegroups.com.

David

unread,
Oct 17, 2017, 8:01:47 PM10/17/17
to robotframework-users
Sami, can you clarify Docker in Windows 8.1? The host is Windows, but isn't the guest still docker running some flavor of Linux (Ubuntu/Alpine/etc.)? So it would sound like issue with docker on Ubuntu host but not docker (guest) environment itself, nor chromedriver, since chromedriver is paired with and runs natively on the docker container and not on the host? As connecting to remote machine is via RemoteWebDriver, not ChromeDriver.

sami.sa...@q-factory.fi

unread,
Oct 18, 2017, 12:05:35 AM10/18/17
to robotframework-users
Hi David,

I use Docker toolbpx in Windows 8.1 and yes it should contain some linux flavor, which is used via Virtualbox.

I have to double check the same Ubuntu docker and behavior with Firefox browser, is it the same behavior or not.

Br
Sami

keskiviikko 18. lokakuuta 2017 3.01.47 UTC+3 David kirjoitti:
> Sami, can you clarify Docker in Windows 8.1? The host is Windows, but isn't the guest still docker running some flavor of Linux (Ubuntu/Alpine/etc.)? So it would sound like issue with docker on Ubuntu host but not docker (guest) environment itself, nor chromedriver, since chromedriver is paired with and runs natively on the docker container and not on the host? As connecting to remote machine is via RemoteWebDriver, not ChromeDriver.
>
> On Tuesday, October 17, 2017 at 12:57:33 AM UTC-7, sami.sa...@q-factory.fi wrote:
> Hi,
>
>
> Focus works nicely in Windows environment and Docker in Windows 8.1 (Kinematic). But Focus keyword has problem in Docker+Ubuntu 16.04: 
> Wait Until Element Is Visible    --> OK
> Focus --> OK
> Click Element --> Fails
>
>
> So I assume, that problem is in Focus scrolling functionality with Chrome in Docker Ubuntu environment. That's why Click Element cannot work if element is no visible without scrolling page. 
> Or is the problem in chromedriver in Ubuntu?
> Browser env: Selenium 3.6.0+latest Chrome stable+latest chromedriver
>
>
> Br
> Sami
>
> maanantai 12. kesäkuuta 2017 9.13.34 UTC+3 Tatu Aalto kirjoitti:
> Ugh
>
>
> Selenium will automatically try to focus on the element which it's performing interaction and therefore there should not be, usually, need to scroll to the element. Also I know that it's possible to build a web application in such way that selenium s rolling doesn't work or interaction will fail often. Unfortunately there is not a silver bullet which would solve the problem with all possible web applications. But usually using the Focus keyword has worked relatively well for me, but it's really hard to give good advice without an access to the application. If my problem has been hard to solve, then I usually talk with the developer and together we have been able to find a good solution to the problem.
>
>
> -Tatu
> Send from my mobile
>
>
> On Jun 6, 2017 10:26 AM, <sami.sa...@q-factory.fi> wrote:
>
> Moi,
>
>
> I have searched in this group and also generally via google, how to scroll java page with Robot Framework. But i haven't been lucky so far.
> I have tried to scroll down like this:
>
> Execute JavaScript window.scrollTo(0, 500)
> But it doesn't work like this. When i try manually same, PageDown or ArrowDown keys are not working. After using application own refresh in web page, manually i can use PageDown or ArrowDown keys.But using application own refresh with Robot, PageDown or ArrowDown keys are not working in that page.
> What would be alternative ways to scroll page or how to activate page, that Robot could send scrolling commands to browser?
> -Sami
>
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "robotframework-users" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages