Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions in getting started don't seem to work with default geckodriver #155

Open
literallyMello opened this issue Mar 17, 2022 · 3 comments

Comments

@literallyMello
Copy link

On MacOS I followed the steps in the getting started quickstart

npm init -y
npm install nightwatch --save-dev
npm install geckodriver chromedriver --save-dev

To execute my first test I use the example on the page that doesn't specify an environment so it uses geckodriver

npx nightwatch node_modules/nightwatch/examples/tests/ecosia.js

When I run this I get the following error

[Ecosia.org Demo] Test Suite
────────────────────────────────────────────────────────
⠋ Starting GeckoDriver on port 4444...
   Response 500 POST /session (5ms)
   {
     value: {
       error: 'session not created',
       message: "Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line",
       stacktrace: ''
     }
⚠ Failed to connect to GeckoDriver on localhost with port 4444.

─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

  TEST FAILURE (170ms): 
   - 1 error during execution; 
   - 0 tests failed; 
   - 0/NA tests passed


  SessionNotCreatedError: An error occurred while creating a new GeckoDriver session: [SessionNotCreatedError] Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line
  Verify if GeckoDriver is configured correctly; using:
  {
     start_process: true,
     server_path: '/Users/[redacted]/projects/nw-2.0-test/node_modules/geckodriver/geckodriver',
     port: 4444,
     host: 'localhost',
     ssl: false,
     default_path_prefix: '',
     proxy: undefined,
     cli_args: {}
  }
@AutomatedTester
Copy link
Member

I tried to recreate the issue and I couldn't.

Do you have Firefox installed?

davidburns in ~/development/nightwatch-bugs/doc-155 λ npm init -y
Wrote to /Users/davidburns/development/nightwatch-bugs/doc-155/package.json:

{
  "name": "doc-155",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}


davidburns in ~/development/nightwatch-bugs/doc-155 λ npm i nightwatch --s
ave-dev

added 164 packages, and audited 165 packages in 12s

30 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
davidburns in ~/development/nightwatch-bugs/doc-155 λ npm i geckodriver ch
romedriver --save-dev

added 81 packages, and audited 246 packages in 7s

43 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
davidburns in ~/development/nightwatch-bugs/doc-155 λ npx nightwatch node_modules/nightwatch/examples/tests/ecosia.js
No config file found in the current working directory, creating nightwatch.conf.js in the current folder...

[Ecosia.org Demo] Test Suite
────────────────────────────────────────────────────────
ℹ Connected to GeckoDriver on port 4444 (4561ms).
  Using: firefox (97.0.2) on MAC (21.3.0).


  Running Demo test ecosia.org:
───────────────────────────────────────────────────────────────────────────────────────────────────
  ✔ Element <body> was visible after 31 milliseconds.
  ✔ Testing if the page title contains 'Ecosia' (6ms)
  ✔ Testing if element <input[type=search]> is visible (42ms)
  ✔ Testing if element <button[type=submit]> is visible (17ms)
  ✔ Testing if element <.mainline-results> contains text 'Nightwatch.js' (312ms)

OK. 5 assertions passed. (2.276s)
davidburns in ~/development/nightwatch-bugs/doc-155 λ

@reallymello
Copy link

Firefox was inadvertently wiped off my system from an IT policy so that was it. Thanks.

@AutomatedTester
Copy link
Member

I will add a note to make sure that browsers are installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants