White Antarctica • The Software Design & Development Company

Menu

hamburger

21 Mar 2023 5 min read

How to setup Selenium Web Driver (Java) in VS Code

authorImg

By Mayur Arora

Quality Assurance Engineer

blog hero image

In this article I am going to show you all the steps & files required to setup Selenium Web Driver in VS Code.

This will help you to test an application more easily & efficiently.

VS Code is easy to use & the extensions are like a cherry on the cake.

Just follow the steps below & download the required files from the given link and you should be good to go!

Step 1: Download VS Code

Use the following link: https://code.visualstudio.com/

>> Install & run the application

Step 2: Until the application starts, go to your browser and download the browser driver.

It depends upon which browser driver you want to test on. I am choosing Chrome Driver here so find the below link. https://chromedriver.chromium.org/downloads Download the same driver version present in your system.

Step 3: Download Selenium Web Driver (Java).

Follow the below link & download the marked package: https://www.selenium.dev/downloads/

img

Step 4: Create a separate folder anywhere in the system, and copy both the driver folder & selenium web driver jar folder and paste it in the folder.

This will make easier for you to locate it “in code” & while importing jar file in Referenced Libraries of VS Code.

Step 5:  Download the following Extension for VS Code

Step 6: Once the extension is installed, a new window will open up in VS Code and will ask you to download “Java SDK (Runtime)” in your system.

If you have already installed Java SDK then you don’t need to follow this step. 

Download the Java SDK and install it. Once installed, close the tab and you are good to go. Restart your system for better results (optional)

Step 7: Create a project directory in the system, choose it as the project directory in VS Code. Create a new file & name anything “xyz.java”.

Make sure that you use .java as file extension. 

Step 8: Link the project with the web driver jar files. Go to “Java Projects” & select “+” symbol in Referenced Libraries.

img

Step 9: A new window will open and go the folder where the selenium jar files are present and select all at once and hit “Ok”.

Doing that, all the jar files will be linked to the project which will allow you to write & perform actions according to code we write. It will look like this once you link the files:

img

Step 10: You can start writing Automation Scripts for any website you wish

It works, Hurrah!

If not, we are always available in the comment section below!

##QualityAssurance #AutomationTesting #Selenium #Java #VSCode

like

12 High-Fives

share

Share

authorImg

WRITTEN BY

By Mayur Arora

Quality Assurance Engineer

antarcticaLogo

Antarctica is a software concept, design and development company that builds easy to use applications and architects complex to build ecosystems. We do it for people who believe just like us that fighting climate change isn’t an option, it is our generation’s utmost duty.

So we made it simple: the things we do, the products we build, the services we render, must either protect our mothers or protect Mother Nature. Said otherwise, our mission is to either save lives or save Life, penguins included.

We are the good side of technology. We are Antarctica.

Enjoyed that? Read
more by Mayur Arora

Liked what you read, we think you might also like the following blogs

You may also like!

Liked what you read? We think you might also like the following blogs.