<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: VeenaDevi123</title>
    <description>The latest articles on DEV Community by VeenaDevi123 (@veenadevi123).</description>
    <link>https://dev.to/veenadevi123</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1002411%2Fb483dcc2-c6e5-47c4-aa1c-3ed05489660e.png</url>
      <title>DEV Community: VeenaDevi123</title>
      <link>https://dev.to/veenadevi123</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/veenadevi123"/>
    <language>en</language>
    <item>
      <title>Selenium Standalone Server and Selenium Server [Differences]</title>
      <dc:creator>VeenaDevi123</dc:creator>
      <pubDate>Fri, 06 Jan 2023 13:54:27 +0000</pubDate>
      <link>https://dev.to/testmuai/selenium-standalone-server-and-selenium-server-differences-1li6</link>
      <guid>https://dev.to/testmuai/selenium-standalone-server-and-selenium-server-differences-1li6</guid>
      <description>&lt;p&gt;Of the many &lt;a href="https://www.lambdatest.com/automation-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;test automation&lt;/a&gt; frameworks available in the market, Selenium is unarguably one of the &lt;a href="https://www.lambdatest.com/blog/best-test-automation-frameworks-2021/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;best test automation frameworks&lt;/a&gt; for web automation testing. Selenium works with any programming language that lets you build tests, including Java, Python, C#, JavaScript, Ruby, etc. It can also be integrated with other automation testing frameworks like JUnit and TestNG for better test management and orchestration. However, to get the 100% out of the Selenium automation testing, knowledge and architecture of its components like Selenium Standalone Server and Selenium Server are very important.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2028%2F0%2AD4-O1qKIOKSQ4inD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2028%2F0%2AD4-O1qKIOKSQ4inD.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This blog helps to understand the difference between Selenium Standalone Server and legacy Selenium Server in detail.&lt;/p&gt;

&lt;p&gt;Let’s get started!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Need a great solution for cross browser testing on Safari? Forget about emulators or simulators — use real online browsers. Try LambdaTest to test on &lt;a href="https://www.lambdatest.com/test-on-safari-browsers?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;safari browsers online&lt;/a&gt;!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Selenium Components
&lt;/h2&gt;

&lt;p&gt;Selenium is a suite of tools with a distinct approach to support automation testing. It provides more than just a base for building an automated testing framework — Selenium is an open-source project with a large community, which means there are many ways to contribute to the project, participate in the discussion and gain valuable knowledge.&lt;/p&gt;

&lt;p&gt;When writing this blog, Selenium has 22.6k Stars and 6.7k Forks on the Selenium GitHub Page. However, when integrating Selenium into your project, you need to consider that there are different ways of doing this. The latest version of Selenium (Selenium 4) has some interesting innovations. &lt;a href="https://www.lambdatest.com/blog/what-is-deprecated-in-selenium4/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium 4&lt;/a&gt; was released in October 2020, with an exciting set of new features:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AU7ZNZ3GeFDgTLrdx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AU7ZNZ3GeFDgTLrdx.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, if you are new to Selenium 4 or want to &lt;a href="https://www.lambdatest.com/blog/upgrade-from-selenium3-to-selenium4/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;migrate from Selenium 3 to Selenium 4&lt;/a&gt;, this video from the &lt;a href="https://www.youtube.com/channel/UCCymWVaTozpEng_ep0mdUyw?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest YouTube Channel&lt;/a&gt; will help you get started with Selenium 4:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/5mmSISPUWUQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;You can follow the channel to stay updated with more videos on &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Testing&lt;/a&gt;, &lt;a href="https://www.lambdatest.com/cypress-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Cypress Testing&lt;/a&gt;, and more.&lt;/p&gt;

&lt;p&gt;Selenium has different components, which helps to achieve multiple purposes like Record and Playback test cases directly from the browser, running test cases in a remote machine, writing script-based test cases in various programming languages, and more.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Aax8NrK753QA6qBLv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Aax8NrK753QA6qBLv.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Selenium IDE
&lt;/h2&gt;

&lt;p&gt;It’s an Integrated Development Environment to record and play AUT directly from the browser. Testers who don’t have scripting knowledge can effectively use this IDE to record their interactions with the AUT and playback any number of times in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.lambdatest.com/support/docs/run-selenium-ide-tests-on-lambdatest-selenium-cloud-grid/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium IDE&lt;/a&gt; is available as a browser extension, and it can only be used with browsers that support extensions. Initially, in Selenium 2, it was available only for the Chrome browser. However, now we can use it with Chrome, Firefox, and Edge browsers. With Selenium 4, the Selenium IDE can also be integrated with &lt;a href="https://www.lambdatest.com/selenium-grid-online?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Cloud Grid&lt;/a&gt; like LambdaTest. This helps in expediting the testing process as Selenium automation tests can be run in parallel on different browsers &amp;amp; OS combinations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2ALoTIVoeWF97glcp9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2ALoTIVoeWF97glcp9.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Test your native, hybrid, and web apps across all legacy and latest mobile operating systems on the most powerful &lt;a href="https://www.lambdatest.com/android-emulator-online?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;online Android emulator&lt;/a&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Selenium WebDriver
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.lambdatest.com/blog/selenium-webdriver-tutorial-with-examples/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium WebDriver&lt;/a&gt; is an Open Source API and a script-based test framework that helps execute the same script in different browsers with the help of browser drivers.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Browser&lt;/th&gt;
&lt;th&gt;Supported OS&lt;/th&gt;
&lt;th&gt;Maintained by&lt;/th&gt;
&lt;th&gt;Download&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Chromium/Chrome&lt;/td&gt;
&lt;td&gt;Windows/macOS/Linux&lt;/td&gt;
&lt;td&gt;Google&lt;/td&gt;
&lt;td&gt;&lt;a href="https://chromedriver.storage.googleapis.com/index.html" rel="noopener noreferrer"&gt;https://chromedriver.storage.googleapis.com/index.html&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Firefox&lt;/td&gt;
&lt;td&gt;Windows/macOS/Linux&lt;/td&gt;
&lt;td&gt;Mozilla&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/mozilla/geckodriver/releases" rel="noopener noreferrer"&gt;https://github.com/mozilla/geckodriver/releases&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edge&lt;/td&gt;
&lt;td&gt;Windows/macOS&lt;/td&gt;
&lt;td&gt;Microsoft&lt;/td&gt;
&lt;td&gt;&lt;a href="https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/" rel="noopener noreferrer"&gt;https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Internet Explorer&lt;/td&gt;
&lt;td&gt;Windows&lt;/td&gt;
&lt;td&gt;Selenium Project&lt;/td&gt;
&lt;td&gt;&lt;a href="https://www.selenium.dev/downloads" rel="noopener noreferrer"&gt;https://www.selenium.dev/downloads&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safari&lt;/td&gt;
&lt;td&gt;macOS High Sierra and newer&lt;/td&gt;
&lt;td&gt;Apple&lt;/td&gt;
&lt;td&gt;Built-in&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Selenium WebDriver can be integrated with TestNG and JUnit test frameworks to achieve parallel execution, manage test scripts, and &lt;a href="https://www.lambdatest.com/blog/how-to-use-testng-reporter-log-in-selenium/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;generate test reports&lt;/a&gt;. To choose the appropriate framework for your test requirements, check out our tutorial on &lt;a href="https://www.lambdatest.com/blog/junit-5-vs-testng/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;JUnit 5 vs. TestNG&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also perform &lt;a href="https://www.lambdatest.com/blog/what-is-continuous-integration-and-continuous-delivery/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Continuous Integration&lt;/a&gt; testing by &lt;a href="https://www.lambdatest.com/blog/build-and-execute-selenium-projects/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;integrating WebDriver with Maven&lt;/a&gt; and Continuous testing with Jenkins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Selenium Grid
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.lambdatest.com/blog/selenium-grid-setup-tutorial/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Grid&lt;/a&gt; is a tool that allows you to manage several different Selenium Server instances on different machines. It makes the process of executing tests in parallel easier and allows you to scale your tests across a number of different nodes.&lt;/p&gt;

&lt;p&gt;Selenium Grid is most commonly used in automated web testing, however, it can be used for any type of test that requires multiple Selenium Server nodes.&lt;/p&gt;

&lt;p&gt;Let’s deep dive into Selenium Grid in the next section:&lt;/p&gt;

&lt;h2&gt;
  
  
  Selenium Standalone Server or Selenium Grid
&lt;/h2&gt;

&lt;p&gt;Selenium Grid facilitates test cases to execute in multiple machines and browsers simultaneously, which fastens the test case execution speed and drastically reduces the turnaround time. In Selenium 3, Selenium Standalone Server (Selenium Grid ) has two different components.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Selenium Hub&lt;/strong&gt;: Hub is a central system that accepts test case requests from clients. It also manages threads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Selenium Node&lt;/strong&gt;: Node registers itself with the hub, and it’s a place where the actual browser exists. A node machine is connected to the hub, which receives test scripts from the hub and executes them. It is also possible to launch several nodes on different devices running different environments.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Aq8UZ74DT5nA_8XY-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Aq8UZ74DT5nA_8XY-.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Selenium 4, the Grid becomes more flexible. For example, once the user starts the server, the Grid automatically works as both nodes and hubs, so the user does not need to start hub and node separately as in &lt;a href="https://www.lambdatest.com/blog/why-selenium-grid-is-ideal-for-automated-browser-testing/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium 3 Grid&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It also supports advanced tools like Docker, which is used in the DevOps process. Now Grid 4 has a more user-friendly UI also.&lt;/p&gt;

