Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I've been running my tests via the terminal for a while now without any problems.:

cucumber Create\ New\ Game.feature

Which contains the following:

Feature: Create New Game

  Background: 

    Given I am logged in

  Scenario: Cleanup & New Game 01

    Then I Delete all test Games

And the ruby:

Given(/^I am logged in$/) do

  el = first("button[ttag='account_dropdown_btn']", :visible => true)

  if el.nil?

    logMeIn("[email protected]","pa55w0rd")

  end

end

logMeIn defined as:

# Logs the user in with given credentials

def logMeIn(username, password)

  page.driver.browser.manage.window.maximize

  visit ENV['BASE_URL']

  fill_in 'j_username', :with => username

  fill_in 'j_password', :with => password

  click_button 'Login'

end

None of the above has changed from when the tests were working until now. Today, when I start the tests, as soon as Firefox opens, I immediately get:

Background:            # features/Create New Game.feature:4

Given I am logged in # features/step_definitions/Generic Steps.rb:1

arguments[0] is undefined (Selenium::WebDriver::Error::JavascriptError)

As you can see, it's failing on the first line. I don't know why.

I updated all my gems to make sure everything was fresh, but this didn't work. I thought it might have been a browser issue as my system automatically updated to Firefox 35.0 this morning. I uninstalled and tried 34 but it's still the same problem. None of the code has changed.

I don't know what other misconfiguration could've caused this as I haven't changed anything.

Can anyone help further with this error?

1 Answer

0 votes
by (62.9k points)

According to me, there is a bug in Firefox 35. To avoid that, I found it easiest to configure Capybara to run Selenium-tests in Chrome. So if you don't need to run tests particularly in Firefox, you can use a chrome driver.

There is a gem to get it easily.

I hope this resolves the issue.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...