teampoltergeist / poltergeist

A PhantomJS driver for Capybara
MIT License
2.5k stars 415 forks source link

Capybara::Poltergeist::BrowserError #894

Closed cohki0305 closed 7 years ago

cohki0305 commented 7 years ago

I got an error by following code. when I check the screenshot, I found the element which has the ID. In screenshot, page design was different from the page which I see in localhost.

Also, I got same error when I use have_content.

Please tell me a solution.

#spec
page.save_screenshot "tmp/capybara/screenshot-#{DateTime.now}.png"

find("#ID").trigger('click')
Capybara::Poltergeist::ObsoleteNode:
       The element you are trying to interact with is either not part of the DOM, or is not currently visible on the page (perhaps display: none is set). It's possible the element has been replaced by another element and you meant to interact with the new element. If so you need to do a new 'find' in order to get a reference to the new element.

     # ------------------
     # --- Caused by: ---
     # Capybara::Poltergeist::BrowserError:
     #   There was an error inside the PhantomJS portion of Poltergeist. If this is the error returned, and not the cause of a more detailed error response, this is probably a bug, so please report it.

ENV

rails 5.1.1 ruby 2.4.1 poltergeist (1.15.0)

cohki0305 commented 7 years ago

Sorry, It was my mistake. I was finding the elements within other area.