&lt;p&gt;There are three ways to run &lt;a href="https://www.lambdatest.com/blog/selenium-grid-4-tutorial-for-distributed-testing/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Grid 4&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Starting as Standalone, Gird itself acts as hub and node.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start as a separate Hub and Node.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fully Distributed (Router, Session, Distributor, etc.)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;A comprehensive end to end Testing tutorial that covers what &lt;a href="https://www.lambdatest.com/learning-hub/end-to-end-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=learning_hub" rel="noopener noreferrer"&gt;e2e testing&lt;/a&gt; is, its importance, benefits, and how to perform it with real-time examples.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Executing Test Cases using Selenium Grid in Standalone mode
&lt;/h2&gt;

&lt;p&gt;In this section of the article, we will see how to execute test cases using Selenium Grid in Standalone mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step1:&lt;/strong&gt; Download Selenium Standalone Server/Grid jar file, i.e., selenium-server-4.1.1.jar&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AnSL-YYHhM4bWgnwc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AnSL-YYHhM4bWgnwc.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;: Start the server as Standalone. Open the terminal and navigate to where the jar file is downloaded, and then type:&lt;br&gt;
“java -jar selenium-server-4.1.1.jar standalone”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;: Now, the local Grid is ready with the attached node and starts to accept and execute test cases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2268%2F0%2AvuBdpiHE7cWFRq29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2268%2F0%2AvuBdpiHE7cWFRq29.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the Server is started, all the available browsers and session details of browsers can be viewed at &lt;a href="http://localhost:4444/ui/index.html#/." rel="noopener noreferrer"&gt;http://localhost:4444/ui/index.html#/.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2ASptd-S5nlU50x-tf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2ASptd-S5nlU50x-tf.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;: To execute test cases, initialize the browser from the grid and invoke via RemoteWebDriver, passing the grid URL and browser capability.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package LambdaTest;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   import java.net.MalformedURLException;
    import java.net.URL;

    import org.openqa.selenium.By;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.remote.CapabilityType;
    import org.openqa.selenium.remote.DesiredCapabilities;
    import org.openqa.selenium.remote.RemoteWebDriver;
    import org.testng.annotations.AfterTest;
    import org.testng.annotations.BeforeTest;
    import org.testng.annotations.Test;

    public class TestCaseRunToGrid {

       public  RemoteWebDriver driver = null;


       @BeforeTest
       public void setUp() throws Exception {

           ChromeOptions options = new ChromeOptions();
            options.setAcceptInsecureCerts(true);
            options.setCapability(CapabilityType.BROWSER_NAME,"chrome");

           try {
             driver = new RemoteWebDriver(new URL("http://localhost:4444"), options);

           } catch (MalformedURLException e) {
               System.out.println("Invalid grid URL");
           } catch (Exception e) {
               System.out.println(e.getMessage());
           }
       }

       @Test
       public void firstTestCase() {
           try {
               System.out.println("Logging into Lambda Test Selenium PlayGround page ");
               driver.get("https://www.lambdatest.com/selenium-playground/simple-form-demo");
               WebElement messageText=driver.findElement(By.cssSelector("input#user-message"));
               messageTextBox.sendKeys("Welcome to cloud grid");

               WebElement getValueButton = driver.findElement(By.cssSelector("#showInput"));
               getValueButton.click();
               System.out.println("Clicked on the Get Checked Value button");
           } catch (Exception e) {

           }
        }

       @AfterTest
       public void closeBrowser() {
           driver.close();
           System.out.println("The driver has been closed.");
       }

    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Code Walkthrough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2A7Pligl-Qt8FOfK6O.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2A7Pligl-Qt8FOfK6O.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this code block, I have used one of the most popular &lt;a href="https://www.lambdatest.com/blog/a-complete-guide-for-your-first-testng-automation-script/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;test automation frameworks, TestNG&lt;/a&gt;. TestNG is a java based framework designed for Unit, Functional, and End to End testing. If you are new to TestNG, you can go through this &lt;a href="https://www.lambdatest.com/learning-hub/testng?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium TestNG Tutorial&lt;/a&gt; to get started with your &lt;a href="https://www.lambdatest.com/blog/a-complete-guide-for-your-first-testng-automation-script/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;first TestNG automation script&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With &lt;a href="https://www.lambdatest.com/blog/asserts-in-testng/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;TestNG Assertions&lt;/a&gt; and Annotations, you can &lt;a href="https://www.lambdatest.com/blog/grouping-test-cases-in-testng/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;group and orchestrate&lt;/a&gt; the large test case execution, validate the expected result, and execute test cases in parallel.&lt;/p&gt;

&lt;p&gt;@BeforeTest is the &lt;a href="https://www.lambdatest.com/blog/complete-guide-on-testng-annotations-for-selenium-webdriver/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;TestNG Annotation&lt;/a&gt; that executes the statements before each TestMethod runs. Prerequisites for each test method like launching the browser, configuring browser parameters, launching the application URL, setting browser properties kind of statements can be included in this code block.&lt;/p&gt;

&lt;p&gt;In Selenium 3, DesiredCapabilities Class helps to set up properties of the browser. However, the DesiredCapabilities Class is replaced by Options in Selenium 4.&lt;/p&gt;

&lt;p&gt;Each browser has a respective Option Class that provides methods to change the browser’s properties such as cookies, incognito, headless, disabling pop-ups, and adding extensions.&lt;/p&gt;

&lt;p&gt;Here is the Options object that would be used for setting the browser-specific capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Chrome — ChromeOptions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Firefox — FirefoxOptions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Internet Explorer (IE) — InternetExplorerOptions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Safari — SafariOptions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Microsoft Edge — EdgeOptions&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RemoteWedDriver is a Class with all driver classes like ChromeDriver, EdgeDriver, FirefoxDriver, InternetExplorerDriver, OperaDriver, SafariDriver as SubClass.&lt;/p&gt;

&lt;p&gt;To use this Class, we have to import the “org.openqa.selenium.remote” package.&lt;br&gt;
The RemoteWebDriver accepts two parameters, one is the hub URL, and the other one is an object of Browser Option. Here, I have launched Chrome browser using ChromeOption object, which provides the property of the browser to launch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AmOHPKzF5oG6i8kNS.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AmOHPKzF5oG6i8kNS.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/test"&gt;@test&lt;/a&gt; Annotation is one of the most important TestNG Annotations, which drives a simple Java method as a test case.&lt;/p&gt;

&lt;p&gt;WebElement is a Selenium class, where the driver.findElement returns a WebElement object. Here, the Elements can be identified using multiple locator strategies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.lambdatest.com/blog/locators-in-selenium-webdriver-with-examples/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Locators&lt;/a&gt; makes it easy to locate elements on a webpage and perform actions on them, which helps to ease the process of Selenium Automation Testing.&lt;/p&gt;
&lt;h3&gt;
  
  
  Advantages of Selenium Standalone Server
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Helps to handle test execution in the distributed way either in VM or &lt;a href="https://www.lambdatest.com/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Cloud Selenium Grid&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Helps to perform &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;cross browser test automation&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can achieve &lt;a href="https://www.lambdatest.com/blog/parallel-test-execution-in-testng/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;parallel execution&lt;/a&gt; using Selenium Cloud Grid, where you can execute multiple test cases in parallel in different environments.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Limitations of working on local Selenium Grid
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Initial setup of various nodes in different OS, browser, browser versions and setting up devices for mobile testing is burdensome for the QA team. It requires skilled resources to set up Hub and Node in various environments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The performance also wholly depends on the Server/VM used to set up nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It’s tough to scale down or up the number of nodes on demand.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Selenium Cloud Grid is the best solution to overcome all these shortcomings of the local grid.&lt;/p&gt;

&lt;p&gt;Watch this video to learn about collecting performance metrics in Selenium 4 using the Chrome DevTools Protocol on the LambdaTest platform.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/w7xkMk-0Yg0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Why do we need Selenium Cloud Grid?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Easy maintenance — the team doesn’t need to take any hassle to maintain the software or hardware needs of servers for node setup.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability — easy to manage the number of nodes/parallel execution&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reliability — Cloud servers have near-perfect availability, so there is a low risk of interruption.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;A complete Manual testing tutorial covering all aspects of &lt;a href="https://www.lambdatest.com/learning-hub/manual-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=learning_hub" rel="noopener noreferrer"&gt;manual testing&lt;/a&gt;, including strategies and best practices.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Executing Test Cases using cloud Selenium Grid
&lt;/h2&gt;

&lt;p&gt;This needs a minor update on code snippets, where the localhost gets to communicate with &lt;a href="https://www.lambdatest.com/selenium-grid-online?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Cloud Grid&lt;/a&gt; like LambdaTest and access the URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: &lt;a href="https://accounts.lambdatest.com/login?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Register on LambdaTest&lt;/a&gt; and get the Username and Access Key from the &lt;a href="https://accounts.lambdatest.com/login?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest Profile Section&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    package LambdaTest;

    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.HashMap;

    import org.openqa.selenium.By;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.chrome.ChromeOptions;
    import org.openqa.selenium.firefox.FirefoxOptions;
    import org.openqa.selenium.remote.CapabilityType;
    import org.openqa.selenium.remote.DesiredCapabilities;
    import org.openqa.selenium.remote.RemoteWebDriver;
    import org.testng.annotations.AfterTest;
    import org.testng.annotations.BeforeTest;
    import org.testng.annotations.Test;

    public class TestCaseRunToCloudGrid {

       public  RemoteWebDriver driver = null;

       public String username = "";//LambdaTest userName
       public String accesskey = "";//LambdaTest Accesskey
       public String gridURL = "@hub.lambdatest.com/wd/hub";

       @BeforeTest
       public void setUp() throws Exception {

       DesiredCapabilities capabilities = new DesiredCapabilities();
       capabilities.setCapability("browserName", "Chrome");
       capabilities.setCapability("browserVersion", "97.0");
       HashMap&amp;lt;String, Object&amp;gt; ltOptions = new HashMap&amp;lt;String, Object&amp;gt;();
       ltOptions.put("user",username);
       ltOptions.put("accessKey",accesskey);
       ltOptions.put("build", "Selenium 4 grid Sample");
       ltOptions.put("name", "Selenium 4 grid Sample");
       ltOptions.put("platformName", "Windows 11");
       ltOptions.put("selenium_version","4.0.0");
       capabilities.setCapability("LT:Options", ltOptions);
           try {
               driver = new RemoteWebDriver(new URL("https://" + username + ":" + accesskey + gridURL),capabilities);
           } catch (MalformedURLException e) {
               System.out.println("Invalid grid URL");
           } catch (Exception e) {
               System.out.println(e.getMessage());
           }
       }

       @Test
       public void firstTestCase() {
           try {
               System.out.println("Logging into Lambda Test Selenium PlayGround page ");
               driver.get("https://www.lambdatest.com/selenium-playground/simple-form-demo");
               WebElement messageTextBox = driver.findElement(By.cssSelector("input#user-message"));
               messageTextBox.sendKeys("Welcome to cloud grid");

               WebElement getValueButton = driver.findElement(By.cssSelector("#showInput"));
               getValueButton.click();
               System.out.println("Clicked on the Get Checked Value button");
           } catch (Exception e) {

           }
        }

       @AfterTest
       public void closeBrowser() {
           driver.close();
           System.out.println("The driver has been closed.");
       }

    }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Code Walkthrough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2144%2F0%2As6jUeZHf2uE8tIEE.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2144%2F0%2As6jUeZHf2uE8tIEE.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These public variables store the values for the LambdaTest username, key, and hub URL to execute the test case in Cloud Grid.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AcIK87L2U4k61HH9J.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AcIK87L2U4k61HH9J.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How the cloud grid understands the browser properties needs to be changed to scale up from local Grid to Selenium Cloud Grid. Here, only the hub URL and capabilities need to be updated by generating capabilities from &lt;a href="https://www.lambdatest.com/capabilities-generator/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest Capability Generator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Selenium testing tools like LambdaTest allows you to perform &lt;a href="https://www.lambdatest.com/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;cross browser testing&lt;/a&gt; at scale. &lt;a href="https://www.lambdatest.com/list-of-browsers?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;list of browsers&lt;/a&gt; provides 3000+ browsers with a combination of different OS and versions. The ltOptions map here stores all the browser properties required to launch the browser from the cloud hub.&lt;/p&gt;

&lt;p&gt;RemoteWebDriver accepts two parameters, one as a Hub URL with credentials and the second one as a Capability object which has all the properties about the browser to launch. Here it is Windows 11 OS, Chrome Browser version 97.0.&lt;/p&gt;

&lt;p&gt;Once the code is executed, you can also view your test results, logs, and the test recording as well in your &lt;a href="https://accounts.lambdatest.com/login?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest Automation Dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AH83sCeNkx1bU0JeI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AH83sCeNkx1bU0JeI.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also see the test results on the &lt;a href="https://analytics.lambdatest.com/test-overview?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest Analytics Dashboard&lt;/a&gt;. The dashboard shows all the details and metrics related to your tests under the Test Overview and Test Summary section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AcnHB5zbZuctxf3fB.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AcnHB5zbZuctxf3fB.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you’re a software developer or tester with an interest in Selenium automation testing, this Selenium 101 certification course can help you develop your skillset.&lt;/p&gt;

&lt;p&gt;Here’s a short glimpse of the Selenium 101 certification from LambdaTest:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/qx9FPFfJm7E"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;A comprehensive UI testing tutorial that covers what &lt;a href="https://www.lambdatest.com/learning-hub/ui-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=learning_hub" rel="noopener noreferrer"&gt;ui testing&lt;/a&gt; is, its importance, benefits, and how to perform it with real-time examples.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Selenium Server
&lt;/h2&gt;

&lt;p&gt;The Selenium server in Selenium 2 is entirely different from what we call Selenium Standalone Server/&lt;a href="https://www.lambdatest.com/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Grid&lt;/a&gt; in Selenium 4 and Selenium 3.&lt;/p&gt;

&lt;p&gt;Selenium Remote Control (RC) was the main Selenium project that stood for a long time before Selenium WebDriver(Selenium 2.0) came into existence. But unfortunately, it depreciated due to its complex JavaScript layers and redundant API.&lt;/p&gt;

&lt;h2&gt;
  
  
  Selenium RC components
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Client libraries for scripting language binding&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Selenium Server to launch and interact with the browser&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A2ksyp0xtFBTKi0DC.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A2ksyp0xtFBTKi0DC.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Selenium server helps to execute Selenium RemoteControl client scripts. Now it’s completely deprecated, and we don’t have the option to download this jar itself.&lt;br&gt;
However, when we look into older versions to better understand, To execute RemoteControl scripts, we need to start the Selenium Server first.&lt;/p&gt;

&lt;p&gt;Here, I have mentioned a RemoteControl script, which executes the code in the local Selenium server, using LocalHost.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2744%2F0%2AETxLDSgI0fL6eB2P.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2744%2F0%2AETxLDSgI0fL6eB2P.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Difference Between Selenium Standalone Server and Selenium Server
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Selenium Standalone Server&lt;/th&gt;
&lt;th&gt;Selenium Server&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Supports WebDriver scripts&lt;/td&gt;
&lt;td&gt;Selenium RC commands/scripts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;It can launch up to 5 browsers, so it supports parallel execution&lt;/td&gt;
&lt;td&gt;Executes on only one browser at a time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Supports headless browser and fasten the execution&lt;/td&gt;
&lt;td&gt;Headless htmlUnit browsers are not supported.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;In this Ad hoc testing tutorial, let’s deep dive into what &lt;a href="https://www.lambdatest.com/learning-hub/ad-hoc-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=learning_hub" rel="noopener noreferrer"&gt;ad hoc testing&lt;/a&gt; is, its advantages, disadvantages, types, characteristics, and their best practices.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we have seen the difference between Selenium Standalone Server and Selenium Server. Understanding the difference between Selenium Standalone server and Legacy Selenium Server helps use the Selenium Grid effectively either in local, distributed mode or in &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan06_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Cloud Selenium Grid&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>tutorial</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>How To Build And Execute Selenium Projects</title>
      <dc:creator>VeenaDevi123</dc:creator>
      <pubDate>Thu, 05 Jan 2023 15:18:56 +0000</pubDate>
      <link>https://dev.to/testmuai/how-to-build-and-execute-selenium-projects-1154</link>
      <guid>https://dev.to/testmuai/how-to-build-and-execute-selenium-projects-1154</guid>
      <description>&lt;p&gt;Building and executing &lt;a href="https://www.lambdatest.com/blog/top-selenium-open-source-projects-on-github/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium projects&lt;/a&gt; with automation platforms is a powerful way to test websites (or web apps) at a faster pace. By using &lt;a href="https://www.lambdatest.com/automation-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;automation testing tools&lt;/a&gt;, you can test faster, more often, and more accurately.&lt;/p&gt;

&lt;p&gt;The most important and time-consuming tasks in the entire &lt;a href="https://www.lambdatest.com/blog/all-you-need-to-know-about-automation-testing-life-cycle/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;test automation cycle&lt;/a&gt; include managing test scripts, reusable components (scripts, utilities like data provider), test data, test results, setting up the test execution environment, etc. As per my experience, enterprises (irrespective of their scale or size) need to &lt;a href="https://www.lambdatest.com/blog/starting-automation-testing-from-scratch-here-is-what-you-need-to-know/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;transition from manual to automation testing&lt;/a&gt;. But does that mean that manual testing can be taken over by automation testing? Definitely not! Exploratory testing is still the ideal candidate for manual testing.&lt;/p&gt;

&lt;p&gt;It makes technical and business sense to get started with automation testing, especially for areas where it can have the maximum impact! However, the main challenge is to build a manageable project with better orchestration of scripts that can make peer QA folk’s life easier:) It seems like a complex saying, but in simple terms, it is referred to as the &lt;a href="https://www.lambdatest.com/selenium?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium test automation framework&lt;/a&gt;. Throughout my career in pre-sales and testing, I have realized that Selenium is still the go-to framework for web automation testing. In my opinion, &lt;a href="https://www.lambdatest.com/blog/cypress-vs-selenium-comparison/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Cypress vs Selenium&lt;/a&gt; comparison will always be relevant in the field of web testing 🙂&lt;/p&gt;

&lt;p&gt;The Selenium automation framework doesn’t need special servers to execute Selenium test cases. It can also be easily integrated with other frameworks like TestNG, JUnit, Maven, Gradle, or Ant build tools. The potential offered by Selenium gets amplified when integrated with a popular CI/CD tool like Jenkins. &lt;a href="https://www.lambdatest.com/blog/what-is-jenkins/#Demonstration?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium integration with Jenkins&lt;/a&gt; can go a long way in expediting the TTM by leveraging the benefits offered by Continuous Testing.&lt;/p&gt;

&lt;p&gt;Before we get into building and executing Selenium projects, you can learn about &lt;a href="https://www.lambdatest.com/blog/selenium-webdriver-tutorial-with-examples/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;basic selenium commands&lt;/a&gt; and &lt;a href="https://www.lambdatest.com/blog/locators-in-selenium-webdriver-with-examples/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;locator strategies&lt;/a&gt; to interact with web elements. This tutorial focuses on building and executing Selenium Java projects. Though the demonstration is performed on macOS, replicating the same steps for Windows OS is not challenging!&lt;/p&gt;

&lt;p&gt;So, let’s get started!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Run &lt;a href="https://www.lambdatest.com/appium-mobile-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;Appium&lt;/a&gt; mobile testing of native and web apps. Improve your app quality with instant access to real devices on LambdaTest. Register now for free!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to build a Selenium project?
&lt;/h2&gt;

