forked from SeleniumHQ/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.html
104 lines (82 loc) · 4.14 KB
/
install.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!doctype html>
<meta charset=utf-8>
<title>Installation</title>
<link rel="icon" href="favicon.ico" type="image/vnd.microsoft.icon">
<link rel="shortcut icon" href="favicon.ico" type="image/vnd.microsoft.icon">
<link rel=stylesheet href=se.css>
<link rel=prev href=intro.html title=Introduction>
<link rel=next href=start.html title="Getting Started">
<script src=docs.js></script>
<h1>Selenium installation</h1>
<p>Selenium setup is quite different from the setup of other commercial tools.
To use Selenium in your automation project you need to install the
language bindings libraries for your language of choice. In addition you will need
WebDriver binaries for the browsers you want to automate and run test on.
<h2>Installing Selenium libraries</h2>
First you need to install the Selenium bindings for your automation project.
The installation process for libraries depends on the language you choose to use.
<h3>Java</h3>
<p> Installation of Selenium libraries for Java can be done using Maven.
Add the <i>selenium-java</i> dependency in your project pom.xml:
<pre><code class=xml><dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.X</version>
</dependency></code></pre>
<p> The <i>selenium-java</i> dependency supports running your automation
project with all Selenium supported browsers. If you want to run tests
only in a specific browser, you can add the dependency for that browser
in your <i>pom.xml</i> file.
For example, you should add following dependency in your <i>pom.xml</i>
file to run your tests only in Firefox:
<pre><code class=xml><dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>3.X</version>
</dependency>
</code></pre>
<p> In a similar manner, if you want to run tests only in Chrome,
you should add the following dependency:
<pre><code class=xml><dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>3.X</version>
</dependency>
</code></pre>
<h3>Python</h3>
Installation of Selenium libraries for Python can be done using pip:
<pre><code class=shell>pip install selenium</code></pre>
Alternatively you can download the
<a href="https://pypi.org/project/selenium/#files">PyPI source archive</a>
(selenium-x.x.x.tar.gz) and install it using <i>setup.py</i>:
<pre><code class=shell>python setup.py install</code></pre>
<h3>C#</h3>
Installation of Selenium libraries for C# can be done using NuGet:
<pre><code class=shell># Using package manager,
Install-Package Selenium.WebDriver
# or using .Net CLI,
dotnet add package Selenium.WebDriver</code></pre>
<h3>Ruby</h3>
Installation of Selenium libraries for Ruby can be done using gem:
<pre><code class=shell>gem install selenium-webdriver</code></pre>
<h3>JavaScript</h3>
Installation of Selenium libraries for JavaScript can be done using npm:
<pre><code class=shell>npm install selenium-webdriver</code></pre>
<h2>Installing WebDriver Binaries</h2>
<p> To execute your project and control browser you need to have
browser-specific WebDriver binaries installed.
<p> Download the <a href=wd.html#quick_reference>WebDriver binary</a>
supported by your browser and place it in the <a href=wd.html#adding_executables_to_your_path>System PATH</a>.
<h2>Installing standalone server</h2>
<p> If you plan to use <a href=grid.html>Selenium Grid</a>
then you should download
<a href=http://www.seleniumhq.org/download/>selenium-server-standalone JAR</a> file.
<i>Selenium-server-standalone</i> jar is never uploaded,
but all the components are available via
<a href=http://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-server/>selenium-server</a>.
The standalone JAR contains everything,
including the remote Selenium server
and the client-side bindings.
This means that if you use the selenium-server-standalone jar
in your project, then you don't have to add selenium-java
or a browser specific jar.