Poltergeist: TimeOutError when trying to click on a specific link

I am trying to click a link and it shows "Unable to click link" due to timeout error. But the link is visible on the page. Here is a snippet.

require 'spec_helper'

      describe 'Test this page', :js => true do
        it "test sample" do 
        # Resize the screen to System co-ordinates
        page.driver.resize(1366,768)

        # URL to be triggered
        visit("https://URL")
        sleep 5
        puts "Hit Page"
        page.driver.render('HitPage.jpg', :full =>true)

        # Sign in with Google credentials
        click_link "Sign in with Google Oauth2"
        sleep 2
    end
        # Entering credentials of Google Auth
        it "Enter credentials" do
            puts "Session"
        page.driver.render('googlepage.jpg', :full =>true)
        fill_in "Email",:with => "username"
        fill_in "Passwd",:with => "password"
        click_button "Sign in"
        sleep 5
        page.driver.render('loggedin.jpg', :full =>true)
    end
    end

      

The link is displayed in the screenshot (HitPage.jpg) and its clickable. But when viewed through "rspec spec / test_spec.rb", the output shows a timeout error as follows.

Failure/Error: click_link "Sign in with Google Oauth2"

 Capybara::Poltergeist::TimeoutError:
   Timed out waiting for response to {"name":"click","args":[1,0]}. It possible that this happened because something took a very long time (for example a page load was slow). If so, setting the Poltergeist :timeout option to a higher value will help (see the docs for details). If increasing the timeout does not help, this is probably a bug in Poltergeist - please report it to the issue tracker.
 # ./lib/capybara/poltergeist/web_socket_server.rb:87:in `rescue in send'
 # ./lib/capybara/poltergeist/web_socket_server.rb:83:in `send'
 # ./lib/capybara/poltergeist/server.rb:33:in `send'
 # ./lib/capybara/poltergeist/browser.rb:312:in `command'
 # ./lib/capybara/poltergeist/browser.rb:167:in `click'
 # ./lib/capybara/poltergeist/node.rb:17:in `command'
 # ./lib/capybara/poltergeist/node.rb:116:in `click'
 # ./spec/test_spec.rb:16:in `block (2 levels) in <top (required)>'

Finished in 52.51 seconds
1 example, 1 failure

      

But he clicks on the link and continues with the next execution, entering the email address and password.

Any idea why this timeout is showing even though the link is clicked?

Poltergeist -1.5.1
Capybara-2.4.4
ruby - 1.9.3

      

+3


source to share





All Articles