&lt;p&gt;Selenium is a growing open-source &lt;a href="https://www.lambdatest.com/automation-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;test automation&lt;/a&gt; framework that can be considered a great boon to the web development industry. However, when it comes to integrating Selenium into your project, you need to be aware that there are different ways of doing this. I am personally excited about the major advancements happening in &lt;a href="https://www.lambdatest.com/learning-hub/selenium-4?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium 4&lt;/a&gt;. However, I would limit the discussion in this blog limited to Selenium 3.&lt;/p&gt;

&lt;p&gt;In this section, I will showcase setting up the Selenium Java with Maven. If you are new to Selenium and want to know &lt;a href="https://www.lambdatest.com/selenium?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;what is Selenium&lt;/a&gt;, here’s a short explanation about the same:&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Selenium?
&lt;/h2&gt;

&lt;p&gt;Selenium is the most popular open-source framework for cross-browser and cross-platform testing of web applications. It is a suite that allows you to write automated tests of websites and web applications, then execute them in different browsers on multiple platforms using any programming language of your choice.&lt;/p&gt;

&lt;p&gt;Here are the major components of the &lt;a href="https://www.lambdatest.com/selenium?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium framework&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.lambdatest.com/blog/run-selenium-ide-test-on-online-selenium-grid/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;&lt;strong&gt;Selenium IDE&lt;/strong&gt;&lt;/a&gt; is a browser plugin that lets you write, execute, and debug your Selenium scripts. Selenium IDE in the latest version of Selenium is available for Chrome and Firefox web browsers. The current release of Selenium IDE is more than a simple Playback &amp;amp; Record tool since it lets you export the script in Selenium-supported programming. Hence, you can get the automation tests without writing a single line of code. In a nutshell, Selenium IDE alleviates these problems by conveniently recording and running tests directly from the browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.lambdatest.com/blog/selenium-webdriver-tutorial-with-examples/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;&lt;strong&gt;Selenium WebDriver&lt;/strong&gt;&lt;/a&gt; is a collection of open-source APIs that ease you write test scripts. You can write Selenium test scripts in popular programming languages like Python, JavaScript, Java, C#, PHP, and Ruby. It has been designed to assist in the automation of testing processes, therefore increasing productivity and accuracy. The browser-specific drivers bind with popular programming languages and provide an interface to write and execute the browser automation scripts for testing web applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.lambdatest.com/blog/why-selenium-grid-is-ideal-for-automated-browser-testing/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;&lt;strong&gt;Selenium Grid&lt;/strong&gt;&lt;/a&gt; is another tool included in the Selenium suite, which helps scale and distribute the test scripts across multiple browsers and operating systems or platforms. It’s possible to run the same test script on multiple browsers simultaneously using Selenium Grid. This not only reduces the execution time but also ensures that your application works well on all browsers, operating systems, and platforms without any issues.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Selenium Grid also lets you perform parallel testing across different browsers and operating systems (or platforms). As a result, the Selenium Grid is the go-to solution to realize the benefits of &lt;a href="https://www.lambdatest.com/blog/what-is-parallel-testing-and-why-to-adopt-it/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;parallel testing in Selenium&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Though a local Selenium Grid is good to start with, test efforts cannot be scaled exponentially when using a local Grid. This is where cloud Selenium Grid can be beneficial in reaping the immense benefits offered by Cloud and Selenium. &lt;a href="https://www.lambdatest.com/blog/selenium-remotewebdriver/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Remote WebDriver in Selenium&lt;/a&gt; is used for connecting with the cloud Selenium Grid.&lt;/p&gt;

&lt;p&gt;A &lt;a href="https://www.lambdatest.com/automation-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;cloud Selenium Grid&lt;/a&gt; like LambdaTest lets you perform &lt;a href="https://www.lambdatest.com/feature?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium automation testing&lt;/a&gt; at scale on a secure, reliable, and scalable grid on the cloud. &lt;em&gt;On a lighter note, you can bid adieu to the endless woes of maintaining a local Grid :D.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you are a Selenium fanatic, you must have tried Selenium 4. Selenium 4 is the latest version of the Selenium WebDriver and has rewritten the Selenium project from the ground up to become leaner and faster.&lt;/p&gt;

&lt;p&gt;With the latest Selenium 4, you have the added luxury of using a comprehensive and user-friendly IDE, an advanced web locator system, and an up-to-date REST API.&lt;/p&gt;

&lt;p&gt;The new standard for the &lt;a href="https://www.lambdatest.com/blog/selenium4-w3c-webdriver-protocol/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;W3C WebDriver in Selenium 4&lt;/a&gt; is an architectural change from Selenium 3. This new interface is meant to be more stable and less flaky than previous versions. The creators of Selenium are working to make sure this change happens smoothly for everyone using their framework.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2yg8b5xhp9tjlqeb5pi3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2yg8b5xhp9tjlqeb5pi3.png" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, if you are intrigued to know more about &lt;a href="https://www.lambdatest.com/blog/what-is-deprecated-in-selenium4/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;what’s new in Selenium 4&lt;/a&gt;, you can go through the following &lt;a href="https://www.lambdatest.com/learning-hub/selenium-4?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium 4 tutorial&lt;/a&gt; for beginners and professionals to know more about the features and improvements in Selenium 4.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Mmp_FiNIYtQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;You can also go through the &lt;a href="https://www.youtube.com/channel/UCCymWVaTozpEng_ep0mdUyw?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest YouTube Channel&lt;/a&gt; to stay updated with more videos on &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Testing&lt;/a&gt;, Cypress Testing, and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;In this XCUITest tutorial, learn about XCUITest framework and its benefits for mobile automation testing. Take a look at how &lt;a href="https://www.lambdatest.com/xcuitest?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;XCUITest&lt;/a&gt; works and see how to use it to test your mobile applications.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Build and Execute Selenium projects using Java?
&lt;/h2&gt;

&lt;p&gt;To build a Selenium project using Java Client libraries, you first need to ready your system by installing Java and any IDE (Integrated Development Environment) of your choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Java in Mac OS
&lt;/h2&gt;

&lt;p&gt;Since we are using Java to build a Selenium project, we need to install Java or JDK.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Download the latest version of Java. (At the time of writing this blog, the latest version is Java SE 17)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbtpcmka66bbwq8qwy1nt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbtpcmka66bbwq8qwy1nt.png" width="512" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Double-click the .dmg file and complete the installation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fer4hf5axxwg0pdvs7ah3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fer4hf5axxwg0pdvs7ah3.png" width="512" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Open the terminal once the installation completes and type &lt;strong&gt;java -version&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AykuDXhV_z79vaPWL.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AykuDXhV_z79vaPWL.png" width="512" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you have installed Java, you can install any IDE of your choice. IDE is a software that serves developers by providing them tools to design and program their applications. You can write your Selenium Java Code in different IDEs like Eclipse, IntelliJ IDEA, NetBeans, etc. Each IDE has its unique features and plugins to support developers. However, for our Selenium project, we will use IntelliJ IDEA.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Get started with this complete Selenium automation testing tutorial. Learn what &lt;a href="https://www.lambdatest.com/selenium?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;Selenium guide&lt;/a&gt; is, its architecture, advantages and more for automated cross browser testing. Read more.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing IntelliJ IDEA in Mac OS
&lt;/h2&gt;

&lt;p&gt;I will demonstrate the Selenium Project in IntelliJ IDEA (community-based IDE) for developing Java and other JVM languages like Kotlin and Scala-based software programming.&lt;/p&gt;

