Selenium language bindings allow you to write tests and communicate with browsers in multiple languages:
- Java
- JavaScript
- Python
- Ruby
- C#
In order to start writing tests, you first need to install the bindings for your preferred programming language.
Java (With Maven)
In your test project, add the following to your pom.xml
. Once done, you can either let your IDE (Integrated Development Environment) use Maven to import the dependencies or open a command-prompt, cd
, into the project directory, and run mvn clean test-compile
.
You will need the Java Development Kit (version 8+ for 3.x and 4.x versions of Selenium) and Maven installed on your machine. For more details on Selenium Java bindings, see the API documentation.
JavaScript (npm)
JavaScript offers two different approaches for incorporating Selenium/WebDriver into your tests:
Traditional JavaScript Bindings
You will need Node.js and NPM installed on your machine. For more information about the Selenium JavaScript bindings, check out the API documentation.
WebDriver.IO
WebDriver.IO is a "next-gen" test framework for getting started with WebDriver in JavaScript. It's a fully-featured, W3C-compliant test framework, available with full documentation at webdriver.io.
Python
Use the command below to install the Python bindings for Selenium:
You will need to install Python, pip, and setuptools in order for this to work properly. For more information on the Selenium Python bindings, check out the API documentation.
Ruby
Use the following command to install the Selenium Ruby bindings:
You will need to install a current version of Ruby which comes with RubyGems. You can find instructions for that on the Ruby project website. For more information on the Selenium Ruby bindings, check out the API documentation.
C# (With NuGet)
Use the following commands from the Package Manager Console window in Visual Studio to install the Selenium C# bindings.
You will need to install Microsoft Visual Studio and NuGet to install these libraries and build your project. For more information on the Selenium C# bindings, check out the API documentation.
The remaining examples will show Java demonstrations.
This is a preview of the Getting Started With Selenium Refcard. To read the entire Refcard, please download the PDF from the link above.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}
{{ parent.urlSource.name }}