Selenium-Webdriver Npm
selenium-webdriver – npm
Selenium is a browser automation library. Most often used for testing
web-applications, Selenium may be used for any task that requires automating
interaction with the browser.
Installation
Selenium may be installed via npm with
npm install selenium-webdriver
You will need to download additional components to work with each of the major
browsers. The drivers for Chrome, Firefox, and Microsoft’s IE and Edge web
browsers are all standalone executables that should be placed on your system
PATH. Apple’s safaridriver is shipped with Safari 10 for OS X El Capitan and
macOS Sierra. You will need to enable Remote Automation in the Develop menu of
Safari 10 before testing.
Browser
Component
Chrome
chromedriver()
Internet Explorer
Edge
Firefox
geckodriver()
Opera
operadriver()
Safari
safaridriver
Usage
The sample below and others are included in the example directory. You may
also find the tests for selenium-webdriver informative.
const {Builder, By, Key, until} = require(‘selenium-webdriver’);
(async function example() {
let driver = await new Builder(). forBrowser(‘firefox’)();
try {
await (”);
await ndElement((‘q’)). sendKeys(‘webdriver’, );
await (until. titleIs(‘webdriver – Google Search’), 1000);} finally {
await ();}})();
Using the Builder API
The Builder class is your one-stop shop for configuring new WebDriver
instances. Rather than clutter your code with branches for the various browsers,
the builder lets you set all options in one flow. When you call
Builder#build(), all options irrelevant to the selected browser are dropped:
const webdriver = require(‘selenium-webdriver’);
const chrome = require(‘selenium-webdriver/chrome’);
const firefox = require(‘selenium-webdriver/firefox’);
let driver = new er(). forBrowser(‘firefox’). setChromeOptions(/*… */). setFirefoxOptions(/*… */)
();
Why would you want to configure options irrelevant to the target browser? The
Builder’s API defines your default configuration. You can change the target
browser at runtime through the SELENIUM_BROWSER environment variable. For
example, the example/ script is configured to run against
Firefox. You can run the example against other browsers just by changing the
runtime environment
# cd node_modules/selenium-webdriver
node example/google_search
SELENIUM_BROWSER=chrome node example/google_search
SELENIUM_BROWSER=safari node example/google_search
The Standalone Selenium Server
The standalone Selenium Server acts as a proxy between your script and the
browser-specific drivers. The server may be used when running locally, but it’s
not recommend as it introduces an extra hop for each request and will slow
things down. The server is required, however, to use a browser on a remote host
(most browser drivers, like the IEDriverServer, do not accept remote
connections).
To use the Selenium Server, you will need to install the
JDK and
download the latest server from Selenium. Once downloaded, run the
server with
java -jar
You may configure your tests to run against a remote server through the Builder
API:
let driver = new er(). usingServer(‘localhost:4444/wd/hub’)
Or change the Builder’s configuration at runtime with the SELENIUM_REMOTE_URL
environment variable:
SELENIUM_REMOTE_URL=”localhost:4444/wd/hub” node
You can experiment with these options using the example/
script provided with selenium-webdriver.
Documentation
API documentation is available online from the Selenium project.
Additional resources include
the #selenium channel on freenode IRC
the list
SeleniumHQ documentation
Contributing
Contributions are accepted either through GitHub pull requests or patches
via the Selenium issue tracker.
Node Support Policy
Each version of selenium-webdriver will support the latest semver-minor
version of the LTS and stable Node releases. All semver-major &
semver-minor versions between the LTS and stable release will have “best
effort” support. Following a Selenium release, any semver-minor Node releases
will also have “best effort” support. Releases older than the latest LTS,
semver-major releases, and all unstable release branches (e. g. “”)
are considered strictly unsupported.
For example, suppose the current LTS and stable releases are v6. 9. 5 and v7. 5. 0,
respectively. Then a Selenium release would have the following support levels:
Version
Support
<= 6. 8
unsupported
6. 9
supported
7. 0-4
best effort
7. 5
>= 7. 5
Support Level Definitions
supported: A selenium-webdriver release will be API compatible with the
platform API, without the use of runtime flags.
best effort: Bugs will be investigated as time permits. API compatibility is
only guaranteed where required by a supported release. This effectively
means the adoption of new JS features, such as ES2015 modules, will depend
on what is supported in Node’s LTS.
unsupported: Bug submissions will be closed as will-not-fix and API
compatibility is not guaranteed.
Projected Support Schedule
If Node releases a new LTS each October and a new major version every 6
months, the support window for selenium-webdriver will be roughly:
Date
LTS
Stable
(current)
8. 9
9. 0
2018-04
8. x
10. 0
2018-10
10. x
11. 0
2019-04
12. 0
2019-10
12. x
13. 0
Issues
Please report any issues using the Selenium issue tracker. When using
the issue tracker
Do include a detailed description of the problem.
Do include a link to a gist with any
interesting stack traces/logs (you may also attach these directly to the bug
report).
Do include a reduced test case. Reporting “unable to find
element on the page” is not a valid report – there’s nothing for us to
look into. Expect your bug report to be closed if you do not provide enough
information for us to investigate.
Do not use the issue tracker to submit basic help requests. All help
inquiries should be directed to the user forum or #selenium IRC
channel.
Do not post empty “I see this too” or “Any updates? ” comments. These
provide no additional information and clutter the log.
Do not report regressions on closed bugs as they are not actively
monitored for updates (especially bugs that are >6 months old). Please open a
new issue and reference the original bug in your report.
License
Licensed to the Software Freedom Conservancy (SFC) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The SFC licenses this file
to you under the Apache License, Version 2. 0 (the
“License”); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
“AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
selenium-webdriver – npm
Selenium is a browser automation library. Most often used for testing
web-applications, Selenium may be used for any task that requires automating
interaction with the browser.
Installation
Selenium may be installed via npm with
npm install selenium-webdriver
You will need to download additional components to work with each of the major
browsers. The drivers for Chrome, Firefox, and Microsoft’s IE and Edge web
browsers are all standalone executables that should be placed on your system
PATH. Apple’s safaridriver is shipped with Safari 10 for OS X El Capitan and
macOS Sierra. You will need to enable Remote Automation in the Develop menu of
Safari 10 before testing.
Browser
Component
Chrome
chromedriver()
Internet Explorer
Edge
Firefox
geckodriver()
Opera
operadriver()
Safari
safaridriver
Usage
The sample below and others are included in the example directory. You may
also find the tests for selenium-webdriver informative.
const {Builder, By, Key, until} = require(‘selenium-webdriver’);
(async function example() {
let driver = await new Builder(). forBrowser(‘firefox’)();
try {
await (”);
await ndElement((‘q’)). sendKeys(‘webdriver’, );
await (until. titleIs(‘webdriver – Google Search’), 1000);} finally {
await ();}})();
Using the Builder API
The Builder class is your one-stop shop for configuring new WebDriver
instances. Rather than clutter your code with branches for the various browsers,
the builder lets you set all options in one flow. When you call
Builder#build(), all options irrelevant to the selected browser are dropped:
const webdriver = require(‘selenium-webdriver’);
const chrome = require(‘selenium-webdriver/chrome’);
const firefox = require(‘selenium-webdriver/firefox’);
let driver = new er(). forBrowser(‘firefox’). setChromeOptions(/*… */). setFirefoxOptions(/*… */)
();
Why would you want to configure options irrelevant to the target browser? The
Builder’s API defines your default configuration. You can change the target
browser at runtime through the SELENIUM_BROWSER environment variable. For
example, the example/ script is configured to run against
Firefox. You can run the example against other browsers just by changing the
runtime environment
# cd node_modules/selenium-webdriver
node example/google_search
SELENIUM_BROWSER=chrome node example/google_search
SELENIUM_BROWSER=safari node example/google_search
The Standalone Selenium Server
The standalone Selenium Server acts as a proxy between your script and the
browser-specific drivers. The server may be used when running locally, but it’s
not recommend as it introduces an extra hop for each request and will slow
things down. The server is required, however, to use a browser on a remote host
(most browser drivers, like the IEDriverServer, do not accept remote
connections).
To use the Selenium Server, you will need to install the
JDK and
download the latest server from Selenium. Once downloaded, run the
server with
java -jar
You may configure your tests to run against a remote server through the Builder
API:
let driver = new er(). usingServer(‘localhost:4444/wd/hub’)
Or change the Builder’s configuration at runtime with the SELENIUM_REMOTE_URL
environment variable:
SELENIUM_REMOTE_URL=”localhost:4444/wd/hub” node
You can experiment with these options using the example/
script provided with selenium-webdriver.
Documentation
API documentation is available online from the Selenium project.
Additional resources include
the #selenium channel on freenode IRC
the list
SeleniumHQ documentation
Contributing
Contributions are accepted either through GitHub pull requests or patches
via the Selenium issue tracker.
Node Support Policy
Each version of selenium-webdriver will support the latest semver-minor
version of the LTS and stable Node releases. All semver-major &
semver-minor versions between the LTS and stable release will have “best
effort” support. Following a Selenium release, any semver-minor Node releases
will also have “best effort” support. Releases older than the latest LTS,
semver-major releases, and all unstable release branches (e. g. “”)
are considered strictly unsupported.
For example, suppose the current LTS and stable releases are v6. 9. 5 and v7. 5. 0,
respectively. Then a Selenium release would have the following support levels:
Version
Support
<= 6. 8
unsupported
6. 9
supported
7. 0-4
best effort
7. 5
>= 7. 5
Support Level Definitions
supported: A selenium-webdriver release will be API compatible with the
platform API, without the use of runtime flags.
best effort: Bugs will be investigated as time permits. API compatibility is
only guaranteed where required by a supported release. This effectively
means the adoption of new JS features, such as ES2015 modules, will depend
on what is supported in Node’s LTS.
unsupported: Bug submissions will be closed as will-not-fix and API
compatibility is not guaranteed.
Projected Support Schedule
If Node releases a new LTS each October and a new major version every 6
months, the support window for selenium-webdriver will be roughly:
Date
LTS
Stable
(current)
8. 9
9. 0
2018-04
8. x
10. 0
2018-10
10. x
11. 0
2019-04
12. 0
2019-10
12. x
13. 0
Issues
Please report any issues using the Selenium issue tracker. When using
the issue tracker
Do include a detailed description of the problem.
Do include a link to a gist with any
interesting stack traces/logs (you may also attach these directly to the bug
report).
Do include a reduced test case. Reporting “unable to find
element on the page” is not a valid report – there’s nothing for us to
look into. Expect your bug report to be closed if you do not provide enough
information for us to investigate.
Do not use the issue tracker to submit basic help requests. All help
inquiries should be directed to the user forum or #selenium IRC
channel.
Do not post empty “I see this too” or “Any updates? ” comments. These
provide no additional information and clutter the log.
Do not report regressions on closed bugs as they are not actively
monitored for updates (especially bugs that are >6 months old). Please open a
new issue and reference the original bug in your report.
License
Licensed to the Software Freedom Conservancy (SFC) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The SFC licenses this file
to you under the Apache License, Version 2. 0 (the
“License”); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
“AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
selenium – npm search
seleniumexact matchSelenium in an npm packagebddtddseleniumdidit-techpublished 2. 20. 0 10 years agoMQPselenium-webdriverThe official WebDriver JavaScript bindings from the Selenium projectautomationseleniumtestingwebdriverwebdriverjssriharshapublished 4. 0. 0 4 days agoMQPprotractorWebdriver E2E test wrapper for Angular. angulartesttestingwebdriverwebdriverjsseleniumangularpublished 7. 0 a year agoMQPwdWebDriver/Selenium 2 clienttestingautomationwebdriverwebdriverjsseleniumjlippspublished 1. 14. 0 9 months agoMQPnightwatchEasy to use based End-to-End testing solution for browser based apps and websites, using the W3C WebDriver ghtwatchnightwatchjsseleniumtestingwebdriverbrowserstackend-to-endautomated-testinge2ebeatfactorpublished 1. 7. 11 a month agoMQPchromedriverChromeDriver for Seleniumchromedriverseleniumgiggiopublished 94. 0 20 days agoMQPselenium-standaloneinstalls a `selenium-standalone` command line to install and start a standalone selenium servermgrybykpublished 7. 1. 0 4 months agoMQPwebdriverioNext-gen browser and mobile automation test framework for Node. jswebdriveriowebdriverseleniumappiumsaucelabssaucelabsmochanodeUnitbusterdevtoolspuppeteervowsjasmineView morewdio-userpublished 7. 1 13 days agoMQPinternIntern. A next-generation code testing stack for scripttestunittestingcicontinuous integrationbddtddxunitistanbulchaidojotoolkitseleniumView morejason0x43published 4. 10. 0 3 months agoMQPbrowserstack-localNodejs bindings for BrowserStack LocalBrowserStackLocalseleniumtestingbrowserstackpublished 1. 4. 8 a year agoMQP@lambdatest/node-tunnelNodejs bindings for LambdaTest Tunnellambdatesttunnellocalseleniumtestinglambdatestdevpublished 3. 1 4 months agoMQPghost-inspectorGhost Inspector CLI and API Library for Node. jsghostinspectorghost inspectorghostinspectortesttestingautomated testingbrowser testingautomated browser testingseleniumclicommand line interfaceaaronfaypublished 6. 6 2 months agoMQPmailosaurThe Mailosaur Node library lets you integrate email and SMS testing into your continuous integration smstestingautomationseleniumwebdrivernightwatchmailosaurapppublished 7. 3. 1 5 months agoMQPwdio-intercept-serviceCapture and assert HTTP ajax calls in seleniumwebdriverwebdriveriowdio-servicewdio-pluginservicewebdriverjsfetchajaxtesttestingwdio-userpublished 4. 7 2 months agoMQP@types/selenium-webdriverTypeScript definitions for Selenium WebDriverJStypespublished 4. 15 3 months agoMQPfirefox-profilefirefox profile for selenium WebDriverJs, admc/wd or any other node selenium driver that supports capabilitiesseleniumwebdriverfirefoxfirefox profilenodejssaadtazipublished 4. 2. 1 a month agoMQPbotium-coreThe Selenium for Chatbotsftremlpublished 1. 11. 14 23 days agoMQPblocking-proxyWebDriver Proxy for testing rich clients. It block certain calls until Angular is done updating the page under test. testtestingwebdriverwebdriverjsseleniumangularcorepublished 1. 1 4 years agoMQPselenium-test-coreMake easy and simple a application selenium testsseleniumseleniumtestseleniumcoreseleniumtestcoresegandiayepublished 1. 8 a month agoMQPgeminiUI Screenshot testing utilitytesttestingscreenshotseleniumlayoutdudagodpublished 7. 5. 2 2 years agoMQP123…56»