&lt;p&gt;You can download the community version of IntelliJ, which is free and can be downloaded from the JetBrain website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Download and install IntelliJ IDEA on your system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AupIJUgKkNMwEOqOk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AupIJUgKkNMwEOqOk.png" width="512" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Once installation completes, open the IDE and click &lt;strong&gt;New Project&lt;/strong&gt; from the home page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AmDnMenvI4DoYndzH.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AmDnMenvI4DoYndzH.png" width="512" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; On the project template page, click &lt;strong&gt;Next&lt;/strong&gt;, and then on the next screen, mention Project name, Project location, and click &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2ALxk2qAnL8zksiHUM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2ALxk2qAnL8zksiHUM.png" width="512" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Done !. Our first Java project was created successfully. Next, write Java code in the &lt;strong&gt;&lt;em&gt;src&lt;/em&gt;&lt;/strong&gt; folder shown on the navigation bar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Ak7LBQDorecDbH_8_.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Ak7LBQDorecDbH_8_.png" width="449" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up Selenium Libraries in Java project
&lt;/h2&gt;

&lt;p&gt;To add Selenium to the Java project, you need to set up Selenium libraries in the project’s CLASSPATH. You need to add TestNG libraries to get better reports and test orchestration in our project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Download the required Selenium libraries and Selenium Server from the Selenium home page.&lt;/p&gt;

