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.\hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26440}{}\doxysection{Installation}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26440}
Selenium may be installed via npm with \begin{DoxyVerb}npm install selenium-webdriver
\end{DoxyVerb}
 You will need to download additional components to work with each of the major browsers. The drivers for Chrome, Firefox, Phantom\+JS, Opera, and Microsoft\textquotesingle{}s IE and Edge web browsers are all standalone executables that should be placed on your system \href{http://en.wikipedia.org/wiki/PATH_\%28variable\%29}{\texttt{ PATH}}. Apple\textquotesingle{}s safaridriver is shipped with Safari 10 for OS X El Capitan and mac\+OS Sierra. You will need to enable Remote Automation in the Develop menu of Safari 10 before testing.

\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Browser   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Component    }\\\cline{1-2}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Browser   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Component    }\\\cline{1-2}
\endhead
Chrome   &\href{http://chromedriver.storage.googleapis.com/index.html}{\texttt{ chromedriver(.exe)}}    \\\cline{1-2}
Internet Explorer   &\href{http://selenium-release.storage.googleapis.com/index.html}{\texttt{ IEDriver\+Server.\+exe}}    \\\cline{1-2}
Edge   &\href{http://go.microsoft.com/fwlink/?LinkId=619687}{\texttt{ Microsoft\+Web\+Driver.\+msi}}    \\\cline{1-2}
Firefox   &\href{https://github.com/mozilla/geckodriver/releases/}{\texttt{ geckodriver(.exe)}}    \\\cline{1-2}
Phantom\+JS   &\href{http://phantomjs.org/}{\texttt{ phantomjs(.exe)}}    \\\cline{1-2}
Opera   &\href{https://github.com/operasoftware/operachromiumdriver/releases}{\texttt{ operadriver(.exe)}}    \\\cline{1-2}
Safari   &\href{https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_10_0.html\#//apple_ref/doc/uid/TP40014305-CH11-DontLinkElementID_28}{\texttt{ safaridriver}}   \\\cline{1-2}
\end{longtabu}
\hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26441}{}\doxysection{Usage}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26441}
The sample below and others are included in the {\ttfamily example} directory. You may also find the tests for selenium-\/webdriver informative. \begin{DoxyVerb}const {Builder, By, Key, until} = require('selenium-webdriver');

let driver = new Builder()
    .forBrowser('firefox')
    .build();

driver.get('http://www.google.com/ncr');
driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
driver.wait(until.titleIs('webdriver - Google Search'), 1000);
driver.quit();
\end{DoxyVerb}
 \hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26442}{}\doxysubsection{Using the Builder API}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26442}
The {\ttfamily Builder} class is your one-\/stop shop for configuring new Web\+Driver 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 {\ttfamily Builder\#build()}, all options irrelevant to the selected browser are dropped\+: \begin{DoxyVerb}var webdriver = require('selenium-webdriver'),
    chrome = require('selenium-webdriver/chrome'),
    firefox = require('selenium-webdriver/firefox');

var driver = new webdriver.Builder()
    .forBrowser('firefox')
    .setChromeOptions(/* ... */)
    .setFirefoxOptions(/* ... */)
    .build();
\end{DoxyVerb}
 Why would you want to configure options irrelevant to the target browser? The {\ttfamily Builder}\textquotesingle{}s API defines your {\itshape default} configuration. You can change the target browser at runtime through the {\ttfamily SELENIUM\+\_\+\+BROWSER} environment variable. For example, the {\ttfamily example/google\+\_\+search.\+js} script is configured to run against Firefox. You can run the example against other browsers just by changing the runtime environment \begin{DoxyVerb}# cd node_modules/selenium-webdriver
node example/google_search
SELENIUM_BROWSER=chrome node example/google_search
SELENIUM_BROWSER=safari node example/google_search
\end{DoxyVerb}
 \hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26443}{}\doxysubsection{The Standalone Selenium Server}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26443}
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\textquotesingle{}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 IEDriver\+Server, do not accept remote connections).

To use the Selenium Server, you will need to install the \href{http://www.oracle.com/technetwork/java/javase/downloads/index.html}{\texttt{ JDK}} and download the latest server from \href{http://selenium-release.storage.googleapis.com/index.html}{\texttt{ Selenium}}. Once downloaded, run the server with \begin{DoxyVerb}java -jar selenium-server-standalone-2.45.0.jar
\end{DoxyVerb}
 You may configure your tests to run against a remote server through the Builder API\+: \begin{DoxyVerb}var driver = new webdriver.Builder()
    .forBrowser('firefox')
    .usingServer('http://localhost:4444/wd/hub')
    .build();
\end{DoxyVerb}
 Or change the Builder\textquotesingle{}s configuration at runtime with the {\ttfamily SELENIUM\+\_\+\+REMOTE\+\_\+\+URL} environment variable\+: \begin{DoxyVerb}SELENIUM_REMOTE_URL="http://localhost:4444/wd/hub" node script.js
\end{DoxyVerb}
 You can experiment with these options using the {\ttfamily example/google\+\_\+search.\+js} script provided with {\ttfamily selenium-\/webdriver}.\hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26444}{}\doxysection{Documentation}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26444}
API documentation is available online from the \href{http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/}{\texttt{ Selenium project}}. Additional resources include


