Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capybara::Poltergeist::MouseEventFailed #14

Open
passalini opened this issue Jul 29, 2013 · 8 comments
Open

Capybara::Poltergeist::MouseEventFailed #14

passalini opened this issue Jul 29, 2013 · 8 comments

Comments

@passalini
Copy link

Hi, I'm trying to use this gem at my project, but when I put this in my spec it returns this error:

Capybara::Poltergeist::MouseEventFailed:
  Firing a click at co-ordinates [188, 135] failed. 
  Poltergeist detected another element with CSS selector 'html body div#select2-drop-mask.select2-drop-mask' 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').

my files:
select2_spec.rb:

#...a lot of anothers specs...
select2(@kuririn.email, from: 'User')
expect(page).to_not have_content @goku.email
expect(page).to have_content @kuririn.email

view.html.erb

<%= simple_form_for :filter, url: 'filter', method: 'get', html: {class: 'form-inline' } do |f| %>
  <label for="user_id">User</label>
  <%= f.input_field :user_id, collection: @project.users, as: :select,
      value_method: :id,
      label_method: :email,
      class: "select_users_by_select2" %>
<% end %>

<% @users.each do |user| %>
  <%= user.email %>
<% end %>
@chalmagean
Copy link

+1

1 similar comment
@zda
Copy link

zda commented Sep 18, 2013

+1

@passalini
Copy link
Author

people, try this: https://gist.github.com/passalini/6614466

@hotgazpacho
Copy link

This works for me. Clicking on the select2-drop-mask is what the user would actually do to deactivate the select2 drop down.

find(:xpath, '//div[@id="select2-drop-mask"]').click

@domness
Copy link

domness commented Jul 18, 2014

Well, it seems that this isn't going to get fixed I guess :(

@IamNaN
Copy link

IamNaN commented Nov 9, 2014

I had this problem with contenteditable divs. The parent div would be reported as the "overlapping" element, even if I used CSS to set z-order. When making an example project to demo the error, I found that when I replace poltergeist with selenium the problem went away. YMMV

@HenryYan2012
Copy link

+1

@HenryYan2012
Copy link

I had this problem with popups. I have two step in my spec test. Step one, Open a popup and close it. Step two, click a button on the main page. Poltergeist executed step two before the popup really closed. So "overlapping" element occured. BTW, my spec test works well with selenium.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants