How to Configure Selenium in IntelliJ IDEA

Quality Thought – Best Selenium with Java Training Course Institute in Hyderabad

Are you looking to start a successful career in automation testing? Quality Thought is widely recognized as the best Selenium with Java training course institute in Hyderabad. With a proven track record of student success, our program is designed to equip graduates, postgraduates, career changers, and those with an education gap with the most in-demand skills in the field of software testing.

Why Choose Quality Thought for Selenium with Java?

At Quality Thought, we offer a comprehensive Selenium with Java course that includes:

Live intensive internship program with real-time project exposure.

Training conducted by industry experts with years of hands-on experience in automation testing.

Coverage of Core Java, Selenium WebDriver, TestNG, Maven, GitHub, Jenkins, and framework development (POM, Data-Driven, Hybrid).

Hands-on training with regular assignments and mock interviews.

Resume building, job assistance, and placement support.

Whether you are a graduate, postgraduate, someone with an education gap, or a career switcher from a non-IT domain, this course is designed to help you transition smoothly into the IT industry.

How to Configure Selenium in IntelliJ IDEA

Selenium is one of the most widely used automation testing tools for web applications. If you're using IntelliJ IDEA, setting up Selenium is straightforward and efficient. Here's a step-by-step guide to help you get started with Selenium automation in IntelliJ.

Step 1: Install IntelliJ IDEA

Download and install the latest version of IntelliJ IDEA (Community or Ultimate) from JetBrains website.

Step 2: Create a New Project

Open IntelliJ IDEA and click on New Project.

Choose Java and ensure the JDK is selected.

Name your project and click Finish.

Step 3: Add Selenium Library

You can add Selenium dependencies in two ways:

Using Maven:

Right-click the project > Add Framework Support > Maven.

Open the pom.xml and add the following:

xml

<dependencies>

  <dependency>

    <groupId>org.seleniumhq.selenium</groupId>

    <artifactId>selenium-java</artifactId>

    <version>4.20.0</version> <!-- or latest version -->

  </dependency>

</dependencies>

Without Maven (Manual JARs):

Download Selenium JARs from https://www.selenium.dev/downloads.

Right-click on the project > Open Module Settings > Libraries > Add JARs.

Add all Selenium JAR files and click OK.

Step 4: Write Your First Test

Create a Java class and write a simple script:

java

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class SeleniumTest {

  public static void main(String[] args) {

    System.setProperty("webdriver.chrome.driver", "path/to/chromedriver");

    WebDriver driver = new ChromeDriver();

    driver.get("https://www.google.com");

    driver.quit();

  }

}

Step 5: Run and Verify

Click the Run button. Chrome should launch and open Google.

Conclusion

With IntelliJ IDEA and Selenium configured, you're ready to begin automated web testing. Integrate testing frameworks like JUnit or TestNG for advanced test management.

Read More

Setting Up Selenium with Java: A Step-by-Step Guide

What is Selenium? Introduction for Beginners

Introduction to Selenium and Its Components

Visit Our "Quality Thought" Training Institute in Hyderabad


Comments

Popular posts from this blog

Using Implicit vs Explicit Waits in Selenium

Introduction to Selenium and Its Components

Choosing the Right Browser Driver for Selenium