\begin{DoxyItemize}
\item the \#selenium channel on freenode IRC
\item the \href{https://groups.google.com/forum/\#!forum/selenium-users}{\texttt{ selenium-\/users@googlegroups.\+com}} list
\item \href{http://www.seleniumhq.org/docs/}{\texttt{ Selenium\+HQ}} documentation
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26445}{}\doxysection{Contributing}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26445}
Contributions are accepted either through \href{https://github.com/SeleniumHQ/selenium/}{\texttt{ Git\+Hub}} pull requests or patches via the \href{https://github.com/SeleniumHQ/selenium/issues}{\texttt{ Selenium issue tracker}}. You must sign our \href{http://goo.gl/qC50R}{\texttt{ Contributor License Agreement}} before your changes will be accepted.\hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26446}{}\doxysection{Node Support Policy}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26446}
Each version of selenium-\/webdriver will support the latest {\itshape semver-\/minor} version of the \href{https://github.com/nodejs/LTS}{\texttt{ LTS}} and stable Node releases. All {\itshape semver-\/major} \& {\itshape semver-\/minor} versions between the LTS and stable release will have \char`\"{}best effort\char`\"{} support. Following a Selenium release, any {\itshape semver-\/minor} Node releases will also have \char`\"{}best effort\char`\"{} support. Releases older than the latest LTS, {\itshape semver-\/major} releases, and all unstable release branches (e.\+g. \char`\"{}v.\+Next\char`\"{}) 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\+:

\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Version   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Support    }\\\cline{1-2}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Version   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Support    }\\\cline{1-2}
\endhead
$<$= 6.\+8   &{\itshape unsupported}    \\\cline{1-2}
6.\+9   &supported    \\\cline{1-2}
7.\+0-\/4   &best effort    \\\cline{1-2}
7.\+5   &supported    \\\cline{1-2}
$>$= 7.\+5   &best effort    \\\cline{1-2}
v.\+Next   &{\itshape unsupported}   \\\cline{1-2}
\end{longtabu}
\hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26447}{}\doxysubsection{Support Level Definitions}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26447}

\begin{DoxyItemize}
\item {\itshape supported\+:} A selenium-\/webdriver release will be API compatible with the platform API, without the use of runtime flags.
\item {\itshape best effort\+:} Bugs will be investigated as time permits. API compatibility is only guaranteed where required by a {\itshape supported} release. This effectively means the adoption of new JS features, such as ES2015 modules, will depend on what is supported in Node\textquotesingle{}s LTS.
\item {\itshape unsupported\+:} Bug submissions will be closed as will-\/not-\/fix and API compatibility is not guaranteed.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26448}{}\doxysubsection{Projected Support Schedule}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26448}
If Node releases a new \href{https://github.com/nodejs/LTS}{\texttt{ LTS}} each October and a new major version every 6 months, the support window for selenium-\/webdriver will be roughly\+:

\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{3}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Date   }&\PBS\raggedleft \cellcolor{\tableheadbgcolor}\textbf{ LTS   }&\PBS\raggedleft \cellcolor{\tableheadbgcolor}\textbf{ Stable    }\\\cline{1-3}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Date   }&\PBS\raggedleft \cellcolor{\tableheadbgcolor}\textbf{ LTS   }&\PBS\raggedleft \cellcolor{\tableheadbgcolor}\textbf{ Stable    }\\\cline{1-3}
\endhead
(current)   &\PBS\raggedleft 6.\+9   &\PBS\raggedleft 7.\+5    \\\cline{1-3}
2017-\/04   &\PBS\raggedleft 6.\+0   &\PBS\raggedleft 8.\+0    \\\cline{1-3}
2017-\/10   &\PBS\raggedleft 8.\+0   &\PBS\raggedleft 9.\+0    \\\cline{1-3}
2018-\/04   &\PBS\raggedleft 8.\+0   &\PBS\raggedleft 10.\+0    \\\cline{1-3}
2018-\/10   &\PBS\raggedleft 10.\+0   &\PBS\raggedleft 11.\+0   \\\cline{1-3}
\end{longtabu}
\hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26449}{}\doxysection{Issues}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26449}
Please report any issues using the \href{https://github.com/SeleniumHQ/selenium/issues}{\texttt{ Selenium issue tracker}}. When using the issue tracker


\begin{DoxyItemize}
\item {\bfseries{Do}} include a detailed description of the problem.
\item {\bfseries{Do}} include a link to a \href{http://gist.github.com/}{\texttt{ gist}} with any interesting stack traces/logs (you may also attach these directly to the bug report).
\item {\bfseries{Do}} include a \href{http://www.webkit.org/quality/reduction.html}{\texttt{ reduced test case}}. Reporting \char`\"{}unable to find     element on the page\char`\"{} is {\itshape not} a valid report -\/ there\textquotesingle{}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.
\item {\bfseries{Do not}} use the issue tracker to submit basic help requests. All help inquiries should be directed to the \href{https://groups.google.com/forum/\#!forum/selenium-users}{\texttt{ user forum}} or \#selenium IRC channel.
\item {\bfseries{Do not}} post empty \char`\"{}\+I see this too\char`\"{} or \char`\"{}\+Any updates?\char`\"{} comments. These provide no additional information and clutter the log.
\item {\bfseries{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.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26450}{}\doxysection{License}\label{md_sfcode_node_modules_selenium_webdriver_README_autotoc_md26450}
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 \char`\"{}\+License\char`\"{}); you may not use this file except in compliance with the License. You may obtain a copy of the License at

\href{http://www.apache.org/licenses/LICENSE-2.0}{\texttt{ http\+://www.\+apache.\+org/licenses/\+LICENSE-\/2.\+0}}

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \char`\"{}\+AS IS\char`\"{} 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. 