What is the ideal location to install selenium-webdriver to work with NodeJS + Selenium + Mocha (On Windows)
I have just started to explore NodeJS with Selenium. Moving forward I will be working with NodeJS + Selenium + Mocha
Installed
node.js:C:\Users\AtechM_03>node -v v6.11.2Installed
npm:C:\Users\AtechM_03>npm -v 3.10.10Configured
nodeclipseas perhttp://www.nodeclipse.org/updates/and my Project structure looks like:
Now, I am not sure about the exact location to install selenium-webdriver
Installed
selenium-webdriverat the default location (through command-line) as per (http://www.nodeclipse.org/updates/)C:\Users\AtechM_03>npm install selenium-webdriver C:\Users\AtechM_03 `-- selenium-webdriver@3.5.0 +-- jszip@3.1.3 | +-- core-js@2.3.0 | +-- es6-promise@3.0.2 | +-- lie@3.1.1 | | `-- immediate@3.0.6 | +-- pako@1.0.5 | `-- readable-stream@2.0.6 | +-- core-util-is@1.0.2 | +-- inherits@2.0.3 | +-- isarray@1.0.0 | +-- process-nextick-args@1.0.7 | +-- string_decoder@0.10.31 | `-- util-deprecate@1.0.2 +-- rimraf@2.6.1 | `-- glob@7.1.2 | +-- fs.realpath@1.0.0 | +-- inflight@1.0.6 | | `-- wrappy@1.0.2 | +-- minimatch@3.0.4 | | `-- brace-expansion@1.1.8 | | +-- balanced-match@1.0.0 | | `-- concat-map@0.0.1 | +-- once@1.4.0 | `-- path-is-absolute@1.0.1 +-- tmp@0.0.30 | `-- os-tmpdir@1.0.2 `-- xml2js@0.4.17 +-- sax@1.2.4 `-- xmlbuilder@4.2.1 `-- lodash@4.17.4 npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\AtechM_03\pack age.json' npm WARN AtechM_03 No description npm WARN AtechM_03 No repository field. npm WARN AtechM_03 No README data npm WARN AtechM_03 No license field.Installed
selenium-webdriverat the current project directory (through command-line) as per (https://dzone.com/articles/selenium-nodejs-and-mocha)C:\Users\AtechM_03\LearnAutmation\NodeProject>npm install selenium-webdriver NodeProject@0.1.0 C:\Users\AtechM_03\LearnAutmation\NodeProject `-- selenium-webdriver@3.5.0 +-- jszip@3.1.4 | +-- core-js@2.3.0 | +-- es6-promise@3.0.2 | +-- lie@3.1.1 | | `-- immediate@3.0.6 | +-- pako@1.0.6 | `-- readable-stream@2.0.6 | +-- core-util-is@1.0.2 | +-- inherits@2.0.3 | +-- isarray@1.0.0 | +-- process-nextick-args@1.0.7 | +-- string_decoder@0.10.31 | `-- util-deprecate@1.0.2 +-- rimraf@2.6.2 | `-- glob@7.1.2 | +-- fs.realpath@1.0.0 | +-- inflight@1.0.6 | | `-- wrappy@1.0.2 | +-- minimatch@3.0.4 | | `-- brace-expansion@1.1.8 | | +-- balanced-match@1.0.0 | | `-- concat-map@0.0.1 | +-- once@1.4.0 | `-- path-is-absolute@1.0.1 +-- tmp@0.0.30 | `-- os-tmpdir@1.0.2 `-- xml2js@0.4.19 +-- sax@1.2.4 `-- xmlbuilder@9.0.4 npm WARN NodeProject@0.1.0 No repository field.Wrote my first program through
NodeJS-Seleniumasfirst_test.jsand it executes well.
Code:
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('http://www.google.com');
driver.findElement(webdriver.By.name('q')).sendKeys('simple programmer');
driver.findElement(webdriver.By.name('q')).submit();
driver.quit();
Execution :
C:\Users\AtechM_03\LearnAutmation\NodeProject\Selenium>node first_test.js
C:\Users\AtechM_03\LearnAutmation\NodeProject\Selenium>
My Question :
- How can I know from which location of
selenium-webdriveris Testcase getting executed? - How can I remove/uninstall the additional
selenium-webdriverinstallation completely? - How can I generate some granular trace level logs to know whats happening within?
While with
Selenium-Javabinding I add thejarsat project level where as withSelenium-PythonbindingPyDevmodule binded thePython Hometo Eclipse by default.
Any suggestions/pointers will be helpful.

