1

When I run this snippet of code in a browser using selenium, it works fine

find(:css, '*[data-id="claim_email"]').set "gmelville@constantcontact.com"
find(:css, '*[data-id="claim_link"]').click

but, when i try to run the same thing headless using poltergeist on phantomjs, i get an error stating

Unable to find css "*[data-id=\"claim_email\"]" (Capybara::ElementNotFound).

What could be the issue here? Looking at the rendered page when running headless, it does have the element.

Also im running these test using cucumber

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
  • You probably need to set the viewport size to something desktop-like. – Artjom B. Dec 17 '14 at 17:36
  • I found the issue. It was related to security. I had to add the TLSv1 protocol option to PhantomJs and it worked. Capybara.register_driver :cucumber_poltergeist do |app| Capybara::Poltergeist::Driver.new(app, phantomjs_options: ['--ssl-protocol=TLSv1'], debug: false) end – user4371064 Dec 18 '14 at 18:53
  • You can provide an answer yourself and accept it in a day. You can incorporate [this answer](http://stackoverflow.com/a/26417660/1816580) to motivate your solution. – Artjom B. Dec 18 '14 at 18:55

0 Answers0