You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
4.3 KiB
62 lines
4.3 KiB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>Index</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><main><p><h1>selenium-webdriver</h1>
|
|
<h2>Installation</h2>
|
|
<p>Install the latest published version using <code>npm</code>:</p>
|
|
<pre><code>npm install selenium-webdriver
|
|
</code></pre>
|
|
<p>In addition to the npm package, you will to download the WebDriver
|
|
implementations you wish to utilize. As of 2.34.0, <code>selenium-webdriver</code>
|
|
natively supports the <a href="http://chromedriver.storage.googleapis.com/index.html">ChromeDriver</a>.
|
|
Simply download a copy and make sure it can be found on your <code>PATH</code>. The other
|
|
drivers (e.g. Firefox, Internet Explorer, and Safari), still require the
|
|
<a href="http://selenium-release.storage.googleapis.com/index.html">standalone Selenium server</a>.</p>
|
|
<h3>Running the tests</h3>
|
|
<p>To run the tests, you will need to download a copy of the
|
|
<a href="http://chromedriver.storage.googleapis.com/index.html">ChromeDriver</a> and make
|
|
sure it can be found on your <code>PATH</code>.</p>
|
|
<pre><code>npm test selenium-webdriver
|
|
</code></pre>
|
|
<p>To run the tests against multiple browsers, download the
|
|
<a href="http://selenium-release.storage.googleapis.com/index.html">Selenium server</a> and
|
|
specify its location through the <code>SELENIUM_SERVER_JAR</code> environment variable.
|
|
You can use the <code>SELENIUM_BROWSER</code> environment variable to define a
|
|
comma-separated list of browsers you wish to test against. For example:</p>
|
|
<pre><code>export SELENIUM_SERVER_JAR=path/to/selenium-server-standalone-2.33.0.jar
|
|
SELENIUM_BROWSER=chrome,firefox npm test selenium-webdriver
|
|
</code></pre>
|
|
<h2>Usage</h2>
|
|
<pre><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('webdriver');
|
|
driver.findElement(webdriver.By.name('btnG')).click();
|
|
driver.wait(function() {
|
|
return driver.getTitle().then(function(title) {
|
|
return title === 'webdriver - Google Search';
|
|
});
|
|
}, 1000);
|
|
|
|
driver.quit();
|
|
</code></pre>
|
|
<h2>Documentation</h2>
|
|
<p>API documentation is included in the docs module. The API documentation for the
|
|
current release are also available online from the <a href="http://selenium.googlecode.com/git/docs/api/javascript/index.html" title="API docs">Selenium project</a>. A full user guide is available on the
|
|
<a href="http://code.google.com/p/selenium/wiki/WebDriverJs" title="User guide">Selenium project wiki</a>.</p>
|
|
<h2>Issues</h2>
|
|
<p>Please report any issues using the <a href="https://code.google.com/p/selenium/issues/list">Selenium issue tracker</a>.</p>
|
|
<h2>License</h2>
|
|
<p>Copyright 2009-2014 Software Freedom Conservancy</p>
|
|
<p>Licensed 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</p>
|
|
<pre><code> http://www.apache.org/licenses/LICENSE-2.0
|
|
</code></pre>
|
|
<p>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.</p>
|
|
</main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>No data</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>No data</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>No data</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script> |