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.2
Installed npm
:
C:\Users\AtechM_03>npm -v
3.10.10
Configured nodeclipse
as per http://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-webdriver
at 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
`-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
| `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
| `-- [email protected]
`-- [email protected]
+-- [email protected]
`-- [email protected]
`-- [email protected]
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-webdriver
at 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
[email protected] C:\Users\AtechM_03\LearnAutmation\NodeProject
`-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
| `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
| `-- [email protected]
`-- [email protected]
+-- [email protected]
`-- [email protected]
npm WARN [email protected] No repository field.
Wrote my first program through NodeJS-Selenium
as first_test.js
and it executes well.
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();
C:\Users\AtechM_03\LearnAutmation\NodeProject\Selenium>node first_test.js
C:\Users\AtechM_03\LearnAutmation\NodeProject\Selenium>
selenium-webdriver
is Testcase getting executed?selenium-webdriver
installation completely?While with
Selenium-Java
binding I add thejars
at project level where as withSelenium-Python
bindingPyDev
module binded thePython Home
to Eclipse by default.
Any suggestions/pointers will be helpful.
First, you'll need to decide on the OS and Device/Browser combination you'd like to test on. }var driver = new webdriver. Builder(). usingServer('http://hub-cloud.browserstack.com/wd/hub').
Set up the dependencies Before you can start running your Selenium tests with NodeJS , you need to have the NodeJS language bindings installed. Run the following command on your terminal/command-line to install the required dependencies.
Mocha is a feature-rich JavaScript test framework running on node. js and the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases; Selenium: Web Browser Automation.
How can I know from which location of selenium-webdriver is Testcase getting executed
The package search location order of nodejs as below:
npm config get prefix
it print out a folder pathIf your project local packages includes this package, nodejs will use it from local pacakges, otherwise use if from global package, if gloal packages not has this package, noejs will report module 'selenium-webdriver' not found error.
How can I remove/uninstall the additional selenium-webdriver installation completely
How can I generate some granular trace level logs to know whats happening within
Actually, selenium server supply a detail log of each selenium API call, not sure it's you wanted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With