Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Troubleshooting

Matti Schneider edited this page Dec 5, 2015 · 16 revisions

Clicking on an element generates an action with Chrome, but not with Firefox

Symptom

On the same test suite, in a scenario containing actions that click on some elements, events are fired under Chrome but do not seem to be fired when executing the suite with Firefox.

Reason

The Firefox driver needs the elements on which events are attached to be clicked directly, while Chrome uses the selector you give to compute the coordinates, and clicks the first element that is found at those coordinates.

Solution

Make your selector more specific, so that it explicitly targets the element that has event listeners attached, or one of its descendants.

Usually, that means targeting the a or button element itself in your selectors instead of targeting one of its parents.

The watai command is not defined

Symptom

When trying to run watai some/test/suite, your command line interpreter complains that watai: command not found.

Reason

You probably did not install Watai globally, and did not try to use watai in the same session as when you defined the alias during the installation.

Solution

Read the installation procedure again, and either install globally or run the alias / doskey command again to have the shortcut available in the current session.

Selenium complains it can’t find the browser I asked for

Symptom

Starting a test fails immediately with an error like “Could not find default Chrome binary” or “Cannot find firefox binary in PATH.”.

Reason

The browser you are trying to invoke most likely doesn’t reside at its default location, and Selenium’s default path won’t match it.

That is, assuming the browser you are asking for is actually installed on the server machine :)

Solutions

Is the browser installed?

If not, install it. Remember, it has to be installed _on the machine that is running the selenium-standalone JAR.

Has your browser been installed with brew cask?

Reference the binaries in ~/.watai/config.json.

Is the browser in a non-default location?

You can specify where to look for browsers through keys of the driverCapabilities entry of your [[config file|Configuration]]:

  • For Firefox: firefox_binary.
  • For Chrome: chromeOptions: { binary: }.

In both cases, you should specify the path for the binary (for OS X users, not the .app, the .app/Contents/MacOS/<bin>), as a string.

Watai complains that the Selenium server could not be reached

Symptom

Watai v≥0.6 exits with “The Selenium server could not be reached”.

Or, when running Watai v<0.6, you get one of the following errors:

Error: Unable to send request: getaddrinfo ENOENT
Error: Unable to send request: connect ECONNREFUSED

Reason

This means the Selenium server could not be reached. That server is responsible for forwarding automation instructions to managed browsers. If it is not available, the WebDriver-connection library will exit with the above error.

Solutions

Is the Selenium server running?

You can check whether the server is available by accessing 127.0.0.1:4444/wd/hub in a browser. If no page is displayed, then the server is not started (or you configured it differently, see step 2).

If you don’t have the Selenium standalone server, download it (server-standalone, ok?) and start it in the background:

java -jar path/to/downloaded/selenium-standalone.jar &

Is the Selenium server properly accessed?

If you're sure the server JAR has been started up, but it can't be reached, then it could be that its URL is improperly set up.

The default connection URL is the default one provided by the server, i.e. 127.0.0.1:4444/wd/hub. If you configured Selenium otherwise, or have an IPv6-only network, or whatever else, you have to override this value in the config file, at the seleniumServerURL key.