{"action":"created","issue":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1202","labels_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1202/labels{/name}","comments_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1202/comments","events_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1202/events","html_url":"https://github.com/SeleniumHQ/selenium/issues/1202","id":113884315,"number":1202,"title":"Click button does not work after upgrade to selenium 2.48.0","user":{"login":"Tset-Noitamotua","id":5635462,"avatar_url":"https://avatars.githubusercontent.com/u/5635462?v=3","gravatar_id":"","url":"https://api.github.com/users/Tset-Noitamotua","html_url":"https://github.com/Tset-Noitamotua","followers_url":"https://api.github.com/users/Tset-Noitamotua/followers","following_url":"https://api.github.com/users/Tset-Noitamotua/following{/other_user}","gists_url":"https://api.github.com/users/Tset-Noitamotua/gists{/gist_id}","starred_url":"https://api.github.com/users/Tset-Noitamotua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tset-Noitamotua/subscriptions","organizations_url":"https://api.github.com/users/Tset-Noitamotua/orgs","repos_url":"https://api.github.com/users/Tset-Noitamotua/repos","events_url":"https://api.github.com/users/Tset-Noitamotua/events{/privacy}","received_events_url":"https://api.github.com/users/Tset-Noitamotua/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SeleniumHQ/selenium/labels/D-firefox","name":"D-firefox","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":49,"created_at":"2015-10-28T18:00:44Z","updated_at":"2016-01-20T10:22:47Z","closed_at":null,"body":"Doing test automation on a Ember.js web application:\r\nI have a button which is covered by a `<div>` with a cooky notification. It looks something like this:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5635462/10795869/fa412dfa-7d9b-11e5-9f84-2ecfc214e2e6.png)\r\n\r\nWith **Selenium 2.47.1** clicking on that button works as expected in Firefox.\r\nWith **Selenium 2.48.0** clicking this button does not work in Firefox, although there is no exception or error. It's like selenium thinks that the click worked properly but actually the click had no effect. Here the Robot Framework log:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5635462/10796560/fd4b41ea-7d9e-11e5-89c3-d5e8309424fc.png)\r\n\r\nThe structure of HTML is something like this:\r\n\r\n```html\r\n<header>...</header>\r\n<main>\r\n  <div>\r\n    ::before\r\n    <form>\r\n      <button>Last check</button>\r\n    </form>\r\n  ::after\r\n  </div>\r\n</main>\r\n<div>\r\n  <div class=\"cookie-notification\">\r\n    ::before\r\n    <a href=\"http://...\">Close</a>\r\n    ::after\r\n  </div>\r\n</div>\r\n```\r\n\r\nJust for comparison - executing the same click with **Selenium 2.47.1** in Chrome results in a WebDriverException:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5635462/10797758/6650ed48-7da4-11e5-80a6-82b7ac58de40.png)\r\n\r\n\r\n```stacktrace\r\nTraceback (most recent call last):\r\n  File \"<string>\", line 2, in click_button\r\n  File \"C:\\Python27\\lib\\site-packages\\Selenium2Library\\keywords\\keywordgroup.py\", line 15, in _run_on_failure_decorator\r\n    return method(*args, **kwargs)\r\n  File \"C:\\Python27\\lib\\site-packages\\Selenium2Library\\keywords\\_formelement.py\", line 316, in click_button\r\n    element.click()\r\n  File \"C:\\Python27\\lib\\site-packages\\selenium\\webdriver\\remote\\webelement.py\", line 69, in click\r\n    self._execute(Command.CLICK_ELEMENT)\r\n  File \"C:\\Python27\\lib\\site-packages\\selenium\\webdriver\\remote\\webelement.py\", line 448, in _execute\r\n    return self._parent.execute(command, params)\r\n  File \"C:\\Python27\\lib\\site-packages\\Selenium2Library\\webdrivermonkeypatches.py\", line 11, in execute\r\n    result = self._base_execute(driver_command, params)\r\n  File \"C:\\Python27\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py\", line 196, in execute\r\n    self.error_handler.check_response(response)\r\n  File \"C:\\Python27\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py\", line 181, in check_response\r\n    raise exception_class(message, screen, stacktrace)\r\n```\r\n\r\nSystem configuration I:\r\n- Microsoft Windows 7 64 bit\r\n- Firefox 41.0.2\r\n- **Selenium 2.47.1**\r\n- selenium2library 1.7.4\r\n- Robot Framework 2.9.2\r\n==> click `<button>`  works\r\n\r\nSystem configuration II:\r\n- same as configuration I but\r\n- Google Ghrome Version 46.0.2490.80 m\r\n==> click `<button>` does not work, WebDriverException\r\n\r\nSystem configuration III:\r\n- same as configuration I but\r\n- **Selenium 2.48.0**\r\n==> click `<button>` does not work, no error/exception\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/comments/173161750","html_url":"https://github.com/SeleniumHQ/selenium/issues/1202#issuecomment-173161750","issue_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1202","id":173161750,"user":{"login":"jimevans","id":352840,"avatar_url":"https://avatars.githubusercontent.com/u/352840?v=3","gravatar_id":"","url":"https://api.github.com/users/jimevans","html_url":"https://github.com/jimevans","followers_url":"https://api.github.com/users/jimevans/followers","following_url":"https://api.github.com/users/jimevans/following{/other_user}","gists_url":"https://api.github.com/users/jimevans/gists{/gist_id}","starred_url":"https://api.github.com/users/jimevans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimevans/subscriptions","organizations_url":"https://api.github.com/users/jimevans/orgs","repos_url":"https://api.github.com/users/jimevans/repos","events_url":"https://api.github.com/users/jimevans/events{/privacy}","received_events_url":"https://api.github.com/users/jimevans/received_events","type":"User","site_admin":false},"created_at":"2016-01-20T10:22:47Z","updated_at":"2016-01-20T10:22:47Z","body":"A quick refresher course in element scrolling and the intent of the WebDriver API might be instructive. It is now, and always has been, the intent of the WebDriver API to mimic user interaction with a page as closely as possible. That means that if an element is obscured by another element, it can't be clicked on until it is (1) scrolled into the view port, and (2) scrolled to no longer be obscured by other elements.\r\n\r\nThe first condition is handled by most driver implementations by use of the JavaScript `scrollIntoView` function. This function aligns the scrolled element to either the top or bottom of the view port, depending on the value of a boolean argument. Because some modern sites have fixed header or footer elements that float atop the z-order, the driver gives you the option of which alignment to use via the `elementScrollBehavior` capability. Note carefully that the JavaScript `scrollIntoView` function does _not_ provide a mechanism for scrolling to the middle of the view port. It would be nice if it did so, but that's a matter for standards bodies and browser vendors. Anyone who would like to take a crack at an implementation that scrolls to the center is welcome to submit a pull request.\r\n\r\nAs for the change in behavior on click, modifying the Firefox driver in this way aligns its behavior with other drivers. In the case of the Chrome driver, the `click` method throws an exception if the target element is overlapped by another. The IE driver (when native events are enabled) will happily click on the topmost element, which is arguably worse. As of 2.49, the Firefox driver's behavior should now align with the Chrome implementation. Consistent behavior is better than inconsistent. The fact that in the past it was possible to click on an obscured element with the Firefox driver was unintended, and was a bug in the Firefox implementation, pure and simple."}}