Selenium "Click Element" kw is not working correctly for some of button type html elements with IE webdriver

937 views
Skip to first unread message

Marko Hämäläinen

unread,
Jun 28, 2018, 7:15:52 AM6/28/18
to robotframework-users
Hello!

I have noticed that Click Element kw is not clicking to some button type of html elements if browser is defined as "Internet Explorer". Robot Framework tells that clicking was successful but it's not. Clicking is not done. Test case is following

Test
    Open Browser    https://www.varma.fi    ie
    Maximize Browser Window
    Wait Until Element Is Visible    //a[@class="button button-primary button-accept-cookies"]
    Click Element    //a[@class="button button-primary button-accept-cookies"]

Test case is opening "www.varma.fi" web address and it should click "Accept cookies" button just after browser window is maximized. RF tells that clicking was successful after the execution of TC. But it's not. "Accept cookies" pop-up window is still opened in the browser. Clicking works if running this TC by using Chrome browser. But not by using IE. Any idea what's the problem with IE webdriver? Is it possible to fix this somehow?



Used versions:

robotframework                 3.0.4
robotframework-seleniumlibrary 3.1.1
Internet Explorer 11
IEDriverServer 3.13.0.0  (32 bit)


Debug log:


20180628 14:11:53.854 :  INFO : Opening browser 'ie' to base url 'https://www.varma.fi'.
20180628 14:11:54.386 : DEBUG : POST http://127.0.0.1:49341/session {"capabilities": {"alwaysMatch": {"browserName": "internet explorer", "platformName": "windows"}, "firstMatch": [{}]}, "desiredCapabilities": {"platform": "WINDOWS", "browserName": "internet explorer", "version": ""}}
20180628 14:11:55.202 : DEBUG : Finished Request
20180628 14:11:55.202 : DEBUG : POST http://127.0.0.1:49341/session/89f27881-d7a5-484b-b091-e5d357514a88/timeouts {"script": 5000}
20180628 14:11:55.239 : DEBUG : Finished Request
20180628 14:11:55.239 : DEBUG : POST http://127.0.0.1:49341/session/89f27881-d7a5-484b-b091-e5d357514a88/timeouts {"implicit": 0}
20180628 14:11:55.255 : DEBUG : Finished Request
20180628 14:11:57.205 : DEBUG : Finished Request
20180628 14:11:57.205 : DEBUG : Opened browser with session id 89f27881-d7a5-484b-b091-e5d357514a88.
20180628 14:11:57.205 : DEBUG : POST http://127.0.0.1:49341/session/89f27881-d7a5-484b-b091-e5d357514a88/window/maximize {"windowHandle": "current"}
20180628 14:11:57.222 : DEBUG : Finished Request
20180628 14:11:57.224 : DEBUG : POST http://127.0.0.1:49341/session/89f27881-d7a5-484b-b091-e5d357514a88/elements {"using": "xpath", "value": "//a[@class=\"button button-primary button-accept-cookies\"]"}
20180628 14:11:57.318 : DEBUG : Finished Request
20180628 14:11:57.319 : DEBUG : GET http://127.0.0.1:49341/session/89f27881-d7a5-484b-b091-e5d357514a88/element/9333396c-a96e-456e-9d93-a66093772281/displayed {"id": "9333396c-a96e-456e-9d93-a66093772281"}
20180628 14:11:57.371 : DEBUG : Finished Request
20180628 14:11:57.371 :  INFO : Clicking element '//a[@class="button button-primary button-accept-cookies"]'.
20180628 14:11:57.371 : DEBUG : POST http://127.0.0.1:49341/session/89f27881-d7a5-484b-b091-e5d357514a88/elements {"using": "xpath", "value": "//a[@class=\"button button-primary button-accept-cookies\"]"}
20180628 14:11:57.440 : DEBUG : Finished Request
20180628 14:11:57.440 : DEBUG : POST http://127.0.0.1:49341/session/89f27881-d7a5-484b-b091-e5d357514a88/element/9333396c-a96e-456e-9d93-a66093772281/click {"id": "9333396c-a96e-456e-9d93-a66093772281"}
20180628 14:11:57.818 : DEBUG : Finished Request

Regards and thanks,

Marko H

Hélio Guilherme

unread,
Jun 28, 2018, 9:30:09 AM6/28/18
to robotframework-users
It worked fine here. After clicking the first time, then there is no cookies dialog and fails with element not visible.

Tatu Aalto

unread,
Jun 28, 2018, 4:57:37 PM6/28/18
to Hélio Guilherme, robotframework-users
Ugh

Well, works with my machine or does not work in this case is actually quite typical problem. Which usually is a timing issue. There is an easy way to try is this a timing issue, put long sleep (like in 60 seconds) before the click and see does it work then. If it works then, then there is timing problem and waiting element to become visible is not enough. Perhaps you should then wait for something else, which I don't know what it could be.

But if it doesn't work, then it might be issue with the Selenium, IEDriver or with the IE version you are using. Usually I would update Selenium and the driver to see that doesn it solve 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-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Marko Hämäläinen

unread,
Jun 29, 2018, 4:50:25 AM6/29/18
to robotframework-users
Yes. I have tried to add one minute sleep before "Wait and Click" steps. It has an effect. Negative effect - IE driver server was crashed when trying to make a click to "Accept cookies" button. IE driver server version should be the latest and also selenium library is updated. Looks like IE driver server is not so compatible with RF as Chrome Driver. 
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.

Tatu Aalto

unread,
Jun 29, 2018, 5:49:28 AM6/29/18
to Marko Hämäläinen, robotframework-users
Ugh

It would be best raise an issue to the Selenium issue tracker so that bug in the Selenium or in IEDriver gets fixed. For this issue, there is nothing to fix in the SeleniumLibrary or Robot Framework.


-Tatu
Send from my mobile

To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
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