-
Notifications
You must be signed in to change notification settings - Fork 7
Troubleshooting
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.
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.
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.
When trying to run watai some/test/suite
, your command line interpreter complains that watai: command not found
.
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.
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.
Starting a test fails immediately with an error like “Could not find default Chrome binary” or “Cannot find firefox binary in PATH.”.
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 :)
If not, install it. Remember, it has to be installed _on the machine that is running the selenium-standalone
JAR.
Reference the binaries in ~/.watai/config.json
.
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 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
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.
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 &
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.