Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
selenium-standalone
Advanced tools
installs a `start-selenium` command line to start a standalone selenium server with chrome-driver
The selenium-standalone npm package is a tool that allows you to easily install and run a standalone Selenium server. This is useful for running automated tests in various browsers without needing to manually set up the Selenium server and browser drivers.
Install Selenium Server and Browser Drivers
This feature allows you to install the Selenium server and browser drivers (e.g., ChromeDriver, GeckoDriver) with a single command. The code sample demonstrates how to install the latest versions of the Selenium server and drivers for Chrome and Firefox.
const selenium = require('selenium-standalone');
selenium.install({
version: 'latest',
baseURL: 'https://selenium-release.storage.googleapis.com',
drivers: {
chrome: { version: 'latest' },
firefox: { version: 'latest' }
},
logger: function(message) {
console.log(message);
}
}, function(err) {
if (err) { return console.error(err); }
console.log('Selenium and drivers installed successfully');
});
Start Selenium Server
This feature allows you to start the Selenium server programmatically. The code sample demonstrates how to start the Selenium server and log a message upon successful startup.
const selenium = require('selenium-standalone');
selenium.start(function(err, child) {
if (err) { return console.error(err); }
console.log('Selenium server started successfully');
// child is a ChildProcess instance
});
Stop Selenium Server
This feature allows you to stop the Selenium server programmatically. The code sample demonstrates how to start the Selenium server and then stop it after 10 seconds.
const selenium = require('selenium-standalone');
selenium.start(function(err, child) {
if (err) { return console.error(err); }
console.log('Selenium server started successfully');
// Stop the server after 10 seconds
setTimeout(() => {
child.kill();
console.log('Selenium server stopped');
}, 10000);
});
webdriver-manager is a tool for managing WebDriver binaries. It can download, update, and start WebDriver binaries for different browsers. Unlike selenium-standalone, which focuses on running a standalone Selenium server, webdriver-manager is more focused on managing the WebDriver binaries themselves.
selenium-webdriver is the official Selenium package for Node.js. It provides bindings for the WebDriver API and allows you to write automated tests for web applications. While selenium-standalone focuses on setting up and running the Selenium server, selenium-webdriver is used for writing and executing the tests themselves.
Nightwatch is an end-to-end testing framework that uses the WebDriver API. It provides a higher-level API for writing tests and includes built-in support for running tests with Selenium. Nightwatch can manage the Selenium server and browser drivers, similar to selenium-standalone, but it also includes additional features for writing and organizing tests.
Command line or programmatic install and launch of latest selenium standalone server, chrome driver and internet explorer driver.
It will install a start-selenium
command line that will be able to launch firefox, chrome, internet explorer or phantomjs for your tests.
npm install selenium-standalone@latest -g
start-selenium
Any arguments passed to start-selenium
are then passed to
java -jar ...jar args
.
So you can start-selenium -debug
to launch standalone selenium server
in debug mode.
Currently installs selenium 2.44.0
, chrome driver 2.13
and internet explorer driver 2.44.0
by default. You can override the versions installed by defining SELENIUM_VERSION
, CHROMEDRIVER_VERSION
or IEDRIVER_VERSION
env variables before npm install
ing
SELENIUM_VERSION=2.42.0 npm install selenium-standalone@latest -g
start-selenium
On linux,
To run headlessly, you can use xvfb:
xvfb-run --server-args="-screen 0, 1366x768x24" start-selenium
By default, google chrome, firefox and phantomjs are available if installed on the sytem.
Using a selenium driver like wd:
npm install wd -g
wd shell
(wd): browser = wd.remote(); browser.init(function(){browser.get('http://www.google.com')})
var selenium = require('selenium-standalone');
var spawnOptions = { stdio: 'pipe' };
// options to pass to `java -jar selenium-server-standalone-X.XX.X.jar`
var seleniumArgs = [
'-debug'
];
var server = selenium(spawnOptions, seleniumArgs);
// or, var server = selenium();
// returns ChildProcess instance
// http://nodejs.org/api/child_process.html#child_process_class_childprocess
// spawnOptions defaults to `{ stdio: 'inherit' }`
// seleniumArgs defaults to `[]`
server.stdout.on('data', function(output) {
console.log(output);
});
IEDriverServer 32/64bit version is downloaded according to processor architecture. There are known issues with sendkeys being slow on 64bit version of Internet Explorer. To address this issue, IEDriverServer architecture can be configured using IEDRIVER_ARCH environment variable. Supported values are ia32
and x64
.
set IEDRIVER_ARCH=ia32
npm install selenium-standalone@latest -g
start-selenium
selenium-standalone
versions maps selenium
versions.
FAQs
installs a `selenium-standalone` command line to install and start a standalone selenium server
The npm package selenium-standalone receives a total of 111,243 weekly downloads. As such, selenium-standalone popularity was classified as popular.
We found that selenium-standalone demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.