Continuous Test Orchestration And Execution Platform Online

Perform automated and live-interactive testing on 3000+ real desktop and mobile devices online.

How do I install Selenium and set up the environment for testing?

To install Selenium and configure the test environment, we'll use the Eclipse IDE to write test scripts, Java as the programming language, and TestNG as the framework. However, you can use your preferred IDE, programming language and testing frameworks.

Following are the steps to install Selenium.

  • Install the latest version of JDK. The JDK contains the JRE (Java Runtime Environment), which is used to write and run Java code. You can get JDK from OpenJDK or Oracle JDK.

  • Once the JDK installation is complete, set the environment variables.

  • Now install the Eclipse IDE. Here we will use Eclipse IDE for Java Developers.

  • Download the Selenium Client Library for Java. Extract the JAR files and save them to a folder.

  • Finally, if you are executing your test scripts on your local machine, you must have its respective browser driver installed. However, if you wish to run test on the cloud, you can skip this step.

Once you have installed Selenium, it’s time to set up your project. For demonstration, we will create a Java project in Eclipse.

  • Open Eclipse IDE and create a Workspace.
  • How do I install Selenium and set up the environment for testing
  • Create a new Java project by going to File > New > Java Project.
  • How do I install Selenium and set up the environment for testing
  • A pop-up window will appear. Enter your Project name, choose a location to save your project, and select Use an execution environment JRE.
  • How do I install Selenium and set up the environment for testing
  • Now, you need to add Selenium API JAR files to your project. Right-click on the project and select Properties.

  • Select Java Build Path and click Add External JARs.
  • How do I install Selenium and set up the environment for testing
  • Add the JARS files for the Selenium Java Client. Navigate to the folder where you extracted the JAR files.
  • How do I install Selenium and set up the environment for testing
  • Once the JARs files are added, click Apply and Close.
  • How do I install Selenium and set up the environment for testing

    You are now ready to write and execute your Selenium scripts.

LambdaTest

Test your websites, web-apps, or mobile apps seamlessly with LambdaTest.

Start Free Testing
LambdaTest

Earn resume-worthy Selenium certifications that help you land a top job.

Learn More
LambdaTest

Test your web or mobile apps

Test orchestration and execution cloud of 3000+ browsers and OS

Support

24/7 support

Security

Enterprise grade security

Cloud

Fastest test execution cloud