{"action":"created","issue":{"url":"https://api.github.com/repos/teampoltergeist/poltergeist/issues/520","labels_url":"https://api.github.com/repos/teampoltergeist/poltergeist/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/teampoltergeist/poltergeist/issues/520/comments","events_url":"https://api.github.com/repos/teampoltergeist/poltergeist/issues/520/events","html_url":"https://github.com/teampoltergeist/poltergeist/issues/520","id":39357777,"number":520,"title":"Scroll/click firing at wrong coordinates - Poltergeist detected another element with CSS selector '' at this position.","user":{"login":"sbull","id":1115369,"avatar_url":"https://avatars.githubusercontent.com/u/1115369?v=3","gravatar_id":"","url":"https://api.github.com/users/sbull","html_url":"https://github.com/sbull","followers_url":"https://api.github.com/users/sbull/followers","following_url":"https://api.github.com/users/sbull/following{/other_user}","gists_url":"https://api.github.com/users/sbull/gists{/gist_id}","starred_url":"https://api.github.com/users/sbull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbull/subscriptions","organizations_url":"https://api.github.com/users/sbull/orgs","repos_url":"https://api.github.com/users/sbull/repos","events_url":"https://api.github.com/users/sbull/events{/privacy}","received_events_url":"https://api.github.com/users/sbull/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2014-08-02T21:30:40Z","updated_at":"2015-08-12T20:18:01Z","closed_at":null,"body":"I've narrowed down a bug to what appears to be an issue with scrolling and clicking. Take the following:\r\n\r\n`public/bug.html`:\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n  <head></head>\r\n  <body>\r\n\r\n<div style=\"height:800px; width:100%; background-color:pink;\"></div>\r\n\r\n<a href=\"#\">\r\n  <div>CLICK HERE</div>\r\n</a>\r\n\r\n  </body>\r\n</html>\r\n```\r\n\r\n`spec/features/bug_spec.rb`:\r\n```ruby\r\nrequire 'spec_helper'\r\n\r\nfeature \"BUG\" do\r\n\r\n  scenario \"poltergeist scroll bug\" do\r\n    visit '/bug.html'\r\n    click_on \"CLICK HERE\"\r\n  end\r\n\r\n  scenario \"poltergeist resized\" do\r\n    visit '/bug.html'\r\n    page.driver.resize(786, 1024)\r\n    click_on \"CLICK HERE\"\r\n  end\r\n\r\nend\r\n```\r\n\r\n`spec/spec_helper.rb` is pretty standard, here are the relevant bits:\r\n```ruby\r\nrequire 'capybara/poltergeist'\r\nCapybara.default_driver = :poltergeist\r\n```\r\n\r\nAnd here's what I get when I run `rspec spec/features/bug_spec.rb`:\r\n```\r\nF.\r\n\r\nFailures:\r\n\r\n  1) BUG poltergeist scroll bug\r\n     Failure/Error: click_on \"CLICK HERE\"\r\n     Capybara::Poltergeist::MouseEventFailed:\r\n       Firing a click at co-ordinates [8, 788] failed. Poltergeist detected another element with CSS selector '' at this position. It may be overlapping the element you are trying to interact with. If you don't care about overlapping elements, try using node.trigger('click').\r\n     # ./spec/features/bug_spec.rb:7:in `block (2 levels) in <top (required)>'\r\n\r\nFinished in 4.83 seconds\r\n2 examples, 1 failure\r\n\r\nFailed examples:\r\n\r\nrspec ./spec/features/bug_spec.rb:5 # BUG poltergeist scroll bug\r\n\r\nRandomized with seed 10240\r\n```\r\n\r\nThe debug log doesn't add much info, just that the click at those coordinates is failing, but here it is (with `Capybara.default_wait_time = 0`):\r\n```\r\n{\"name\"=>\"set_debug\", \"args\"=>[true]}\r\n{\"response\"=>true}\r\n{\"name\"=>\"visit\", \"args\"=>[\"http://127.0.0.1:56227/bug.html\"]}\r\npoltergeist [1407014635392] state default -> loading\r\npoltergeist [1407014635450] state loading -> default\r\n{\"response\"=>{\"status\"=>\"success\"}}\r\n{\"name\"=>\"find\", \"args\"=>[:xpath, \".//a[./@href][(((./@id = 'CLICK HERE' or normalize-space(string(.)) = 'CLICK HERE') or ./@title = 'CLICK HERE') or .//img[./@alt = 'CLICK HERE'])] | .//input[./@type = 'submit' or ./@type = 'reset' or ./@type = 'image' or ./@type = 'button'][((./@id = 'CLICK HERE' or ./@value = 'CLICK HERE') or ./@title = 'CLICK HERE')] | .//input[./@type = 'image'][./@alt = 'CLICK HERE'] | .//button[(((./@id = 'CLICK HERE' or ./@value = 'CLICK HERE') or normalize-space(string(.)) = 'CLICK HERE') or ./@title = 'CLICK HERE')] | .//input[./@type = 'image'][./@alt = 'CLICK HERE']\"]}\r\n{\"response\"=>{\"page_id\"=>1, \"ids\"=>[0]}}\r\n{\"name\"=>\"visible\", \"args\"=>[1, 0]}\r\n{\"response\"=>true}\r\n{\"name\"=>\"tag_name\", \"args\"=>[1, 0]}\r\n{\"response\"=>\"A\"}\r\n{\"name\"=>\"click\", \"args\"=>[1, 0]}\r\npoltergeist [1407014635517] state default -> mouse_event\r\n{\"error\"=>{\"name\"=>\"Poltergeist.MouseEventFailed\", \"args\"=>[\"click\", nil, {\"x\"=>8, \"y\"=>788}]}}\r\n{\"name\"=>\"reset\", \"args\"=>[]}\r\npoltergeist [1407014635536] state mouse_event -> default\r\n{\"response\"=>true}\r\n{\"name\"=>\"find\", \"args\"=>[:xpath, \"/html/body/*\"]}\r\n{\"response\"=>{\"page_id\"=>1, \"ids\"=>[]}}\r\n```\r\n\r\nVersions:\r\npoltergeist 1.5.1 (capybara 2.2.1)\r\nphantomjs 1.9.7 (node v0.10.17)\r\nruby 2.0.0p353\r\nUbuntu 12.04, running headless in a virtual machine.\r\n\r\n(FYI: discovered this while working on https://github.com/sbull/capybara-paparazzi)"},"comment":{"url":"https://api.github.com/repos/teampoltergeist/poltergeist/issues/comments/130433215","html_url":"https://github.com/teampoltergeist/poltergeist/issues/520#issuecomment-130433215","issue_url":"https://api.github.com/repos/teampoltergeist/poltergeist/issues/520","id":130433215,"user":{"login":"ot-brian-mackey","id":8226124,"avatar_url":"https://avatars.githubusercontent.com/u/8226124?v=3","gravatar_id":"","url":"https://api.github.com/users/ot-brian-mackey","html_url":"https://github.com/ot-brian-mackey","followers_url":"https://api.github.com/users/ot-brian-mackey/followers","following_url":"https://api.github.com/users/ot-brian-mackey/following{/other_user}","gists_url":"https://api.github.com/users/ot-brian-mackey/gists{/gist_id}","starred_url":"https://api.github.com/users/ot-brian-mackey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ot-brian-mackey/subscriptions","organizations_url":"https://api.github.com/users/ot-brian-mackey/orgs","repos_url":"https://api.github.com/users/ot-brian-mackey/repos","events_url":"https://api.github.com/users/ot-brian-mackey/events{/privacy}","received_events_url":"https://api.github.com/users/ot-brian-mackey/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T20:18:01Z","updated_at":"2015-08-12T20:18:01Z","body":"@marionzualo The window size you recommended worked!  Thanks I fought this for hours!"}}