&lt;p&gt;Along with Selenium WebDriver libraries, adding any &lt;a href="https://www.lambdatest.com/blog/top-10-java-testing-frameworks/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Java test automation frameworks&lt;/a&gt; like TestNG, JUnit will further enhance test data management and help on parallel execution and report generation. For example, I have used the TestNG framework to manage test cases and reports in this blog.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Download the TestNG jar file and save it in a local folder. TestNG has a wide range of Annotations and Listeners, which helps organize test case execution and manage logs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; In IntelliJ IDEA, click &lt;em&gt;File&lt;/em&gt; -&amp;gt; &lt;em&gt;Project Structure&lt;/em&gt; -&amp;gt; &lt;em&gt;Modules&lt;/em&gt;. Click the dependencies tab from the right panel, click &lt;em&gt;+&lt;/em&gt; sign, and select JARs or Directories.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AjXc4WQp-eTJKwqgY.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AjXc4WQp-eTJKwqgY.png" width="512" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Browse and select all files, including TestNG jar and jar files extracted from the selenium-java-4.x.x.zip file and click &lt;strong&gt;&lt;em&gt;Apply&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;Ok&lt;/em&gt;&lt;/strong&gt;. Now you will see all libraries listed under Project’s &lt;strong&gt;&lt;em&gt;External Libraries&lt;/em&gt;&lt;/strong&gt; section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A5Fr-QthRubSW4qRx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A5Fr-QthRubSW4qRx.png" width="348" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our project is now ready to write Selenium test cases. Let’s write a simple test case to launch a web application and validate its title using TestNG.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; In IntelliJ IDEA, right-click on the src folder click &lt;em&gt;New -&amp;gt; Java Class&lt;/em&gt;&lt;em&gt;.&lt;/em&gt;** Create a new Java class, “&lt;strong&gt;SeleniumSampleTest&lt;/strong&gt;.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Write a simple script to validate the title of the &lt;a href="https://www.lambdatest.com/selenium-playground/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest Selenium Playground&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AF2usxZXJGoosu43y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AF2usxZXJGoosu43y.png" width="512" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Snippet&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Mentioning a comment in your code is one of the best practices in Java programming language, which other team members can take up without any assistance to use or extend.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.testng.Assert;
    import org.testng.annotations.Test;

    public class SeleniumSampleTest {
       @Test
     public void checkTest(){
        //set up Chrome Exe path
           //Launch Browser
        WebDriver driver= new ChromeDriver();
                   //Launch URL
        driver.get("https://www.lambdatest.com/selenium-playground/");
         //Define Expected Title Value
        String expectedTitle="Selenium Grid Online | Run Selenium Test On Cloud";
        //Validate using TestNG Assertion
        Assert.assertEquals(driver.getTitle(),expectedTitle,"Title doesn't match");

     }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Code Walkthrough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AROhjQDO44qj4OmmI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AROhjQDO44qj4OmmI.png" width="512" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This statement initializes the driver object and launches the Chrome Browser. Here I haven’t mentioned the path of the ChromeDriver.exe file explicitly. Let me show how to set up the ChromeDriver path in Mac System-Path, so Selenium WebDriver picks the ChromeDriver path automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Download the ChromeDriver file depending on the system from the official Selenium download. For this project, I am using Chrome browser version 96.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AMIDdxL6gT0Orf_Ws.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AMIDdxL6gT0Orf_Ws.png" width="512" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Unzip the chromedriver_mac64.zip to get the chromdriver.exe file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Open Finder in Mac, click &lt;strong&gt;&lt;em&gt;Go&lt;/em&gt;-&amp;gt;*Go to Folder&lt;/strong&gt;,* and type */usr/local/bin. *In this folder, paste the chromedriver.exe file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;: Open the test URL using the &lt;em&gt;get()&lt;/em&gt; command in Selenium.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AZ1cpNuYCW0xTFzAC.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AZ1cpNuYCW0xTFzAC.png" width="512" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AQmQepBe11AsNTXAq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AQmQepBe11AsNTXAq.png" width="512" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here the string expectedTitle variable stores the expected test data for the page title.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.lambdatest.com/blog/asserts-in-testng/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;TestNG Assertions&lt;/a&gt; validate the actual result fetched from the application against the expected result (Test Data). Here, the assertEquals accept three parameters: actual result, expected result, and the message, which describes the failure if the page title does not match the expected title.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Are you using Playwright for automation testing? Run your &lt;a href="https://www.lambdatest.com/playwright-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;Playwright&lt;/a&gt; test scripts instantly on 50+ browser/OS combinations using the LambdaTest cloud. Sign up for free!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Execute TestNG Class
&lt;/h2&gt;

&lt;p&gt;IntelliJ IDEA may not generate TestNG reports by default. Check the below configuration before executing the test case.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Right-click project -&amp;gt; &lt;em&gt;Modify Run Configuration&lt;/em&gt; -&amp;gt; under *Listener *select *use default reporters *check box.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AxvGxoJTL3dx2Yr2L.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AxvGxoJTL3dx2Yr2L.png" width="512" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Once done, right-click the Class file name and click &lt;strong&gt;“&lt;/strong&gt;&lt;em&gt;Run ‘SeleniumSampleTest&lt;/em&gt;’&lt;strong&gt;”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AjKpxcLcrTDSTVawg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AjKpxcLcrTDSTVawg.png" width="334" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Execution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once execution completes, results can be seen in the Log panel. Even though we didn’t create any suite file, the default suite file gets generated in the system temp folder, adds test class, and executes test methods.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A-2jzJA9q2_uzMF-E.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A-2jzJA9q2_uzMF-E.png" width="512" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TestNG generates an emailable-report.html file as a test report.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AZynxF3cdSlkFF0q0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AZynxF3cdSlkFF0q0.png" width="512" height="509"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can open that in the browser and also can share it with stakeholders.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Act53BHgdgFA742c6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Act53BHgdgFA742c6.png" width="512" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Build and Execute Selenium projects using Maven?
&lt;/h2&gt;

&lt;p&gt;Maven is a project management tool that uses POM.xml. In the previous section, we manually downloaded Selenium and TestNG jar files and set up CLASSPATH in IDE. However, that is not the best approach to realize web automation testing using Java and Selenium. Therefore, it is recommended to use Maven for dependency management, which will download and manage the required &lt;em&gt;jar&lt;/em&gt; files for the project.&lt;/p&gt;

&lt;p&gt;If you are not familiar with Maven, you can refer to the &lt;a href="https://www.lambdatest.com/blog/getting-started-with-maven-for-selenium-testing/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Maven tutorial&lt;/a&gt; before proceeding with the further sections of this blog. In my case, I would be using the macOS to demonstrate running a full-fledged Selenium Java project. If you are using Python (a popular programming language for automation testing and web scraping), this &lt;a href="https://www.lambdatest.com/blog/getting-started-with-selenium-python/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Python tutorial&lt;/a&gt; will help you get started with Python and Selenium.&lt;/p&gt;

&lt;p&gt;In the interest of time, I will be limiting this blog to only Java with Selenium 🙂&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Maven in macOS
&lt;/h2&gt;

&lt;p&gt;Apache Maven is an open-source project management and comprehension tool that helps software developers build, manage and maintain their projects. Installing Maven in your Operating System is an important step to deploy and execute Java programs. You can follow the below-mentioned steps to install Maven in macOS:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Install Maven via Homebrew. Homebrew is a package manager for macOS which lets you install free and open-source software using your terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; To Install Homebrew, open the terminal window and paste the below command:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AOAplpanfH6hQPSfZ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AOAplpanfH6hQPSfZ.png" width="512" height="110"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Once Installed, Open the new terminal window, and type &lt;strong&gt;brew install maven&lt;/strong&gt;. It will install the latest Maven&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Once the installation completes, open the new terminal and type &lt;strong&gt;mvn –version&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A8wAwFr-PLwMmnKo9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A8wAwFr-PLwMmnKo9.png" width="512" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;**Note:&lt;/em&gt;* Installation of Maven in Windows is pretty straightforward. You just need to download, unzip, and set the path in the System Path.*&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;New &lt;a href="https://www.lambdatest.com/blog/selenium-ide-what-is-it-why-is-it-must-for-every-qa/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium IDE&lt;/a&gt; supports cross browser testing and parallel tests for automation along with record and replay function. Here’s why you shouldn’t miss out on it!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Maven project in IntelliJ IDEA
&lt;/h2&gt;

&lt;p&gt;IntelliJ IDEA supports an integration with Maven that helps automate our building Selenium Java project. Therefore, we don’t need any additional setup or configuration in IntelliJ IDEA.&lt;/p&gt;

&lt;p&gt;The video shown below highlights the getting started guide of IntelliJ IDEA IDE with Selenium JUnit framework.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/cggWYDNDrAw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; From the IntelliJ IDEA Home page, click &lt;strong&gt;&lt;em&gt;New Project&lt;/em&gt;&lt;/strong&gt; -&amp;gt; select &lt;strong&gt;&lt;em&gt;Maven&lt;/em&gt;&lt;/strong&gt; from the left panel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2ApVs3NuHvr2Nec7q5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2ApVs3NuHvr2Nec7q5.png" width="512" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Click &lt;strong&gt;&lt;em&gt;Next&lt;/em&gt;&lt;/strong&gt; and mention the Project name ( FirstSeleniumMavenProject).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Group Id&lt;/strong&gt; corresponds to your organization’s name, product name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Artifact Id&lt;/strong&gt; refers to the project name. It is the jar file name when we package our project.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here, you can see that the default project structure and POM.xml file are in the newly created Maven Project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AT3I5A6pU9db45C6O.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AT3I5A6pU9db45C6O.png" width="512" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We add TestClass files or other Java files under &lt;strong&gt;&lt;em&gt;src/test/java&lt;/em&gt;&lt;/strong&gt; as the best practice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Add non-class files like excel sheets for data-driven framework and driver exe files under &lt;em&gt;**src/test/resources *&lt;/em&gt;*(create a new folder if not available by default ).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Create a new Class file by right-clicking src/test/java folder, then click new-&amp;gt;Java Class and name the file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Selenium Dependencies for Maven Project&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;All the external libraries like the Selenium jar files, testng jar files, and WebDriverManager jar file manage browser setup for Selenium WebDriver managed by maven dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;POM stands for Page Object Model. POM files have different elements like dependencies, plugins.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Place the dependencies where we mention all our external libraries. Then, fetch the required dependency from Maven public repository in the below format and paste it directly into the pom.xml file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A1pEEGYW7V9STeAxU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A1pEEGYW7V9STeAxU.png" width="512" height="88"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Add this into the POM.xml file under the dependencies section. Similarly, add the TestNG and WebDriverManager dependencies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AWmoaHJJhfS8SMwiE.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AWmoaHJJhfS8SMwiE.png" width="512" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7:&lt;/strong&gt; Once you have added all the dependencies, click “&lt;strong&gt;&lt;em&gt;load maven changes&lt;/em&gt;&lt;/strong&gt;“ from the pom file or right-click pom.xml file and click &lt;strong&gt;&lt;em&gt;Maven-&amp;gt;Reload Project,&lt;/em&gt;&lt;/strong&gt; which downloads and creates a local repository of our libraries.&lt;/p&gt;

&lt;p&gt;In macOS, .m2( local repository) is available under the username. Usually, it’s hidden, and you have to press (Commond+Shit+. ) to view the folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8:&lt;/strong&gt; Now, the Project is ready to write our Selenium test case. Right-click src/test/java and click &lt;em&gt;**New-&amp;gt;Java Class *&lt;/em&gt;*and enter the name as LTPlayGroundTest. In this class, we validate the status of the check box from &lt;a href="https://www.lambdatest.com/selenium-playground/checkbox-demo?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium Playground&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A9SlQrRDolhdT1oOu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A9SlQrRDolhdT1oOu.png" width="512" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Snippet&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import io.github.bonigarcia.wdm.WebDriverManager;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.testng.Assert;
    import org.testng.annotations.Test;

    public class LTPlayGroundTest {
       @Test //TestNG Annotation
       public void validateCheckBoxStatus (){
           /**WebDriverManager is an open Source API to ease the Browser Initialisation .
           We can skip driver exe path definition**/
           WebDriverManager.chromedriver().setup();

           //Chrome Browser Initialized
           WebDriver driver= new ChromeDriver();

           //Launch the URL
           driver.get("https://www.lambdatest.com/selenium-playground/checkbox-demo");
           //get the WebElement of Check Box

           WebElement singleCheckBox= driver.findElement(By.id("isAgeSelected"));
           //click that check box
           singleCheckBox.click();

           //Validate checkbox is selected or not
           Assert.assertTrue(singleCheckBox.isSelected());
       }
    }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Code Walkthrough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A8EiPhgQMZORW8zbk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A8EiPhgQMZORW8zbk.png" width="512" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wondering what is WebDriverManager and how it helps in the Selenium Project?&lt;/p&gt;

&lt;p&gt;WebDriverManager is an open-source Java library. It helps carry out the driver exe path setup for all browsers like Chrome, Edge, and Firefox in a single line. Here WebDriverManager.ChromeDriver.setup initializes the latest Chrome browser installed in the system. However, even initializing the version of the browser also is possible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Aful6oRpGgcY55i7i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Aful6oRpGgcY55i7i.png" width="512" height="84"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This statement initializes chrome with version 85.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AG94sdpe44MrhthBS.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AG94sdpe44MrhthBS.png" width="512" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Similar to Chrome, this statement initializes the Firefox browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A51q5PJBWQiAa_qYb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A51q5PJBWQiAa_qYb.png" width="512" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This statement initializes the driver object and launches the Chrome browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AbjSXF5F4--E-mUjl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AbjSXF5F4--E-mUjl.png" width="512" height="74"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This statement opens the AUT(Application under Test ) URL in the browser session initialized by the driver object.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AWUkBaAoNbxHvrubv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AWUkBaAoNbxHvrubv.png" width="512" height="78"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This fetches the webelement, which has the id “isAgeSelected.” In our application, it’s a checkbox element.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A62Spb78ldZg_Agxg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A62Spb78ldZg_Agxg.png" width="512" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above code performs a click action on the selected element.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AglywtMKpxJU2etIZ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AglywtMKpxJU2etIZ.png" width="512" height="76"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, the element .isSelected returns the selection status as True or False. This method is valid only for checkbox and radio button elements.&lt;/p&gt;

&lt;p&gt;Now the TestNG Assertion assertTrue, validates whether the value returned from the isSelected method is True, if not, then it fails the test case with the message “Checkbox is not selected.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Executing Maven project
&lt;/h2&gt;

&lt;p&gt;The Selenium Maven project can be executed in multiple ways:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Execute as TestNG class File&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Right-click the LTPlayGroundTest file -&amp;gt; Run LTPlayGroundTest.Before that edits configuration to add default report listeners.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Use POM.xml File to execute TestSuite&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to modify POM.xml to read our TestNG suite and Class files. So instead of running TestNG as an &lt;strong&gt;individual&lt;/strong&gt; class, create a testSuite.xml file and add that in POM.xml using a sure-fire plugin.&lt;/p&gt;

&lt;p&gt;Here is the complete POM.xml file after adding all required elements.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
    &amp;lt;project xmlns="http://maven.apache.org/POM/4.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&amp;gt;
       &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;

       &amp;lt;groupId&amp;gt;org.example&amp;lt;/groupId&amp;gt;
       &amp;lt;artifactId&amp;gt;FirstSeleniumMavenProject&amp;lt;/artifactId&amp;gt;
       &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;

       &amp;lt;properties&amp;gt;
           &amp;lt;maven.compiler.source&amp;gt;17&amp;lt;/maven.compiler.source&amp;gt;
           &amp;lt;maven.compiler.target&amp;gt;17&amp;lt;/maven.compiler.target&amp;gt;
           &amp;lt;suiteXmlFile&amp;gt;src/test/resources/testngSuite.xml&amp;lt;/suiteXmlFile&amp;gt;
       &amp;lt;/properties&amp;gt;

       &amp;lt;build&amp;gt;
           &amp;lt;pluginManagement&amp;gt;
               &amp;lt;plugins&amp;gt;

                   &amp;lt;plugin&amp;gt;
                       &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;
                       &amp;lt;version&amp;gt;3.7.0&amp;lt;/version&amp;gt;
                       &amp;lt;configuration&amp;gt;
                           &amp;lt;release&amp;gt;10&amp;lt;/release&amp;gt;
                       &amp;lt;/configuration&amp;gt;
                   &amp;lt;/plugin&amp;gt;
           &amp;lt;plugin&amp;gt;
               &amp;lt;groupId&amp;gt;org.apache.Maven.plugins&amp;lt;/groupId&amp;gt;
               &amp;lt;artifactId&amp;gt;Maven-surefire-plugin&amp;lt;/artifactId&amp;gt;
               &amp;lt;version&amp;gt;2.17&amp;lt;/version&amp;gt;
               &amp;lt;configuration&amp;gt;
                   &amp;lt;suiteXmlFiles&amp;gt;
                       &amp;lt;suiteXmlFile&amp;gt;${suiteXmlFile}&amp;lt;/suiteXmlFile&amp;gt;
                   &amp;lt;/suiteXmlFiles&amp;gt;
               &amp;lt;/configuration&amp;gt;
           &amp;lt;/plugin&amp;gt;
               &amp;lt;/plugins&amp;gt;
           &amp;lt;/pluginManagement&amp;gt;
       &amp;lt;/build&amp;gt;
      &amp;lt;dependencies&amp;gt;


          &amp;lt;!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --&amp;gt;
          &amp;lt;dependency&amp;gt;
              &amp;lt;groupId&amp;gt;org.seleniumhq.selenium&amp;lt;/groupId&amp;gt;
              &amp;lt;artifactId&amp;gt;selenium-java&amp;lt;/artifactId&amp;gt;
              &amp;lt;version&amp;gt;4.1.0&amp;lt;/version&amp;gt;
          &amp;lt;/dependency&amp;gt;
          &amp;lt;dependency&amp;gt;
              &amp;lt;groupId&amp;gt;org.testng&amp;lt;/groupId&amp;gt;
              &amp;lt;artifactId&amp;gt;testng&amp;lt;/artifactId&amp;gt;
              &amp;lt;version&amp;gt;6.14.3&amp;lt;/version&amp;gt;
          &amp;lt;/dependency&amp;gt;
          &amp;lt;dependency&amp;gt;
              &amp;lt;groupId&amp;gt;io.github.bonigarcia&amp;lt;/groupId&amp;gt;
              &amp;lt;artifactId&amp;gt;webdrivermanager&amp;lt;/artifactId&amp;gt;
              &amp;lt;version&amp;gt;5.0.3&amp;lt;/version&amp;gt;
          &amp;lt;/dependency&amp;gt;
      &amp;lt;/dependencies&amp;gt;

    &amp;lt;/project&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now in the IntelliJ IDEA terminal, run this command mvn clean test.&lt;/p&gt;

&lt;p&gt;Once execution completes, we can see logs in the terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A9O02dlo3zqZfBz6_.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A9O02dlo3zqZfBz6_.png" width="512" height="131"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also see surefire-reports generated under our project structure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AsJY3a_dx5VJafSUi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AsJY3a_dx5VJafSUi.png" width="444" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Surefire-reports are similar to TestNG reports with emailable html format. You can also generate an XML report, which you can view with extent or Allure report format.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AGDNwkVP-m2a0073H.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AGDNwkVP-m2a0073H.png" width="512" height="195"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This Selenium 4 complete tutorial covers everything you need to know about Selenium 4.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/mMStkc3W9jY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Automated &lt;a href="https://www.lambdatest.com/blog/automated-functional-testing-what-it-is-how-it-helps/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;functional testing&lt;/a&gt; tests helps to ensure that your web app works as it was intented to. Learn more about functional tests, and how automating them can give you a faster release cycle!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Build and Execute Selenium projects using Gradle?
&lt;/h2&gt;

&lt;p&gt;Gradle is a build automation system that is fully open-source and uses the concepts of Apache Maven and Apache Ant. Either a single or multiple “build.gradle” file describes the Gradle project task. At least one build file must be located in the project’s root folder. Each build file defines a project and its tasks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Gradle allows us to write the build script with Java programming language.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is easy to use and maintain projects and their dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It provides high-performance and scalable builds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Having better dependency management like ReplacedBy rules.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Gradle integration process is quite easy.&lt;/p&gt;

&lt;p&gt;To add dependencies to a project, state the dependency configuration like the dependencies block of the build.gradle file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Gradle in macOS
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Install via Homebrew package manager. Open a terminal in Mac and execute the below command:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AI_C5lLMhrZilS6Kt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AI_C5lLMhrZilS6Kt.png" width="494" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Once installation is complete, check the installed Gradle version using the “gradle -v” command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2ATJY7jJaI1aN9V_bt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2ATJY7jJaI1aN9V_bt.png" width="512" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;**Note:&lt;/em&gt;* Installation of Gradle in Windows is pretty straightforward. You just need to download, unzip, and set the path in the System Path.*&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Gradle project in IntelliJ IDEA
&lt;/h3&gt;

&lt;p&gt;Gradle comes along with Latest IntelliJ IDEA IDE, so we don’t need any specific installation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; From the IntelliJ IDEA Home page, click “New Project” -&amp;gt; select “Gradle” from the left panel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AVrEsuPV_IgNl0akM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AVrEsuPV_IgNl0akM.png" width="512" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Select the Java check box. Click Next and mention the Project name (FirstSeleniumGradleProject). Mention GroupId as required.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A0SrhzKQ8PkvnvTd1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A0SrhzKQ8PkvnvTd1.png" width="512" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once created, the new project structure and default build.gradle file will look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AF6WTptBOkLb2gbKa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AF6WTptBOkLb2gbKa.png" width="512" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Add Selenium and TestNG dependency for the project. Fetch the required dependency from Maven public repository, navigate to the Gradle tab and copy the statement in the below format and paste it directly into the build.gradle file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowft1e1606cda2wn1i4k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowft1e1606cda2wn1i4k.png" width="512" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To start with our test cases, we need to add Selenium -Java, TestNG, and WebDriverManager dependencies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AMojLNSWhJGa3HK74.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AMojLNSWhJGa3HK74.png" width="512" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going to use the TestNG framework so that I can remove default JUnit dependencies and useJUnit() test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Add useTestNG test .When specifying useTestNG(), Gradle scans for all the methods annotated with &lt;a class="mentioned-user" href="https://dev.to/test"&gt;@test&lt;/a&gt; and executes them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Once you have added all the dependencies, click “Load Gradle Changes“ from the gradle file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Now, the Project is ready to write our Selenium test case. Right-click src/test/java and click New-&amp;gt;Java Class and enter the name as LTSimpleFormTest. In this class, we validate the Simple Input Form from Selenium Playground.&lt;/p&gt;

&lt;p&gt;This test pass the values to the text box, click the “Get Checked Value” button and validate the message under “Your Message” section .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsfyqq7dugof2cc7wrajt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsfyqq7dugof2cc7wrajt.png" width="512" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Snippet&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   import io.github.bonigarcia.wdm.WebDriverManager;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.testng.Assert;
    import org.testng.annotations.Test;

       public class LTSimpleFormTest {
           @Test //TestNG Annotation
           public void validateCheckBoxStatus (){
               /**WebDriverManager is an open Source API to ease the Browser Initialisation .
                We can skip driver exe path definition**/
               WebDriverManager.chromedriver().setup();

               //Chrome Browser Initialized
               WebDriver driver= new ChromeDriver();

               //Launch the URL
               driver.get("https://www.lambdatest.com/selenium-playground/simple-form-demo");
               //get the WebElement of textInput
               WebElement userTestBox= driver.findElement(By.id("user-message"));
               ///send values to textbox
               userTestBox.sendKeys("Welcome To LambdaTest");
               WebElement getValueButton= driver.findElement(By.id("showInput"));
               getValueButton.click();
               WebElement checktextArea= driver.findElement(By.id("message"));
             //validate the fetched text
             Assert.assertEquals(checktextArea.getText(),"Welcome To LambdaTest","Message is    different");
           }
       }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Code Walkthrough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AnnAmYkDVbdz88Ydb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AnnAmYkDVbdz88Ydb.png" width="512" height="106"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;WebDriverManager is an open-source project from bonigarcia, which helps to skip the process of setting the driver executable path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AGX0hmobSM_dUKuST.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AGX0hmobSM_dUKuST.png" width="512" height="89"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The WebDriver instance of the ChromeDriver object launches the Chrome Driver and the get() method opens the mentioned URL in the Chrome session.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AIiEo0y43QDlEs4VF.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AIiEo0y43QDlEs4VF.png" width="512" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The text box is identified by id “user-message” and sendKeys method of driver object pass values as “Welcome To LambdaTest” to the selected textBox element.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AfoM2fVr-BZZDvfta.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AfoM2fVr-BZZDvfta.png" width="512" height="111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The button is identified by id “showInput” and clicked by the click() method.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AE-sQXsZegFMFVWRV.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AE-sQXsZegFMFVWRV.png" width="512" height="111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Text area element is identified by its id, and the getText() method fetches the element’s text value.&lt;/p&gt;

&lt;p&gt;The assertEquals method verifies whether the fetched text is the same as “Welcome To LambdaTest,” which is entered in the text field in the previous step. If not, it fails the test case with the “Message is different” error message.&lt;/p&gt;

&lt;h3&gt;
  
  
  Executing Gradle project
&lt;/h3&gt;

&lt;p&gt;The Selenium Maven project can be executed in multiple ways.&lt;/p&gt;

&lt;p&gt;1- Execute as TestNG class File.&lt;/p&gt;

&lt;p&gt;Right-click the LTSimpleFormTest file -&amp;gt; Run LTSimpleFormTest file . After successful execution, you can see TestNG reports under the target folder.&lt;/p&gt;

&lt;p&gt;After successful execution, Gradle generates its own reports under the build folder&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A3om7N4fcqwoMHnmt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A3om7N4fcqwoMHnmt.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open the index. html file in the browser, and you can see the results&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AWCOdtCmWeIFwi19g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AWCOdtCmWeIFwi19g.png" width="512" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you need a report from TestNG, you must add listeners and a report folder in the build.gradle file before start execution.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Ac6r2krdEPfRSWfyO.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Ac6r2krdEPfRSWfyO.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2- Use the Gradle file to execute TestClass.&lt;/p&gt;

&lt;p&gt;In the IDE terminal, type “gradle clean test“. It executes all the test cases under src/test/java package and generates results .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2536%2F0%2AlnNeb0yjwlFmGlgR.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2536%2F0%2AlnNeb0yjwlFmGlgR.png" width="800" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you need to execute only one test method from the test class , for example validateCheckBoxStatus in LTSimpleFormTest class, then use:&lt;br&gt;
“&lt;em&gt;gradle test –tests LTSimpleFormTest.validateCheckBoxStatus&lt;/em&gt;”&lt;/p&gt;

&lt;p&gt;3- Execute Testsuite.xml via Gradle.&lt;/p&gt;

&lt;p&gt;In times, you need to have multiple test cases in place and pass common parameters to the test cases and include and exclude test cases based on current test execution. All can be achieved by creating a suite xml file.&lt;/p&gt;

&lt;p&gt;TestNG Suite file looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
    &amp;lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"&amp;gt;
    &amp;lt;suite thread-count="1" parallel="none" name="GradleSuite"&amp;gt;
       &amp;lt;test  name="GradleTest"&amp;gt;
           &amp;lt;classes&amp;gt;
             &amp;lt;class name="LTSimpleFormTest"&amp;gt;
                 &amp;lt;methods&amp;gt;
                     &amp;lt;exclude name="checkSkipped"&amp;gt;&amp;lt;/exclude&amp;gt;           
                 &amp;lt;/methods&amp;gt;
             &amp;lt;/class&amp;gt;
           &amp;lt;/classes&amp;gt;
       &amp;lt;/test&amp;gt; &amp;lt;!-- Test --&amp;gt;
    &amp;lt;/suite&amp;gt; &amp;lt;!-- Suite --&amp;gt;


    Now add this suite xml file to build.gradle under test
    test{
     useTestNG() {
         // To generate reports by TestNG library
       //  useDefaultListeners = true
       //  outputDirectory = file("$projectDir/target")
         suites file("$projectDir/src/"+"testSuite.xml")
     }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After adding the suite xml file , execute the “gradle clean test” command from the terminal, trigger the suite file and generate reports under the build folder.&lt;/p&gt;

&lt;p&gt;Watch this video to learn about collecting performance metrics in Selenium 4 using the Chrome DevTools Protocol on the LambdaTest platform.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/w7xkMk-0Yg0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  How to execute Selenium projects on cloud Selenium Grid?
&lt;/h2&gt;

&lt;p&gt;In this section, we will see how to go about harnessing the power of cloud-based online Selenium Grids, like those offered by LambdaTest, in conjunction with our local grid setups.&lt;/p&gt;

&lt;p&gt;Selenium testing tools like LambdaTest allow you to perform &lt;a href="https://www.lambdatest.com/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;cross browser testing&lt;/a&gt; on over 3000+ browsers and operating systems combinations at scale.&lt;/p&gt;

&lt;p&gt;In this section of the article on executing Selenium projects, let us now see how to run the test classes in parallel using cloud Selenium Grid like LambdaTest.&lt;/p&gt;

&lt;p&gt;Here is the code for running &lt;a href="https://www.lambdatest.com/learning-hub/testng?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium TestNG&lt;/a&gt; tests in cloud Selenium Grid.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import org.openqa.selenium.By;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.remote.DesiredCapabilities;
    import org.openqa.selenium.remote.RemoteWebDriver;
    import org.testng.Assert;
    import org.testng.ITestContext;
    import org.testng.annotations.AfterClass;
    import org.testng.annotations.BeforeMethod;
    import org.testng.annotations.Test;
    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    public class LTPlayGroundTestinSeleniumGrid {
     public String username = "";
     public String authkey = "";
     public static RemoteWebDriver driver = null;
     public String hub = "@hub.lambdatest.com/wd/hub";

    @BeforeMethod
         public void setup(Method m, ITestContext ctx) throws MalformedURLException {
             DesiredCapabilities caps = new DesiredCapabilities();
             caps.setCapability("platform", "MacOS Catalina");
             caps.setCapability("browserName", "Safari");
             caps.setCapability("version", "latest");
             caps.setCapability("build", "TestNG With Java");
             caps.setCapability("name", m.getName() + " - " +this.getClass().getName());
             caps.setCapability("plugin", "git-testng");
             String[] Tags = new String[] { "Feature", "Falcon", "Severe" };
             caps.setCapability("tags", Tags);
             driver = new RemoteWebDriver(new URL("https://" + username +":" + authkey + hub), caps);
         }

         @Test
         public void testCheckBoxStatus(){
         driver.get("https://www.lambdatest.com/selenium-playground/checkbox-demo");

             //get the WebElement of Check Box
         WebElement singleCheckBox=driver.findElement(By.id("isAgeSelected"));
         //click that check box
         singleCheckBox.click();
         //Validate check box is selected or not
         Assert.assertTrue(singleCheckBox.isSelected(),"Checkbox is not selected ");
     }

     @AfterClass
     public void closeBrowser() {
         driver.close();
         System.out.println("Closing the browser");
     }
         }

        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Code WalkThrough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AccHpFA1WZxXdtiPy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AccHpFA1WZxXdtiPy.png" width="512" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we define the global variables to launch Selenium cloud Grid with username and authentication Key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Ai0k2wm1fpif-Oc_p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2Ai0k2wm1fpif-Oc_p.png" width="512" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can populate the values for your corresponding username and access key, which can be collected by logging into your &lt;a href="https://accounts.lambdatest.com/login?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LamdaTest Profile Section&lt;/a&gt;. However, the grid URL will remain the same.&lt;/p&gt;

&lt;p&gt;BeforeMethod is a &lt;a href="https://www.lambdatest.com/blog/complete-guide-on-testng-annotations-for-selenium-webdriver/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;TestNG Annotation&lt;/a&gt;, which executes code blocks before each Test Method executes.&lt;/p&gt;

&lt;p&gt;Here, I have used the LambdaTest &lt;a href="https://www.lambdatest.com/capabilities-generator/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Desired Capabilities Generator&lt;/a&gt; and have set the necessary capabilities of browser name, version, platform, etc.&lt;/p&gt;

&lt;p&gt;RemoteDriver is a Selenium Library Class which implements the WebDriver interface on the remote server.&lt;/p&gt;

&lt;p&gt;The remote server mentioned here as hub URL along with authentication, which is &lt;a href="https://www.lambdatest.com/automation-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest Selenium Cloud Grid&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2ARP1AQBVogwyn47MT.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2ARP1AQBVogwyn47MT.png" width="512" height="116"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test annotation executes after the BeforeMethod code block, so it refers to the browser launched Selenium Cloud Grid and opens the &lt;a href="https://www.lambdatest.com/selenium-playground/checkbox-demo?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest Selenium Playground&lt;/a&gt; URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A2f8XaWToItiPMRhF.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2A2f8XaWToItiPMRhF.png" width="512" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This statement identifies the checkbox element using the &lt;a href="https://www.lambdatest.com/blog/locators-in-selenium-webdriver-with-examples/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;ID Locator in Selenium WebDriver&lt;/a&gt; and performs click action.&lt;/p&gt;

&lt;p&gt;Then using TestNG assertion, it fetches the status of the checkbox and validates whether it’s true or false.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AoVxNrKJT7E3bP4UU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AoVxNrKJT7E3bP4UU.png" width="512" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AfterClass TestNG annotation helps perform all teardown actions like closing files and browser sessions after TestMethod execution completes.&lt;/p&gt;

&lt;p&gt;You can execute this test case either as TestNG Class or using TestNG Suite or using the “&lt;strong&gt;maven clean test&lt;/strong&gt; “, or if it’s a Gradle project, use the “&lt;strong&gt;gradle clean test&lt;/strong&gt;” command from the terminal.&lt;/p&gt;

&lt;p&gt;Once the tests are completed, log on to &lt;a href="https://accounts.lambdatest.com/login?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=jan05_pk&amp;amp;utm_term=pk&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest Automation Dashboard&lt;/a&gt; to check the status of the test execution on LambdaTest.&lt;/p&gt;

&lt;p&gt;This certification is ideal for testing professionals who want to acquire advanced, hands-on knowledge in Selenium automation testing.&lt;/p&gt;

&lt;p&gt;Here’s a short glimpse of the Selenium Advanced certification from LambdaTest:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/DK21aHjuUE4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  That’s a Wrap
&lt;/h2&gt;

&lt;p&gt;Selenium is the most powerful framework when we approach the problem statement correctly. In this tutorial, we focused on building a Java Project with and without Maven build and learned how to execute from IntelliJ IDEA.&lt;/p&gt;

&lt;p&gt;Learn more about other popular frameworks like Page Object Model, Executing Parallel Test Cases via TestNG, Handling Test Data using TestNG Data Providers from LambdaTest Blogs and LambdaTest Learning Hub.&lt;/p&gt;

&lt;p&gt;Thanks for your time; please keep us posted with your feedback and comments.&lt;/p&gt;

&lt;p&gt;Happy Testing…!&lt;/p&gt;

</description>
      <category>testing</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
