<?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: Bharadwajpendyala12</title>
    <description>The latest articles on DEV Community by Bharadwajpendyala12 (@bharadwajpendyala12).</description>
    <link>https://dev.to/bharadwajpendyala12</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%2F909775%2Ff56a8541-b493-4bc1-9018-09a3c248c62f.png</url>
      <title>DEV Community: Bharadwajpendyala12</title>
      <link>https://dev.to/bharadwajpendyala12</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bharadwajpendyala12"/>
    <language>en</language>
    <item>
      <title>Automation Testing With Selenium, Cucumber &amp; TestNG</title>
      <dc:creator>Bharadwajpendyala12</dc:creator>
      <pubDate>Fri, 19 Aug 2022 10:02:22 +0000</pubDate>
      <link>https://dev.to/testmuai/automation-testing-with-selenium-cucumber-testng-44gn</link>
      <guid>https://dev.to/testmuai/automation-testing-with-selenium-cucumber-testng-44gn</guid>
      <description>&lt;p&gt;Cucumber is a test automation framework which leverages Behavior Driven Development for collaboration in between Business and IT teams. It empowers a user to define an application’s behavior in plain English language which makes it easier for non-programmers to understand the acceptance criteria.&lt;/p&gt;

&lt;p&gt;The core of cucumber has been developed in Ruby programming language however it supports all the majorly used programming languages for testing such as Java, C#, Python. In this article, I will be demonstrating automation testing with Selenium, &lt;/p&gt;

&lt;p&gt;If you’re new to Selenium and wondering what it is then we recommend checking out our guide — &lt;a href="https://www.lambdatest.com/selenium?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug19_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;What is Selenium?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Try this online &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug19_kj&amp;amp;utm_term=kj&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;Selenium Testing Tool&lt;/a&gt; Grid to run your browser automation testing scripts.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Behavior Driven Development?
&lt;/h2&gt;

&lt;p&gt;Behavior Driven Development is derived from Test Driven Development as a software development methodology. As a part of the Test Driven Development approach, the developer creates tests as a part of the acceptance criteria first. The developer will make sure the test is passed and will commit changes in the code. if required. Test Driven Development is a way to ensure the system meets its requirements by ensuring a 100% test coverage. It provides an edge over other methodologies in terms of finding defects early in the cycle which reduces the cost of finding bugs and refactoring improves the code.&lt;/p&gt;

&lt;p&gt;Cons of Test Driven Development are the maintenance of tests created, it is a test-centric methodology, non-programmers might find it hard to understand for performing selenium automation testing. The test or acceptance criteria being targeted makes it hard for team collaboration. To overcome the above trouble heads, Behavior Driven Development was introduced to reduce the time to test, less code with more collaboration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages Of Using BDD For Automation Testing With Selenium &amp;amp; Cucumber
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Collaborative Approach:&lt;/strong&gt; Bridges the communication gap between stakeholder or business teams who can’t easily understand or read the code. This problem is addressed by defining the behavior of application under test in a ubiquitous language i.e. easily understandable.&lt;/p&gt;

&lt;p&gt;Focuses more in terms of end-user experience or inclined more towards behavior specifications while compared to that of traditional Test Driven methodology. Tests are written more from end user’s point of view, making them easier to understand for performing Selenium automation testing.&lt;/p&gt;

&lt;p&gt;With TestNG certification, you can challenge your skills in performing automated testing with TestNG and take your career to the next level.&lt;/p&gt;

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

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

&lt;h2&gt;
  
  
  How Cucumber Leverages BDD For Selenium Automation Testing?
&lt;/h2&gt;

&lt;p&gt;As discussed earlier, Cucumber is a test automation tool that supports Behavior Driven Development. It makes use of user-defined specifications to validate the application under test. Before we step into performing &lt;a href="https://www.lambdatest.com/selenium-automation-testing-with-cucumber-framework?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug19_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;automation testing with Selenium &amp;amp; Cucumber&lt;/a&gt;, let me tell you about the three major parts of the cucumber framework i.e. &lt;strong&gt;Feature file&lt;/strong&gt;, &lt;strong&gt;Step Definitions&lt;/strong&gt;, and &lt;strong&gt;Test Runner file&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature File&lt;/strong&gt; would enable the user to define the behavior of the application in plain English text with help of Gherkin Language. Gherkin is used to define executable specifications with the help of a predefined set of contextual keywords. Keywords involved are demonstrated with the help of the below example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature:&lt;/strong&gt; High-level description of a software feature or behavior of application under test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; Feature file can contain more than one scenario which acts as a test case derived from test scenarios/behaviors. It also symbolizes and acts as one or more user perspectives involved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Annotations:&lt;/strong&gt; Keywords which hold a specific meaning and would help and defined the meaning of a scenario. Sample keywords involved are GIVEN, WHEN, THEN &amp;amp; AND.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GIVEN:&lt;/strong&gt; Define pre-requisites of the application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;WHEN:&lt;/strong&gt; Trigger point for a scenario execution can be related more towards steps to be executed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;THEN:&lt;/strong&gt; Defined an outcome more like the expected result.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AND:&lt;/strong&gt; Acts as a logical bridge AND in between two statements.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Scenario Outline: It’s a template provided to carry out scenario execution, test data table provided in the Examples section would replace variables/arguments created making each individual row in a table as a unique scenario.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tags:&lt;/strong&gt; It paves the way to organize your tests based on your tag definition.&lt;/p&gt;

&lt;p&gt;Quoted an example related to the feature file below which involves all the above-mentioned keywords.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature: Place order on the Amazon website.
[@SmokeTest](http://twitter.com/SmokeTest)
Scenario: Validate if the guest user is able to add a product to cart.
GIVEN user is logged onto the Amazon website as a guest user.
WHEN user searches a product on the homepage.
THEN user should be able to view product information related to product searched.
AND user click on add to cart button
THEN user verifies if the product is added to cart

Scenario Outline: Validate if a registered user is able to place an order.
    GIVEN user is logged onto the Amazon website as a registered user.
    WHEN user logs in with &amp;lt;username&amp;gt; and &amp;lt;password&amp;gt;
    THEN user should be able to view homepage.
WHEN user searches for &amp;lt;productID&amp;gt;
THEN user should be on the product information page.
AND user tried to add the product to cart
THEN product should be added to cart.
WHEN user navigates to order confirmation page via express checkout option.
THEN order should be placed successfully along with order confirmation id being generated.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Step Definition file&lt;/strong&gt; created would be consisting of a code which defines the steps for annotations created in &lt;strong&gt;feature file&lt;/strong&gt;. An annotation followed by step defined in patterns with the help of regular expression would help in linking the step definition file to steps in feature file. Sample step definition code sample for above code is defined as above.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[@Given](http://twitter.com/Given)("^user is logged onto Amazon website as a guest user $")
public void user_is_on_Home_Page() throws Throwable {
driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.get("[http://www.amazon.in](http://www.amazon.in)");
}
[@When](http://twitter.com/When)("^user searches a product on homepage $")
public void user_searches_a_product() throws Throwable {
driver.findElement(By.xpath(".//*[[@id](http://twitter.com/id)='account']/a")).click();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Test Runner file&lt;/strong&gt; defined the location of step definition and primarily provides all the metadata information required for test execution. It makes use of &lt;strong&gt;‘@RunWith()’&lt;/strong&gt; annotation from JUnit framework for execution. Secondarily you would be making use of &lt;strong&gt;‘@CucumberOptions’&lt;/strong&gt; annotation to define the location of feature files, step definitions location through glue, what reporting integrations to use etc.&lt;/p&gt;

&lt;p&gt;Below is the sample of feature file created.&lt;/p&gt;

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

import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

[@RunWith](http://twitter.com/RunWith)(Cucumber.class)
[@CucumberOptions](http://twitter.com/CucumberOptions)(
        features = "src/test/Feature"
        ,glue={"src/main/stepDefinition"}
        )

public class TestRunner {

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

&lt;/div&gt;

&lt;p&gt;We can integrate parallel test execution for automation testing with Selenium &amp;amp; Cucumber framework for saving a considerable amount of time during test execution. To elaborate the above scenario, serve the regression test needs of an application under test you have to execute your entire regression test automation repository which could serve you with both time and resource constraints. The end-user would not be using the same browser with its latest version, there could be plenty of browsers, operating systems and browser version combinations which should be considered while performing out testing.&lt;/p&gt;

&lt;p&gt;However, the cons stated above could be resolve with cloud solutions such as LambdaTest which is a &lt;a href="https://www.lambdatest.com/" rel="noopener noreferrer"&gt;cross browser testing cloud&lt;/a&gt;. LambdaTest offers an &lt;a href="https://www.lambdatest.com/selenium-grid-online" rel="noopener noreferrer"&gt;online Selenium grid&lt;/a&gt; consisting 3000+ real browsers and operating systems help you achieve maximum amount of browser test coverage. Build time could be drastically reduced by utilizing LambdaTest automation for your test execution. Parallel test execution with the help of various browsers and multiple versions of each browser instance would help you achieve your cross browser parallel testing needs. Automated screenshots and video recording would help you keep track of your test failures and find the root cause quickly providing you a better analytical perspective while troubleshooting.&lt;/p&gt;

&lt;p&gt;As we have embarked on our journey of implementing automation testing with Selenium &amp;amp; Cucumber framework using Java, till now we have learned the overview of the cucumber framework and how it leverages BDD. Let’s get into hands-on the mode by creating a sample framework using Cucumber for Selenium automation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Need a great solution &lt;a href="https://www.lambdatest.com/safari-browser-for-windows?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug19_kj&amp;amp;utm_term=kj&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;Safari for windows&lt;/a&gt; browser testing on Windows? Forget about emulators or simulators — use this real online browsers.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Your First Project Using Cucumber For Selenium Automation Testing
&lt;/h2&gt;

&lt;p&gt;We make use of Eclipse IDE for coding purposes, get the latest version from their official website &lt;a href="https://www.eclipse.org/downloads/" rel="noopener noreferrer"&gt;https://www.eclipse.org/downloads/&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;“cucumber-archetype Artifact Id 
Group Id as io.cucumber”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Archetype would be generated with the help of above statement. If in case above archetype has been missing please add template for the Archetype by entering below info.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GroupId: “io.cucumber”
ArtifactId: “cucumber-archetype”
Version: “2.3.1.2”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After entering above details try navigating further and finishing required steps. Hence maven project would be successfully created.&lt;/p&gt;

&lt;p&gt;Replace the dependencies by obtaining them from below pom file as required with below set of dependencies.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;project xmlns="[http://maven.apache.org/POM/4.0.0](http://maven.apache.org/POM/4.0.0)" xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)"
    xsi:schemaLocation="[http://maven.apache.org/POM/4.0.0](http://maven.apache.org/POM/4.0.0) [http://maven.apache.org/xsd/maven-4.0.0.xsd](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;Google_Search&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;Google_Search&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;0.0.1-SNAPSHOT&amp;lt;/version&amp;gt;
    &amp;lt;packaging&amp;gt;jar&amp;lt;/packaging&amp;gt;
    &amp;lt;name&amp;gt;Google_Search&amp;lt;/name&amp;gt;
    &amp;lt;url&amp;gt;[http://maven.apache.org](http://maven.apache.org)&amp;lt;/url&amp;gt;
    &amp;lt;properties&amp;gt;
        &amp;lt;project.build.sourceEncoding&amp;gt;UTF-8&amp;lt;/project.build.sourceEncoding&amp;gt;
    &amp;lt;/properties&amp;gt;
    &amp;lt;dependencies&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;3.14.0&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;junit&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;junit&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;4.12&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;io.cucumber&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;cucumber-java&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;4.2.2&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;com.google.guava&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;guava&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;27.0.1-jre&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;io.cucumber&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;cucumber-junit&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;4.2.2&amp;lt;/version&amp;gt;
            &amp;lt;scope&amp;gt;test&amp;lt;/scope&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;&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%2F2732%2F1%2AO5I6VYZgr3X4sMcyISGRdw.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%2F2732%2F1%2AO5I6VYZgr3X4sMcyISGRdw.png" width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Creating your Feature file with user defined specifications in Gherkin Language:&lt;br&gt;
&lt;strong&gt;Step 1:&lt;/strong&gt; Create a folder for organizing all your feature files as shown in the image below.&lt;br&gt;
&lt;strong&gt;Step 2:&lt;/strong&gt; Select File from the navigation menu. File → New → File.&lt;br&gt;
&lt;strong&gt;Step 3:&lt;/strong&gt; Name the file using “Login.feature”.&lt;br&gt;
&lt;strong&gt;Step 4:&lt;/strong&gt; As there is no plugin which supports “.feature” extension file created would look as in the image below.&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%2AfzHOgnPsTmDISNnK.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%2AfzHOgnPsTmDISNnK.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Once you create the feature file below alert would be prompted asking you to select the editor to be installed from the marketplace.&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%2Aq4rjmqUYMMPD1iix.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%2Aq4rjmqUYMMPD1iix.png" width="527" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Select “Show IDE extensions for this file type and let me install them” radio button and select the first option which is Cucumber Eclipse Plugin as shown in the image below.&lt;br&gt;
Click on install. Accept the terms of the license agreement. Click on Finish. You would be prompted with a security alert, click on Install Anyway option, once installation is finished click on Restart Now to view the changes made.&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%2AzZuvPz7zdQCZCvCM.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%2AzZuvPz7zdQCZCvCM.png" width="520" height="724"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7:&lt;/strong&gt; To view if changes are reflected observe the Feature file as in below image how different is it from the previous image of the feature file created.&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%2AiKNaDvzJ5itnDgra.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%2AiKNaDvzJ5itnDgra.png" width="171" height="57"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Watch this video to learn how TestNG has become one of the most robust test automation frameworks and all you need to know to get started with TestNG in Selenium.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Running First Script Of Automated Testing With Selenium &amp;amp; Cucumber Framework
&lt;/h2&gt;

&lt;p&gt;Let’s consider a real-world case study of querying a search term in google search by creating a feature file which consists of feature, tags and scenarios and scenario outline as applicable.&lt;/p&gt;

&lt;p&gt;For automation testing with Selenium &amp;amp; Cucumber framework for Java, we need to create a &lt;strong&gt;GoogleSearch.feature&lt;/strong&gt; file under &lt;strong&gt;Features package&lt;/strong&gt; with below content under &lt;strong&gt;“src/test/java” path&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature: Searching Google should return the name of query

Scenario: Google search with scenario
    Given user launches Google webapp
    When user searches for a "LambdaTest"
    And click on search button
    Then results retrieved should contain the "LambdaTest" used

Scenario Outline: Searching google using scenario outline and examples
    Given user launches Google webapp
    When user searches for a "&amp;lt;query&amp;gt;"
    And click on search button
    Then results retrieved should contain the "&amp;lt;query&amp;gt;" used
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Once you have completed creating a feature file, created steps would be highlighted with warnings indicating that you haven’t defined the step contained in step definition file yet.&lt;br&gt;
In order to resolve the errors, lets navigate to the step definition file to complete coding the gist which defines our steps.&lt;br&gt;
Below code can be replaced in step definition file which is Stepdefs.&lt;br&gt;
&lt;strong&gt;TIP:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While creating your step definitions if you want a template for step definitions file creation just run the feature file along with warnings as discussed previously. It would provide you with the template upon which you can start coding as shown in the image below.&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-O0m9bC8mWm9Sjp_.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-O0m9bC8mWm9Sjp_.png" width="512" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make sure your step definitions are specified in package &lt;strong&gt;“com.googlesearch.testing.steps”&lt;/strong&gt; under the path of &lt;strong&gt;“src/main/java”&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%2AkyXvdeiWZWOqry_l.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%2AkyXvdeiWZWOqry_l.png" width="271" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy the code and define the path to your chrome driver. Below is the code used for automation testing with Selenium &amp;amp; Cucumber in Java.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.googlesearch.testing.steps;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;

public class stepDefinitions {

public static WebDriver driver;
    String baseURL = "[https://www.google.com](https://www.google.com)";

[@Given](http://twitter.com/Given)("^user launches Google webapp$")
    public void user_launches_Google_webapp() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        System.setProperty("webdriver.chrome.driver", "C:\\Cucumber_Workspace\\GoogleSearch\\Libs\\chromedriver.exe");
        driver = new ChromeDriver();
        driver.manage().window().maximize();
        driver.get(baseURL);
    }

[@When](http://twitter.com/When)("^user searches for a \"([^\"]*)\"$")
    public void user_searches_for_a(String arg1) throws Throwable {
        WebElement searchBox = driver.findElement(By.name("q"));
        searchBox.sendKeys(arg1);
    }

[@And](http://twitter.com/And)("^click on search button$")
    public void click_on_search_button() throws Throwable {
        WebElement searchBox = driver.findElement(By.name("q"));
        searchBox.submit();
    }

[@Then](http://twitter.com/Then)("^results retreived should contain the \"([^\"]*)\" used$")
    public void results_retreived_should_contain_the_used(String resultString) throws Throwable {
        WebElement result = driver.findElement(By.className("LC20lb"));
        if (resultString.equalsIgnoreCase(result.getText())) {
            System.out.println("Text is matching");
        } else {
            System.out.println("Text is not matching");

}
        driver.quit();
    }

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

&lt;/div&gt;

&lt;p&gt;Make sure your Test Runner java file which is named as RunCucumberTest is under “src/test/java” path with code specified below.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

[@RunWith](http://twitter.com/RunWith)(Cucumber.class)
[@CucumberOptions](http://twitter.com/CucumberOptions)(features = { "classpath:features" }, plugin = { "pretty", "json:target/cucumber/cucumber.json" })

public class RunCucumberTest {

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

&lt;/div&gt;

&lt;p&gt;Now you have all the 3 main aspects ready for test execution. To proceed further for running automation testing with Selenium and Cucumber you would need to right-click on &lt;strong&gt;RunCucumberTest.java&lt;/strong&gt; file which is created. Click on &lt;strong&gt;Run as JUnit Test&lt;/strong&gt;. Tests get triggered for both the scenarios specified. If you observe the scenario outline it gets executed thrice with all the sets of data specified in a data driven format.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Using LamdaTest For Automation Testing With Selenium &amp;amp; Cucumber
&lt;/h2&gt;

&lt;p&gt;Above test would be running in sequence and nexttest would have to wait till the thread is empty by completion of previous test triggered. This would consume more amount of time and cross browser testing with above methodology would prove to be a troublesome and expensive due to the permutations and combinations of the browsers and operating systems and versions available. In order to overcome the issue we would have to run our automation tests with Selenium and Cucumber in parallel, even if we do so still we would have to configure a lot of machines as the number of tests you can trigger per system would depend on the computing capabilities of each system.&lt;/p&gt;

&lt;p&gt;LambdaTest would help us overcome the above problem statements. As a cloud solution it offers scalability to reduces build time, improve browser test coverage, provision to validate &lt;a href="https://www.lambdatest.com/responsive-test-online?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug19_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;responsive test&lt;/a&gt; from pixel to pixel accuracy, enhanced reporting and analytical capabilities. Let’s start with configuring Cucumber to enable parallel test execution of Selenium with Java using LambdaTest for automated cross browser testing&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring Your Test Suite With LambdaTest For Parallel Test Execution Of Selenium With Cucumber &amp;amp; TestNG
&lt;/h2&gt;

&lt;p&gt;Replace your step definition file with below code which includes Remote WebDriver configuration to connect to cloud virtual machines. Currently we have JUnit as our unit testing framework, for provisioning parallel test execution let’s integrate current framework with TestNG. TestNG provides an easier configuration and additional capabilities which makes it more powerful than that of JUnit.&lt;/p&gt;

&lt;p&gt;We start with creating a TestNG xml file to run the test suite. Add below xml code to your project root folder. If you are not familiar with TestNG then you can have a look at our &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=aug19_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;guide for running first TestNG automation script.&lt;/a&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](http://testng.org/testng-1.0.dtd)"&amp;gt;
&amp;lt;suite name="GoogleSearch" parallel="tests" thread-count="3"&amp;gt;

    &amp;lt;test name="WIN10TEST_FF"&amp;gt;
        &amp;lt;parameter name="browser" value="Firefox" /&amp;gt;
        &amp;lt;parameter name="version" value="64.0" /&amp;gt;
        &amp;lt;classes&amp;gt;
            &amp;lt;class name="com.cucumber.tests.TestNGRunCucumberTest" /&amp;gt;
        &amp;lt;/classes&amp;gt;
    &amp;lt;/test&amp;gt;

    &amp;lt;test name="WIN10TEST_CHROME"&amp;gt;
        &amp;lt;parameter name="browser" value="Chrome" /&amp;gt;
        &amp;lt;parameter name="version" value="71.0" /&amp;gt;
        &amp;lt;classes&amp;gt;
            &amp;lt;class name="com.cucumber.tests.TestNGRunCucumberTest" /&amp;gt;
        &amp;lt;/classes&amp;gt;
    &amp;lt;/test&amp;gt;

&amp;lt;/suite&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Replace your step definition file with below code. &lt;strong&gt;@Parameters&lt;/strong&gt; will help us to parameterize the desired capabilities such as browsername, version, platform etc. Have a look at &lt;a href="https://www.lambdatest.com/capabilities-generator/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug19_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest Capabilities Generator&lt;/a&gt; for fetching the coded values according to your desired capabilities. If you take a glance at above xml file we have two parameters which are browser and version. Thread count in the xml code represents the number of concurrent session which are possible. We have set it to 2 for demo purposes. Kindly replace the &lt;strong&gt;stepDefinition&lt;/strong&gt; code with below TestNG model.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.cucumber.stepdefs;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import com.cucumber.tests.TestNGRunCucumberTest;

import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;

public class stepDefinitions extends TestNGRunCucumberTest {

    [@Given](http://twitter.com/Given)("^user launches Google webapp$")
    public void user_launches_Google_webapp() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        driver.get(baseURL);
    }

    [@When](http://twitter.com/When)("^user searches for a \"([^\"]*)\"$")
    public void user_searches_for_a(String arg1) throws Throwable {
        WebElement searchBox = driver.findElement(By.name("q"));
        searchBox.sendKeys(arg1);
    }

    [@And](http://twitter.com/And)("^click on search button$")
    public void click_on_search_button() throws Throwable {
        WebElement searchBox = driver.findElement(By.name("q"));
        searchBox.submit();
    }

    [@Then](http://twitter.com/Then)("^results retreived should contain the \"([^\"]*)\" used$")
    public void results_retreived_should_contain_the_used(String resultString) throws Throwable {
        WebElement result = driver.findElement(By.xpath("//*[[@id](http://twitter.com/id)='rhscol'][1]"));
        if (result.isDisplayed()) {
            System.out.println("Resutls are retreived");
        } else {
            System.out.println("Resutls are not retreived");
        }
    }

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

&lt;/div&gt;

&lt;p&gt;As we have trigger the tests from xml file of TestNG we can replace the TestRunner file with below code, as our entry point would be TestNGRunner xml.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.cucumber.stepdefs;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import com.cucumber.tests.TestNGRunCucumberTest;

import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;

public class stepDefinitions extends TestNGRunCucumberTest {

    [@Given](http://twitter.com/Given)("^user launches Google webapp$")
    public void user_launches_Google_webapp() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        driver.get(baseURL);
    }

    [@When](http://twitter.com/When)("^user searches for a \"([^\"]*)\"$")
    public void user_searches_for_a(String arg1) throws Throwable {
        WebElement searchBox = driver.findElement(By.name("q"));
        searchBox.sendKeys(arg1);
    }

    [@And](http://twitter.com/And)("^click on search button$")
    public void click_on_search_button() throws Throwable {
        WebElement searchBox = driver.findElement(By.name("q"));
        searchBox.submit();
    }

    [@Then](http://twitter.com/Then)("^results retreived should contain the \"([^\"]*)\" used$")
    public void results_retreived_should_contain_the_used(String resultString) throws Throwable {
        WebElement result = driver.findElement(By.xpath("//*[[@id](http://twitter.com/id)='rhscol'][1]"));
        if (result.isDisplayed()) {
            System.out.println("Resutls are retreived");
        } else {
            System.out.println("Resutls are not retreived");
        }
    }

}


As we have trigger the tests from xml file of TestNG we can replace the TestRunner file with below code, as our entry point would be TestNGRunner xml.

package com.cucumber.tests;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

import cucumber.api.CucumberOptions;
import cucumber.api.testng.CucumberFeatureWrapper;
import cucumber.api.testng.PickleEventWrapper;
import cucumber.api.testng.TestNGCucumberRunner;

[@CucumberOptions](http://twitter.com/CucumberOptions)(features = { "src/test/java/features" }, glue = { "com.cucumber.stepdefs" }, plugin = { "pretty",
        "json:target/cucumber/cucumber.json" })

public class TestNGRunCucumberTest {

DesiredCapabilities capabilities = new DesiredCapabilities();

String username = " bharadwajpendyala";
    String accesskey = " qYlLn1IzVrC2U41zM4kyjv35EvpHxR2tyMB4aEBlkNMmvpnQ5A";
    protected static RemoteWebDriver driver = null;
    String gridURL = "[@hub](http://twitter.com/hub).lambdatest.com/wd/hub";
    boolean status = false;
    protected String baseURL = "[https://www.google.com](https://www.google.com)";
    private TestNGCucumberRunner testNGCucumberRunner;

[@BeforeClass](http://twitter.com/BeforeClass)
    [@Parameters](http://twitter.com/Parameters)(value = { "browser", "version" })
    public void beforeClass(String browser, float version) {
        capabilities.setCapability("build", "Cucumber_Project");
        capabilities.setCapability("name", "Querying in google engine");
        capabilities.setCapability("platform", "Windows 10");
        capabilities.setCapability("browserName", browser);
        capabilities.setCapability("version", version);
        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());
        }
        testNGCucumberRunner = new TestNGCucumberRunner(this.getClass());
    }

[@Test](http://twitter.com/Test)(groups = "cucumber scenarios", description = "Runs Cucumber Scenarios", dataProvider = "scenarios")
    public void scenario(PickleEventWrapper pickleEvent, CucumberFeatureWrapper cucumberFeature) throws Throwable {
        testNGCucumberRunner.runScenario(pickleEvent.getPickleEvent());
    }

/**
     * [@return](http://twitter.com/return) returns two dimensional array of {[@link](http://twitter.com/link) CucumberFeatureWrapper}
     *         objects.
     */
    [@DataProvider](http://twitter.com/DataProvider)
    public Object[][] scenarios() {
        return testNGCucumberRunner.provideScenarios();
    }

[@AfterClass](http://twitter.com/AfterClass)
    public void tearDown() {
        driver.quit();
        testNGCucumberRunner.finish();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After executing the above code for performing automation testing with Selenium, Cucumber, &amp;amp; TestNG. It is important to observe the details of your Selenium automation tests. LambdaTest provides every inch of information, from analytics to video logs for you to observe the output of your automation testing with Selenium.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automation Dashboard:
&lt;/h2&gt;

&lt;p&gt;Navigate to automation dashboard of lambdatest engine to view number of concurrent sessions being active and browser info as highlighted in the above screenshot.&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%2F2732%2F0%2AsxsC80lsJlhofLaR.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%2F2732%2F0%2AsxsC80lsJlhofLaR.png" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It provides the logs, metadata information, screenshots and video recording for the tests executed. Click on test to view the details specified above as in below snapshot.&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%2F2732%2F0%2A-Xt7wRchryA4SJdh.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%2F2732%2F0%2A-Xt7wRchryA4SJdh.png" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Analytics View:
&lt;/h2&gt;

&lt;p&gt;Analytical view of tests execution information could be viewed by click on analytics tab. This would provide a comprehensive view of builds passed, failed, day of execution, time taken, bugs logged from the testing etc. You can take a glance at it in the below image.&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%2F2732%2F0%2A0pCsK3L_O-rL9V-o.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%2F2732%2F0%2A0pCsK3L_O-rL9V-o.png" width="800" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Timeline View:
&lt;/h2&gt;

&lt;p&gt;Timeline would provide the information of test suite executed as a whole. Time and date of execution browser information, failures and error information if any. You can view tests executed in the form of build or test view.&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%2F2732%2F0%2AtI4vFygPQQcKxbDL.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%2F2732%2F0%2AtI4vFygPQQcKxbDL.png" width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To summarize we have explained what is cucumber, how does it help overcome challenges of traditional test methodologies. We have ran our first test script automation testing with Selenium and Cucumber framework after understanding what cross browser testing is all about. Also, how cross browser testing could be simplified using parallel cloud testing solution like LambdaTest. We have created a cucumber framework and configured it with LambdaTest integrating &lt;strong&gt;TestNG for parallel testing&lt;/strong&gt;. Happy Testing! 🙂&lt;/p&gt;

</description>
      <category>testing</category>
      <category>selenium</category>
      <category>testng</category>
    </item>
    <item>
      <title>Gauge Framework — How to Perform Test Automation</title>
      <dc:creator>Bharadwajpendyala12</dc:creator>
      <pubDate>Thu, 18 Aug 2022 05:44:24 +0000</pubDate>
      <link>https://dev.to/testmuai/gauge-framework-how-to-perform-test-automation-2d91</link>
      <guid>https://dev.to/testmuai/gauge-framework-how-to-perform-test-automation-2d91</guid>
      <description>&lt;p&gt;Gauge is a free open source &lt;a href="https://www.lambdatest.com/automation-testing?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;test automation&lt;/a&gt; framework released by creators of Selenium, ThoughtWorks. Test automation with Gauge framework is used to create readable and maintainable tests with languages of your choice. Users who are looking for integrating &lt;a href="https://www.lambdatest.com/blog/how-to-implement-continuous-testing-in-devops-like-a-pro/?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;continuous testing&lt;/a&gt; pipeline into their &lt;a href="https://www.lambdatest.com/blog/what-is-continuous-integration-and-continuous-delivery/?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;CI-CD(Continuous Integration and Continuous Delivery)&lt;/a&gt; process for supporting faster release cycles. Gauge framework is gaining the popularity as a great test automation framework for performing &lt;a href="https://www.lambdatest.com/?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;cross browser testing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This article would help you understand the benefits of using the &lt;a href="https://www.lambdatest.com/selenium-automation-testing-with-gauge-framework?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Gauge framework for Selenium test automation&lt;/a&gt;, installing and running your first automation script for test automation with Gauge test automation framework. I will also show you how to use LambdaTest Selenium grid for executing your automation script for test automation with Gauge test automation framework to perform extensive, automated &lt;a href="https://www.lambdatest.com/feature?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;browser compatibility testing&lt;/a&gt; with Gauge on cloud. Here we go!&lt;/p&gt;

&lt;p&gt;If you’re new to Selenium and wondering what it is then we recommend checking out our guide — &lt;a href="https://www.lambdatest.com/selenium?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;What is Selenium?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;This &lt;a href="https://www.lambdatest.com/blog/playwright-framework/?utm_source=devto&amp;amp;utm_medium=group&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;Playwright Automation&lt;/a&gt; testing tutorial will guide you through the setup of the Playwright framework.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Cross Browser Testing?
&lt;/h2&gt;

&lt;p&gt;Cross Browser Testing is the process to validate the quality of the web application across different browsers, browser versions running on numerous operating systems to verify compatibility and behaviour of an application under test.&lt;/p&gt;

&lt;p&gt;The browser differences are induced due to rendering engines. Each browser version has a unique engine responsible for representing the web elements in a different manner.&lt;/p&gt;

&lt;p&gt;We have a plethora of platforms, browser, browser versions to test. It would be strenuous and probable infeasible to have all the browsers installed in your local system as you perform test on them one by one. Also, you can’t go ahead having a device lab of your own. So how would you &lt;a href="https://www.lambdatest.com/blog/performing-cross-browser-testing-with-lambdatest/?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;perform cross browser testing&lt;/a&gt; in detail?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LambdaTest — A Free Cross Browser Testing Cloud&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;LambdaTest is a scalable, cloud-based testing platform designed to help you perform browser compatibility testing across 2000+ browsers and browser versions executing on various OS.&lt;/p&gt;

&lt;p&gt;LambdaTest can help you with live, interactive, &lt;a href="https://www.lambdatest.com/blog/34-ways-to-save-time-on-manual-cross-browser-testing/?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;manual cross browser testing&lt;/a&gt; as well as &lt;a href="https://www.lambdatest.com/?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;automated cross browser testing&lt;/a&gt; with the help of the Selenium grid supporting all the major programming languages, automation frameworks compatible with Selenium WebDriver and offers a plethora of browsers to test from.&lt;/p&gt;

&lt;p&gt;In order to overcome the manual overhead and time consumed in testing automating the repetitive task would be delightful. And combining your automated tests with Parallel Execution would save a considerable amount of execution time.&lt;/p&gt;

&lt;p&gt;Executing a huge number of tests in parallel locally could be a challenge due to resource constraints in terms of scalability. However, you can easily scale with cloud based, cross browser testing tools such as LambdaTest would help you to effortlessly perform parallel execution of your automation test scripts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Choose Gauge For Cross Browser Testing Out Of Other Test Automation Frameworks?
&lt;/h2&gt;

&lt;p&gt;Now, that we are aware of the basics regarding the Gauge framework and cross browser testing. Let me tell you why I prefer to perform test automation with Gauge test automation framework over other test automation frameworks.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Wide range of templates are available in a language of your choice to have an easy kick start to the project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Command Line support which makes the integration easier with CI-CD tools.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test automation with Gauge framework supports all major programming languages along with GoLang.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It supports wide variety of plugins, here is a list of all plugin categories available.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Language Runners:&lt;/strong&gt; Java runner, C# runner, C# runner(.Net Core), Ruby runner, Javascript runner, Golang runner and Python runner.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;IDE Plugins:&lt;/strong&gt; Visual Studio Code, IntelliJ and Visual Studio.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reports:&lt;/strong&gt; HTML Report, XML Report, JSON Report, Spectacle and Flash.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Build Management:&lt;/strong&gt; Maven and Gradle&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can even create your own plugin using their open source Gauge API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Quickly detect issues through screenshots of event failures and multiple reporting formats available instead of navigating through stack traces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Allows you to create scalable tests through parallel execution and being an open-source it offers integrations with cloud-based solutions like LambdaTest for addressing the cross browser testing goals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Better management of data sets through data driven testing with multiple data sets is possible while keeping specifications highly readable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easy to &lt;a href="https://www.lambdatest.com/blog/17-lessons-i-learned-for-writing-effective-test-cases/?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;write effective test cases&lt;/a&gt; by members across the team.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automated cross browser testing made easy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability of product requirements across the QA, Dev and Business teams.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Try this online &lt;a href="https://dev.tourl"&gt;Selenium Automation&lt;/a&gt; Grid to run your browser automation testing scripts.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Is Gauge Framework Meant For BDD(Behaviour-Driven Development)?
&lt;/h2&gt;

&lt;p&gt;Users often tend to compare creation of spec files for test automation with Gauge framework is the same way as we develop feature files in BDD using Gherkin, believe me there is a lot of difference in between them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Behaviour Driven Development focuses more on conversations, collaborations and automation in order to achieve the business needs, test automation with Gauge framework following Acceptance Test Driven Development focuses and emphasize more on functional testing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Feature file in BDD is replaced by spec file for test automation with Gauge framework.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Feature file is created with Gherkin Language, Spec file is created using markdown language.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test automation with Gauge test automation framework provides templates for automation where BDD doesn’t depending upon the language.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gauge has all the BDD features intact making BDD a subset of test automation with Gauge framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing &amp;amp; Setting Up Gauge For Your Operating System
&lt;/h2&gt;

&lt;p&gt;Download the latest build of gauge from GitHub-Gauge. Depending upon the operating system, download the required binaries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Gauge Framework in Mac:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Installing Gauge framework in macOS using Homebrew with below commands:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;brew update&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;brew install gauge.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Installing Gauge Framework in Linux using apt-get:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Add GPG key with below command:&lt;br&gt;
sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-keys 023EDB0B&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add Gauge framework repository to the list.&lt;br&gt;
echo deb &lt;a href="https://dl.bintray.com/gauge/gauge-deb" rel="noopener noreferrer"&gt;https://dl.bintray.com/gauge/gauge-deb&lt;/a&gt; nightly main | sudo tee -a /etc/apt/sources.list&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install Gauge framework with below commands:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;sudo apt-get update&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;sudo apt-get install gauge&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Installing Gauge Framework in Windows:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Complete the installation of required packages of programming languages. It works with all languages like JavaScript, C#, Java, Python and Ruby.&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%2F1%2AN28FhHAzGwXpMuA0uHejxg.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%2F1%2AN28FhHAzGwXpMuA0uHejxg.png"&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%2F1%2Ap5-FZqZVhRM0Vl2cSjpmKg.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%2F1%2Ap5-FZqZVhRM0Vl2cSjpmKg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Extract it to a desired location and add it to system path.&lt;/em&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsov89308vvnf2i060oao.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%2Fsov89308vvnf2i060oao.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Using CLI To Get Started With Project Creation For Gauge
&lt;/h2&gt;

&lt;p&gt;To verify the version of the Gauge test automation framework, open cmd and type command “gauge --version” as shown in the image below.&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%2F1%2AEMPqSmTnTYsWoUPamAVReA.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%2F1%2AEMPqSmTnTYsWoUPamAVReA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: Gauge framework has a list of project templates defined already for the language of your need. You can take a look at it by typing in command “gauge init --templates”.&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%2F1%2AaEHJxERZltgLz5ej7S7gDw.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%2F1%2AaEHJxERZltgLz5ej7S7gDw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;: Navigate to a folder of your choice and create a java project using command “gauge init java”.&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%2F1%2AEK9hqKcEN9Uppw4qNwoG6A.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%2F1%2AEK9hqKcEN9Uppw4qNwoG6A.png"&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcxs32otlf94p0ti5giud.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%2Fcxs32otlf94p0ti5giud.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;: To run the sample project and view report you can use the command “gauge run specs”.&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%2F1%2AQaNfWxKbTORcJCvLhKXfrg.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%2F1%2AQaNfWxKbTORcJCvLhKXfrg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see the path to report generated in &lt;strong&gt;CLI(Command Line Interface)&lt;/strong&gt;, sample report generated for the test stub executed is as below.&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%2F3200%2F1%2AKUOTMgiQjAUK5O02F6L18g.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%2F3200%2F1%2AKUOTMgiQjAUK5O02F6L18g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Your First Project Using Gauge For Test Automation
&lt;/h2&gt;

&lt;p&gt;As we have made use of command line till now, for a better coding experience we can make use of IntelliJ IDE to create our first script. Start with creating a maven project with below information.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Navigate to File and select New Project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Project Type as maven should be selected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You need to select the below mentioned name:&lt;br&gt;
“&lt;strong&gt;com.thoughtworks.gauge.maven:gauge-maven-plugin&lt;/strong&gt;”&lt;br&gt;
This would help you to generate an archetype.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you don’t see the archetype mentioned above, add Archetype by entering below info.&lt;br&gt;
GroupId: “&lt;strong&gt;com.thoughtworks.gauge.maven:&lt;/strong&gt;&lt;br&gt;
ArtifactId: “&lt;strong&gt;gauge-archetype-java&lt;/strong&gt;”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After selecting the archetype, you need to click on next. By doing so, you will be providing the Artifact ID &amp;amp; GroupID for your respective maven project.&lt;br&gt;
GroupId: &lt;strong&gt;com.thoughtworks.gauge.maven&lt;/strong&gt;&lt;br&gt;
ArtifactId: &lt;strong&gt;GoogleSearchProject&lt;/strong&gt;&lt;br&gt;
Version: &lt;strong&gt;1.0-SNAPSHOT&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Before you click on next for finishing the process, make sure that you verify the Maven settings thoroughly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you have successfully created a project it would look something as below.&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%2F1%2Atli964-k6qqzGb18zJkfEg.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%2F1%2Atli964-k6qqzGb18zJkfEg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Running First Automation Script Using Gauge Framework With Selenium Grid
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: Create a specification file for searching a keyword in google and if results are displayed as expected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specification&lt;/strong&gt; heading in the specs file would be denoted with ‘#’ notation as defined in our project.&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;: #Google Search Specification&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt; would be defined using ‘##’ notation, quoting an example below for reference.&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;: ## Searching google should return the name of the query.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt; would be defined using ‘&lt;em&gt;’ notation.&lt;br&gt;
**Example&lt;/em&gt;&lt;em&gt;: * **Navigate&lt;/em&gt;* to “&lt;a href="https://www.google.co.in/" rel="noopener noreferrer"&gt;https://www.google.co.in&lt;/a&gt;“. Spec file create for Google search is as below:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;# Google Search Specification&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Searching google should return the name of query
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Navigate to “&lt;a href="https://www.google.co.in%E2%80%9D" rel="noopener noreferrer"&gt;https://www.google.co.in”&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter query “query” in the search box and submit&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The search results should show “LambdaTest” as a result&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;: Create a step implementation file, with below-mentioned code to define acceptance tests as defined in specification files.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.thoughtworks.gauge.maven;

import com.thoughtworks.gauge.Step;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import static org.junit.Assert.assertEquals;

public class StepImplementation {

public static WebDriver driver;

[@Step](http://twitter.com/Step)("Navigate to &amp;lt;[https://www.google.co.in](https://www.google.co.in)&amp;gt;")
    public void navigateTo(String url) throws InterruptedException {
        System.setProperty("webdriver.chrome.driver", "C:\\Users\\Dexy\\IdeaProjects\\GaugeSampleProject\\libs\\chromedriver.exe");
        driver = new ChromeDriver();
        driver.get(url);
        Thread.sleep(2000);
    }

[@Step](http://twitter.com/Step)("Enter query &amp;lt;query&amp;gt; in the search box and submit")
    public void enterQuery(String queryL) throws InterruptedException {
        WebElement searchBox = driver.findElement(By.name("q"));
        searchBox.sendKeys("LambdaTest");
        searchBox.submit();
        Thread.sleep(2000);
    }

[@Step](http://twitter.com/Step)("The search results should show &amp;lt;Jupiter&amp;gt; as result")
    public void verifySearchResult(String resultString) {
        WebElement result = driver.findElement(By.className("LC20lb"));
        assertEquals(resultString, result.getText());
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;: Execute the test case from the specification file created. Right click on the file and select option as shown in the image below. Browser specification could be provided in env folder’s default.properties file as&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;#Browser Usage&lt;br&gt;
BROWSER = CHROME&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can provide maven command to execute with conditions as below.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;To execute&lt;br&gt;
mvn gauge:execute&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To execute all specs:&lt;br&gt;
mvn gauge:execute -DspecsDir=specs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For parallel execution:&lt;br&gt;
mvn gauge:execute -DspecsDir=specs -DinParallel=true&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Node specification during parallel execution:&lt;br&gt;
mvn gauge:execute -DspecsDir=specs -DinParallel=true -Dnodes=2&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%2F2304%2F1%2AVd1E_N15WuJWZkD-wcMlGQ.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%2F2304%2F1%2AVd1E_N15WuJWZkD-wcMlGQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;: Once execution has been successfully completed you can verify the status of the test 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqvsxqqblhc3fzjch4kr1.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%2Fqvsxqqblhc3fzjch4kr1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reports generated can be viewed in reports folder — ‘&lt;strong&gt;GaugeSampleProject\reports\html-report&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%2F3200%2F1%2AmUp6zh_BvNPHW0WXHliOvw.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%2F3200%2F1%2AmUp6zh_BvNPHW0WXHliOvw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would be providing the link to GitHub repository for code references below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/bharadwaj-pendyala/LambdaTest_Gauge?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;https://github.com/bharadwaj-pendyala/LambdaTest_Gauge&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the above step being done, we have successfully completed installation of Gauge for test automation, creating our first script and running it. Now let’s jump into some of the advanced concepts and values adds which could decrease our execution time drastically for faster releases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;This &lt;a href="https://www.lambdatest.com/blog/cypress-test-automation-framework/?utm_source=devto&amp;amp;utm_medium=group&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Cypress test automation&lt;/a&gt; testing tutorial will help you learn the benefits of Cypress automation.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Cross Browser Testing with Parallel Execution using Gauge Framework
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem Statement:&lt;/strong&gt;&lt;br&gt;
When it comes to cross browser testing there are more than 6 active browsers usage and each browser having more than 4 to 5 version of it in use aggressively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case Study Depiction:&lt;/strong&gt;&lt;br&gt;
Let’s consider a case study where we have a regression test repository consisting of 1000 test cases to validate per release. When we consider cross browser testing effort, a calculated effort would be around 1000 test cases* 6 browsers * 5 versions each = 30,000 Test Cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Local Execution using Selenium-Grid:&lt;/strong&gt;&lt;br&gt;
You would end up executing 30,000 test cases in total. Manually handling the effort would be impossible. Parallelly executing the test cases using Selenium Grid might decrease the effort, however, scalability would be an issue, you can’t execute more than 10–20 instances on your local machine depending on the physical memory and the number of cores CPU has. Also, installing thousands of browsers in a system would be very infeasible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cloud Execution using LambdaTest:&lt;/strong&gt;&lt;br&gt;
Utilizing cloud resources of LambdaTest would drastically cut down the effort as scalability wouldn’t be an issue. LambdaTest Selenium Automation Grid for Gauge empowers you to perform end-to-end automation tests on a secure, reliable, and scalable Selenium grid on their cloud platform. You can perform automated cross browser testing with Selenium scripts on 2000+ browsers and operating systems environments providing a higher test coverage and at significantly fewer build times. LambdaTest will help you evaluate how well your web application renders when accessed through a variety of different browser. You can perform automated cross browser &lt;a href="https://www.lambdatest.com/local-page-testing?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;testing of your locally hosted web pages&lt;/a&gt; using Lambda Tunnel. You could also perform automated parallel test to run a single test across multiple browser/OS configurations, simultaneously.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Configuring Our Current Gauge Framework For Test Automation With LambdaTest
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: Create an account for free on LambdaTest to start cross browser testing with parallel execution. For a free account, only 1 concurrent user is available, as more than 1 VM’s need account upgrade. Feel free to look at their pricing plans over here:&lt;br&gt;
&lt;a href="https://accounts.lambdatest.com/billing/plans?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;https://accounts.lambdatest.com/billing/plans&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Navigate to “Selenium Desiredcapabilities Generator” tool by LambdaTest at &lt;a href="https://www.lambdatest.com/capabilities-generator/?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;https://www.lambdatest.com/capabilities-generator/&lt;/a&gt; as shown in image below.&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%2F2704%2F1%2AOuf2AollApHHAei8eA3LTg.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%2F2704%2F1%2AOuf2AollApHHAei8eA3LTg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;: Select the required programming language and operating system and browser configuration as per the requirement, you can enable screenshots and video recording as well. You have a feature of enabling advance configuration as well, which lets you define tunnel, console and network logs and time zone selections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;: Copy the code and define the capabilities for remote webdriver in your Step Implementation file. Code for the same as specified below.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.thoughtworks.gauge.maven;

import com.thoughtworks.gauge.Step;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.MalformedURLException;
import java.net.URL;
import static org.junit.Assert.assertEquals;

public class StepImplementation {

String username = " YOUR_USERNAME";
    String accesskey = " YOUR_ACCESS_KEY";
    static RemoteWebDriver driver = null;
    String gridURL = "[@hub](http://twitter.com/hub).lambdatest.com/wd/hub";
    boolean status = false;

[@Step](http://twitter.com/Step)("Navigate to &amp;lt;[https://www.google.co.in](https://www.google.co.in)&amp;gt;")
    public void navigateTo(String url) throws InterruptedException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("build", "your build name");
        capabilities.setCapability("name", "your test name");
        capabilities.setCapability("platform", "Windows 10");
        capabilities.setCapability("browserName", "Chrome");
        capabilities.setCapability("version", "71.0");
        capabilities.setCapability("visual", true);
        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());
        }
        driver.get(url);
        Thread.sleep(2000);
    }

[@Step](http://twitter.com/Step)("Enter query &amp;lt;query&amp;gt; in the search box and submit")
    public void enterQuery(String query) throws InterruptedException {
        WebElement searchBox = driver.findElement(By.name("q"));
        searchBox.sendKeys("LambdaTest");
        searchBox.submit();
        Thread.sleep(2000);
    }

[@Step](http://twitter.com/Step)("The search results should show &amp;lt;Jupiter&amp;gt; as result")
    public void verifySearchResult(String resultString) {
        WebElement result = driver.findElement(By.className("LC20lb"));
        assertEquals(resultString, result.getText());
    }

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

&lt;/div&gt;

&lt;p&gt;Specified parameters required while setting desired capabilities required for executing test remotely.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;PARAMETER&lt;/th&gt;
&lt;th&gt;DESCRIPTION&lt;/th&gt;
&lt;th&gt;EXAMPLE&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;YOUR_USERNAME&lt;/td&gt;
&lt;td&gt;Lamda Test username should be provided as an input&lt;/td&gt;
&lt;td&gt;tester1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;YOUR_ACCESS_KEY&lt;/td&gt;
&lt;td&gt;Access token can be generated through lambdatest webapp&lt;/td&gt;
&lt;td&gt;qYlLn1IzVrC2U41zM4kyjv35EvpHxR2tyMB4aEBlkNMmvpnQ5A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;gridURL&lt;/td&gt;
&lt;td&gt;To hit lamdatest grid URL of your account&lt;/td&gt;
&lt;td&gt;“&lt;a class="mentioned-user" href="https://dev.to/hub"&gt;@hub&lt;/a&gt;.lambdatest.com/wd/hub”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;build&lt;/td&gt;
&lt;td&gt;Your build name&lt;/td&gt;
&lt;td&gt;“Build_12.2.012”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;name&lt;/td&gt;
&lt;td&gt;Your test name&lt;/td&gt;
&lt;td&gt;“TC_01_Sample Test Case”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;platform&lt;/td&gt;
&lt;td&gt;Specify desired platform&lt;/td&gt;
&lt;td&gt;Windows 10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;browserName&lt;/td&gt;
&lt;td&gt;Specify desired browser for test to execute&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;version&lt;/td&gt;
&lt;td&gt;Specify desired browser version&lt;/td&gt;
&lt;td&gt;“71.0”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;visual&lt;/td&gt;
&lt;td&gt;Specify if video recording is required for the test&lt;/td&gt;
&lt;td&gt;TRUE&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt;: Execute the specification and observe the terminal for test status.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6&lt;/strong&gt;: Login to LambdaTest Dashboard, select the automation tab to view your logs of completed tests. Dashboard view would let you see the analytical information related to the tests triggered on the LambdaTest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logs:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Automation logs which are a part of the automation dashboard provides you with information related to server information, test ID, time stamp of execution in JSON 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdw4lxyarsibasdmz4e70.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%2Fdw4lxyarsibasdmz4e70.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Metadata&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Metadata under automation dashboard provides information related to input, meta and browser configuration as shown in image below.&lt;/p&gt;

&lt;p&gt;You can even download the test logs such as screenshots and video recordings, if opted from this tab.&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%2F3200%2F1%2AvDUSArl36cNL6ZhsYXf79g.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%2F3200%2F1%2AvDUSArl36cNL6ZhsYXf79g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analytics Dashboard&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Analytic view of builds ran, time consumed, build related information of test status such as pass or fail and bugs logged which can be viewed in both build view and test view.&lt;/p&gt;

&lt;p&gt;You can even sort the data using date, user information.&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%2F3200%2F1%2Agkt_86FOrA9c_8YGgONTpg.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%2F3200%2F1%2Agkt_86FOrA9c_8YGgONTpg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dashboard&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Default dashboard view provides you with the overview of how many active concurrent sessions are running and minutes consumed in execution and the build statuses.&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%2F3200%2F1%2AanZmaBlEpsW5pKxyn2QXXg.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%2F3200%2F1%2AanZmaBlEpsW5pKxyn2QXXg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automation Dashboard View&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Automation dashboard view would help you view the timeline of tests executed and information of logs, metadata and network related information for each test explicitly.&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%2F3200%2F1%2ARg3aGnhz5jQJKwapueYAxQ.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%2F3200%2F1%2ARg3aGnhz5jQJKwapueYAxQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test Script maintenance becomes a nightmare once the test framework attains maturity or if we have to make use of the framework for upcoming builds without any problems. Test automation with Gauge framework make both, test authoring and test maintenance, an easy task.&lt;/p&gt;

&lt;p&gt;Another highlight for performing test automation with Gauge framework is the excellent support system, you can reach out to the creators through creating a GitHub issue if you face any roadblocks and if you are in need of help with the framework.&lt;/p&gt;

&lt;p&gt;To conclude what we have discussed so far, we have kick started our framework setup of the Gauge framework from scratch and created our first script and integrated it with LambdaTest to achieve our cross browser testing and parallel execution goals. Discussed the features and benefits of the tool, importance and the need of cross browser and parallel test execution along with execution and analysis of logs in LambdaTest platform.&lt;/p&gt;

&lt;p&gt;There is a lot more to LambdaTest than Selenium based automated cross browser testing. You can reach out to their customer support chat from here in case of any questions. You could also schedule a free of cost, &lt;a href="https://www.lambdatest.com/demo?utm_source=medium&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug18_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;complete product demo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thank you for reading the article, please let me know your thoughts in the comments section.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>How To Build Your First CI/CD Pipeline With Travis CI?</title>
      <dc:creator>Bharadwajpendyala12</dc:creator>
      <pubDate>Wed, 17 Aug 2022 10:45:16 +0000</pubDate>
      <link>https://dev.to/testmuai/how-to-build-your-first-cicd-pipeline-with-travis-ci-4g6c</link>
      <guid>https://dev.to/testmuai/how-to-build-your-first-cicd-pipeline-with-travis-ci-4g6c</guid>
      <description>&lt;p&gt;&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=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Continuous Integration&lt;/a&gt; is considered one of the best practices in development where code integrations are done frequently into the code repository rather than waiting to commit a larger version. As a part of continuous integration, the developer should ensure that integrations should not break the already available code, as being a shared repository would have a significant impact. To solve this problem and show how continuous integration and testing works, we’ll use one of the most popular continuous integration services: Travis CI pipeline.&lt;/p&gt;

&lt;p&gt;Travis CI pipeline would help the user report automatic build changes and test the integrations and deployment management. It also helps your code repository with improved and shippable software quality with reduced risks and better collaboration.&lt;/p&gt;

&lt;p&gt;In today’s blog, I will walk you through the Travis CI overview and the advantages of using Travis CI. You will also see how to configure Travis CI pipeline with your current test automation repository over an &lt;a href="https://www.lambdatest.com/selenium-grid-online?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;online Selenium Grid&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Now, Automate &lt;a href="https://www.lambdatest.com/cypress-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;Cypress cloud&lt;/a&gt; tests and perform browser automation testing with LambdaTest.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to Travis CI
&lt;/h2&gt;

&lt;p&gt;Travis CI is a cloud-based CI service that builds and tests your projects hosted on GitHub. It would trigger a build process to validate the build and report any failures for every commit made. It fetches the commands from a .travis.yml file, a YAML-based file format, from your project’s root folder to get started with the build process. Travis YML file would enable the Travis CI to understand which programming languages are being used, branch specifications required for the build to be triggered, installation of dependencies if there are any required.&lt;/p&gt;

&lt;p&gt;Every other code repository has its Continuous Integration tools nowadays. Let’s take Bitbucket being an Atlassian code repo, Bamboo is a tool that comes along. If you prefer GitLab as your code repo, &lt;a href="https://www.lambdatest.com/blog/automated-testing-pipeline-with-gitlab-ci-cd-and-selenium/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;GitLab CI&lt;/a&gt; exists. Tool selection could also be majorly impacted due to the code repository being used for version controlling. Currently, we have a myriad of tools available which are both free and open source. To choose the tools that best suits your requirement, you can go through some of the &lt;a href="https://www.lambdatest.com/blog/31-best-ci-cd-tools/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;top CI/CD tools&lt;/a&gt; available today. Also, you can make a &lt;a href="https://www.lambdatest.com/learning-hub/cicd?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;comparison of the top CI/CD tools&lt;/a&gt; to make your selection.&lt;/p&gt;

&lt;p&gt;Dependencies rely on the development environment being used and the code repositories used for version control purposes.&lt;/p&gt;

&lt;p&gt;In the case of Travis CI, below are some of the prerequisites to get started.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A mandatory GitHub account&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Permission for integrating GitHub code repo with the Travis CI.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Travis CI?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It seamlessly integrates with GitHub and is easy to set up. Users need to Sign Up with GitHub and authorize to sync their GitHub projects which we would have a detailed walkthrough in the upcoming configuration section of the article.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extensive Travis CI documentation is available to get started, where you can head over for reference. It has sections related to installing dependencies, configuration options in different programming languages, and encryption and integration topics discussed in detail.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Support almost every other programming language and cloud solution for deployments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Travis CI would seamlessly integrate with cross browser testing solutions such as LambdaTest for parallel testing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Travis CI is not platform-dependent as it supports multiple platforms apart from Windows, such as Mac and Linux. Infrastructure dependencies might vary depending upon the environment being used. However, you can navigate through the detailed documentation available.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Travis CI is free for open-sourced projects, i.e., projects that are public over GitHub. For private repositories, there is an enterprise version available.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automatic build triggers when there is a change in the code repository with the user’s desired configuration. The user can select the branch name specified in the Travis yml file in the root folder of your project.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Travis CI Challenges
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;With integrations limited to GitHub, GitLab, Bitbucket, and Assembla cloud repository, using Travis CI outside of GitHub isn’t as user friendly as with GitHub.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Private repo comes in an Enterprise Version where you have to pay after trial version, which involves the first 100 builds for free.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Are you using &lt;a href="https://www.lambdatest.com/playwright-testing?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;Playwright automated testing&lt;/a&gt;? Now run your Playwright test scripts instantly on 50+ browser/OS combinations using the LambdaTest cloud.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Building your first CI/CD pipeline with Travis CI
&lt;/h2&gt;

&lt;p&gt;Any public repository can be used to create a free pipeline. Let’s get started with the Configuration of Travis CI pipeline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Log in to your GitHub account with a valid username and password. Select the repo you are planning to integrate with Travis CI pipeline. Make sure your repo is up to date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Log on to &lt;a href="https://travis-ci.com/" rel="noopener noreferrer"&gt;Travis CI&lt;/a&gt; and sign up with your GitHub account used above.&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%2AkG1sbJKHmUAkAM69.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%2AkG1sbJKHmUAkAM69.png" width="800" height="829"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Provide authorization as requested, reference provided in the below image.&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%2Fuuzzntkn67zctog7351r.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%2Fuuzzntkn67zctog7351r.png" width="706" height="983"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Once you have completed the sign-up and authorization process, you would be redirected to the dashboard, where you would be prompted for a sync account option towards the left-hand corner of your screen. This would ideally sync all your existing GitHub projects with your Travis CI pipeline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Under Legacy Service Integrations, you can view all your current repositories synced on your Travis CI pipeline.&lt;/p&gt;

&lt;p&gt;By default, the CI process for all repositories would be turned off. Toggle the button to turn on the integration for a specific 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%2AQB86jZ3Vs8w31bEo.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%2AQB86jZ3Vs8w31bEo.png" width="676" height="49"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Now, you need to add a .travis.yml file to your current automated test suite’s root folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a .travis.yml file?
&lt;/h2&gt;

&lt;p&gt;Travis YML is a configuration file placed in your project’s root folder to define how to configure the build-related information.&lt;/p&gt;

&lt;p&gt;If a .travis.yml is not in your repository or is not valid YAML, Travis CI pipeline will ignore it. You can also find all language-related templates from the Travis CI language template. The file consists of information such as what programming language is being used, what operating system is being used, branch name of the repo, which is being targeted.&lt;/p&gt;

&lt;p&gt;Once the .travis.yml file is created and pushed to the GitHub repo, upcoming commits to the repo would trigger a build in Travis CI cloud, similar to that of the below image. After successful integration with the help of a configuration file, Travis CI pipeline has a certain mechanism that compiles the GitHub code whilst it would pull in the code for the first time and then on each commit to the repo or the specific branch trigger a compilation process. Provided below are the screens of Travis CI pipeline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Active Repositories View:&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%2F2048%2F0%2AG9n4kx5bBFUpCkRG.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%2F2048%2F0%2AG9n4kx5bBFUpCkRG.png" width="800" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JobView after build completion:&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%2F2048%2F0%2AvbBYEi4qmtvZFxOA.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%2F2048%2F0%2AvbBYEi4qmtvZFxOA.png" width="800" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Job Log Sample:&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%2F2048%2F0%2AWJn6LouiTd-0Eq_y.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%2F2048%2F0%2AWJn6LouiTd-0Eq_y.png" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View Config with the configuration information:&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%2AhytfnAgWD8wy1NOB.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%2AhytfnAgWD8wy1NOB.png" width="800" height="525"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7:&lt;/strong&gt; Fork the GitHub repo and sync with Travis CI pipeline through the above process.&lt;/p&gt;

&lt;p&gt;If you don’t want to fork the above-mentioned repo, make sure you select a repository, which is not empty in your GitHub account enabled with build tool configuration such as Maven or Ant. This would be helpful in the compilation process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8:&lt;/strong&gt; Enable the synced repository. Once you enable it, this synced repo should be visible on my repositories page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 9:&lt;/strong&gt; Add .travis.yml file to the repo with the below build configuration for compilation.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;language: java
sudo: false
script: "mvn test"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Ensure that you enable your framework so that tests get triggered through the maven command — “mvn test” as specified in the configuration file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 10:&lt;/strong&gt; Once the above configuration file is committed and pushed to the main branch in GitHub. You would observe a test getting triggered with build and worker information in the job log view. This process would essentially trigger your first compilation by pulling in code from the GitHub account onto the VM created by Travis CI pipeline.&lt;/p&gt;

&lt;p&gt;As we have configured our tests to run on the LambdaTest Platform through RemoteWebDriver class, once a new commit is made, it triggers execution of the specified test suite onto the LambdaTest Platform. This will ideally identify if any user-made commit is breaking the build or the automated test suite.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating Travis CI pipeline for automated testing with LambdaTest
&lt;/h2&gt;

&lt;p&gt;LambdaTest is a cloud-based &lt;a href="https://www.lambdatest.com/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;cross browser testing&lt;/a&gt; solution, which would enable us to perform automated and live interactive cross browser testing on more than 3000 browsers and operating systems online. This would help you scale up and down without much of a hassle in terms of resource allocation and deallocation. It would also help you support budget estimations on resources used for parallel and cross browser testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing Local or Privately Hosted Projects
&lt;/h2&gt;

&lt;p&gt;Global enterprises use private servers for their IT purposes for enabling better web protection and security. LambdaTest would seamlessly integrate with such platforms with the help of a secure shell tunneling feature called &lt;a href="https://www.lambdatest.com/support/docs/testing-locally-hosted-pages/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;LambdaTest Tunnel&lt;/a&gt;. This would also enable you to test locally hosted web pages. Let’s discuss how to configure LambdaTest Tunnel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Navigate to &lt;a href="https://automation.lambdatest.com/build?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Automation Dashboard&lt;/a&gt; as shown in the below image after logging in to your LambdaTest platform.&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%2F2048%2F0%2AkWScyQHWNDHnybQe.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%2F2048%2F0%2AkWScyQHWNDHnybQe.png" width="800" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Once you click on configure tunnel feature, you would be prompted with an overlay with two sections being internal server configurations and locally hosted web page testing features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Copy the access token related to the desired feature of an application under test. Please refer to the below token for reference.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LT -user [lambdatest@sampleemail.com](mailto:lambdatest@sampleemail.com) -key qYlLn1IzVrC2U41zM4kyjv35EvpHxR2tyMB4aEBlkNMmvpnQ5A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We would be making use of this token while configuring our desired capabilities in our next section of the article below to demonstrate Parallel Testing with LambdaTest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Try this online &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;Selenium Automation&lt;/a&gt; Grid to run your browser automation testing scripts.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Parallel Testing With LambdaTest Selenium Grid
&lt;/h2&gt;

&lt;p&gt;We will see how to perform parallel testing with an online Selenium Grid using an automated testing pipeline, like Travis CI pipeline. We would be making use of our Cucumber TestNG code repository for reference. You need to clone the code and then import the code into the desired IDE.&lt;/p&gt;

&lt;p&gt;We would be declaring our LambdaTest username and password as global environment variables in the yml file in the below format to be considered for execution.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;env:
 global:

   - LT_USERNAME=${LAMBDATEST_USERNAME}
    - LT_ACCESS_KEY=${LAMBDATEST_KEY}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Where the global variable for LambdaTest username would be LT_USERNAME, and LambdaTest password would be LT_ACCESS_KEY. The same can be retrieved from the &lt;a href="https://accounts.lambdatest.com/detail/profile?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug17_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Profile Section&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Your .travis.yml code would be something similar to as below.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;language: java
sudo: false
script: "mvn test"
env:
 global:
    - LT_USERNAME=${LAMBDATEST_USERNAME}
    - LT_ACCESS_KEY=${LAMBDATEST_KEY}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can make use of this variable while trying to trigger a remote web driver execution, as shown in the below code in the case of our Cucumber+TestNG code.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.cucumber.tests;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

import cucumber.api.CucumberOptions;
import cucumber.api.testng.CucumberFeatureWrapper;
import cucumber.api.testng.PickleEventWrapper;
import cucumber.api.testng.TestNGCucumberRunner;

@CucumberOptions(features = { "src/test/java/features" }, glue = { "com.cucumber.stepdefs" }, plugin = { "pretty",
        "json:target/cucumber/cucumber.json" })

public class TestNGRunCucumberTest {

    DesiredCapabilities capabilities = new DesiredCapabilities();

    /*
     * Previous declarations for LambdaTest Connect 
     * String username = "LT_USERNAME"; 
     * String accesskey = " LT_ACCESS_KEY";
     */

    protected static RemoteWebDriver driver = null;
    String gridURL = "@hub.lambdatest.com/wd/hub";
    boolean status = false;
    protected String baseURL = "https://www.google.com";
    private TestNGCucumberRunner testNGCucumberRunner;

    @BeforeClass
    @Parameters(value = { "browser", "version" })
    public void beforeClass(String browser, float version) {
        capabilities.setCapability("build", "Cucumber_Project_Google");
        capabilities.setCapability("name", "Querying in google engine");
        capabilities.setCapability("platform", "Windows 10");
        capabilities.setCapability("browserName", browser);
        capabilities.setCapability("version", version);
        try {
            driver = new RemoteWebDriver(new URL("https://" + LT_USERNAME + ":" + LT_ACCESS_KEY + gridURL),
                    capabilities);
        } catch (MalformedURLException e) {
            System.out.println("Invalid grid URL");
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        testNGCucumberRunner = new TestNGCucumberRunner(this.getClass());
    }

    @Test(groups = "cucumber scenarios", description = "Runs Cucumber Scenarios", dataProvider = "scenarios")
    public void scenario(PickleEventWrapper pickleEvent, CucumberFeatureWrapper cucumberFeature) throws Throwable {
        testNGCucumberRunner.runScenario(pickleEvent.getPickleEvent());
    }

    /**
     * @return returns two dimensional array of {@link CucumberFeatureWrapper}
     *         objects.
     */
    @DataProvider
    public Object[][] scenarios() {
        return testNGCucumberRunner.provideScenarios();
    }

    @AfterClass
    public void tearDown() {
        driver.quit();
        testNGCucumberRunner.finish();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Once you replace the TestNG Runner file with the above code for the integration of LambdaTest based parallel execution with the help of Travis CI automated testing pipeline, this would help you get the test execution trigger in the LambdaTest platform as shown in the image below.&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%2F2048%2F0%2AYuCa1kijJVk5YUOH.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%2F2048%2F0%2AYuCa1kijJVk5YUOH.png" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;We have discussed the importance of continuous integration and how it can be leveraged using Travis CI pipeline and its advantages and disadvantages. We have seen the need for parallel and cross browser testing using cloud solutions such as LambdaTest with an automated testing pipeline. Also, Travis CI’s configuration with one of our frameworks using Cucumber and TestNG for triggering tests on LambdaTest to achieve our cross browser testing goals.&lt;/p&gt;

&lt;p&gt;To kick start a deployment, you would need a quality check in place to validate the build. You cannot depend on a manual test process to test each and every build integration into the environment. It is not automated and requires human dependency, which proves to be tiresome and has a high chance of failure. To avoid manual quality checks for providing a sign-off to the build, we ensure that we have an automated test suite that acts as a checkpoint in the Continuous Integrations through Continuous Deployment processes with Travis CI pipeline’s help.&lt;/p&gt;

&lt;p&gt;Thanks for reading the article. Have a great day and Happy Testing!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>devops</category>
      <category>cicd</category>
      <category>python</category>
    </item>
    <item>
      <title>How Pro-Testers Use CSS Selectors In Selenium Automation Scripts?</title>
      <dc:creator>Bharadwajpendyala12</dc:creator>
      <pubDate>Tue, 16 Aug 2022 15:08:00 +0000</pubDate>
      <link>https://dev.to/testmuai/how-pro-testers-use-css-selectors-in-selenium-automation-scripts-2g6g</link>
      <guid>https://dev.to/testmuai/how-pro-testers-use-css-selectors-in-selenium-automation-scripts-2g6g</guid>
      <description>&lt;p&gt;CSS Selectors in Selenium are used to identifying a user desired HTML web element. This fits into an element locator strategy of automated test development where the primary aim is to interact with page elements through different types of locators. While there are several other methods to identify element locator such as id, name, class name, link text, partial link text, XPath, tag name etc. other than CSS selectors in Selenium we prefer the CSS way due to below benefits.&lt;/p&gt;

&lt;p&gt;New to CSS Selectors? Check out this &lt;a href="https://www.lambdatest.com/blog/css-selectors-cheat-sheet/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug16_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Ultimate CSS Selector cheat sheet&lt;/a&gt; to boost your web designing career.&lt;/p&gt;

&lt;p&gt;If you’re new to Selenium and wondering what it is then we recommend checking out our guide — &lt;a href="https://www.lambdatest.com/selenium?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug16_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;What is Selenium?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Also, Try this online &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug16_kj&amp;amp;utm_term=kj&amp;amp;utm_content=webpage" rel="noopener noreferrer"&gt;Selenium Automation&lt;/a&gt; Grid to run your browser automation testing scripts.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Choose CSS Selectors in Selenium Over Other Element Identifiers?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Faster Identification and reduced test execution time — Compared to XPath CSS selectors in Selenium would tend to identify the elements better as most used browsers such as Chrome and Firefox are tuned for better performance with CSS selectors in Selenium. Here is the &lt;a href="http://elementalselenium.com/tips/34-xpath-vs-css-revisited-2" rel="noopener noreferrer"&gt;link&lt;/a&gt; which provides performance stats for reference.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Availability of better documentation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhanced readability.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Different Ways Of Identifying CSS Selectors in Selenium
&lt;/h2&gt;

&lt;p&gt;Let’s discuss the different ways of identifying the CSS &lt;a href="https://www.lambdatest.com/learning-hub/selenium-locators?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug16_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Selenium locators&lt;/a&gt; of web elements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Class Selector Conundrum
&lt;/h2&gt;

&lt;p&gt;‘.’ represents a class in CSS and is used to identify web elements with a specific class. For example, if our web element of p is consisting of the class below. The following could be correlated to XPath programming of identifying the class with the tag name [&lt;a class="mentioned-user" href="https://dev.to/class"&gt;@class&lt;/a&gt; = ’value’ ] or it could also be correlated with class name element locator in Selenium.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p class=" pages-sub-title"&amp;gt; Lambda Test blog post on validating CSS Selectors in Selenium &amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;CSS selector in Selenium for the same could be identified with the class name as&lt;br&gt;
“.page-sub-title”&lt;br&gt;
The CSS syntax in Selenium of class selector would be –&lt;br&gt;
&amp;lt;.&amp;gt; &amp;lt; Class Name&amp;gt; (or)&lt;br&gt;
&amp;lt;.&amp;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%2F2732%2F0%2A8UncOcadBm2TJuaK.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%2F2732%2F0%2A8UncOcadBm2TJuaK.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This certification is for anyone who wants to stay ahead among professionals who are growing their career in Selenium automation testing.&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;This &lt;a href="https://www.lambdatest.com/blog/cypress-test-automation-framework/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug16_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Cypress test automation&lt;/a&gt; tutorial will help you learn the benefits of Cypress automation Check out now.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ID Selector Conundrum
&lt;/h2&gt;

&lt;p&gt;‘#’ represents id in CSS and is used to identify web elements with a specific id. Please find an example listed below for matching the web element with ID. If you observe it at a high level this can be compared to that of ID name selector using Selenium methods and also locating the element with id in XPath programming such as tag name [&lt;a class="mentioned-user" href="https://dev.to/id"&gt;@id&lt;/a&gt; = ‘id_value’ ].&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;li id="menu-item-143" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-143"&amp;gt;
&amp;lt;a href="[https://www.lambdatest.com/blog/category/lambdatest-updates/](https://www.lambdatest.com/blog/category/lambdatest-updates/)"&amp;gt;Product Updates&amp;lt;/a&amp;gt;
&amp;lt;/li&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;CSS selector in Selenium for the same could be identified with the class name as&lt;/p&gt;

&lt;h1&gt;
  
  
  menu-item-143 or div#menu-item-143
&lt;/h1&gt;

&lt;p&gt;The CSS syntax in Selenium of the ID selector would be –&lt;br&gt;
&amp;lt;#&amp;gt; &amp;lt; ID Name&amp;gt; (or)&lt;br&gt;
&amp;lt;#&amp;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%2FNaN%2F0%2AIKSWvXwEfnKygp_W.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%2FNaN%2F0%2AIKSWvXwEfnKygp_W.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Attribute Selector Conundrum
&lt;/h2&gt;

&lt;p&gt;Attributes could be represented in key-value pairs, for example in the below example we have multiple attributes and values such as ‘role = dialog’, ‘data-dismiss = modal’ etc. Xpath programming version of attribute selector could be correlated as tag name [@attribute key = ‘attribute value’ ].&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="modal fade" id="whitepaper-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"&amp;gt;
   &amp;lt;span class="close" data-dismiss="modal"  style="top: 4px; position: absolute; right: 10px;"&amp;gt;
&amp;lt;span aria-hidden="true"&amp;gt;×&amp;lt;/span&amp;gt;
 &amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;CSS selector in Selenium for the same could be identified with the class name as&lt;br&gt;
div[role=’dialog’] or [role=’dialog’]&lt;/p&gt;

&lt;h2&gt;
  
  
  ‘Class or ID’ &amp;amp; Attribute Selector Conundrum
&lt;/h2&gt;

&lt;p&gt;Class or ID and attribute combination could serve as a better strategy which is more powerful than that of using a class, id or attribute selector alone. In order to achieve uniqueness of the element, if above 3 ways of identifying fails due to multiple instances of the same locator this could be a go-to solution. Let’s deduct the element locator strategy for below example from our LambdaTest blog.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;nav id="site navigation" class="navigation main-navigation" role="navigation"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In the above HTML snippet if you observe there is a space in the class name which is “navigation main-navigation” this could be represented as navigation.main-navigation space can be ignored and replaced with ‘.’&lt;/p&gt;

&lt;p&gt;CSS Selector in Selenium for the same could be identified as below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nav.navigation.main-navigation[role='navigation']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The CSS syntax in Selenium of class or id and attribute selector would be:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;HTML Tag&amp;gt; &amp;lt;Class Or ID&amp;gt; [ &amp;lt;attribute key&amp;gt; = ‘&amp;lt;attribute value&amp;gt;’ ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Class Or ID&amp;gt;  [ &amp;lt;attribute key&amp;gt; = ‘&amp;lt;attribute value&amp;gt;’ ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  SubString Match Conundrum
&lt;/h2&gt;

&lt;p&gt;In order to enable even powerful querying technique, we can make use of sub-string matches with ^ indicated prefix, $ indicating suffix and * indicating substring. If you observe closely this is similar to the representation of XPath functions such as starts-with, contains and ends with. Let’s get into detailed usage of all the three ways of dealing with matches.&lt;/p&gt;
&lt;h3&gt;
  
  
  ^ Indicating a prefix match
&lt;/h3&gt;

&lt;p&gt;Syntax:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;HTML Tag&amp;gt; [ &amp;lt;Class Or ID&amp;gt; ^= &amp;lt;Class or ID Name&amp;gt; ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div[class^=’aria-label’]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  $ Indicating a suffix match
&lt;/h3&gt;

&lt;p&gt;Syntax:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;HTML Tag&amp;gt; [ &amp;lt;Class Or ID&amp;gt; $= &amp;lt;Class or ID Name&amp;gt; ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a[class$=’aria-label’]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  * Indicating a substring match
&lt;/h3&gt;

&lt;p&gt;Syntax:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;HTML Tag&amp;gt; [ &amp;lt;Class Or ID&amp;gt; *= &amp;lt;Class or ID Name&amp;gt; ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;p[class*=’aria-label’]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Inner Text Conundrum:
&lt;/h2&gt;

&lt;p&gt;One of the most easily readable syntaxes yet powerful. You can make use of this mechanism to identify text anywhere on the DOM using a string pattern.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;HTML Tag&amp;gt; &amp;lt;:&amp;gt; &amp;lt;contains&amp;gt; &amp;lt; (text) &amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div:contains("^lambdatest$")&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  “Navigating Through Child Elements” — Child Conundrum:&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;This is an advanced way of handling the element locators through CSS selectors in Selenium while navigating through child elements. There are three possibilities as below:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Direct Child&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sub Child&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nth Child&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Direct Child
&lt;/h3&gt;

&lt;p&gt;Direct child to the parent locator is represented with a ‘&amp;gt;’ symbol. Let’s assume we have a button tag inside a div tag which happens to be a direct child as shown in HTML snippet below.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
div is parent locator and the button is the child locator is represented as:&lt;br&gt;
div.lambdatest-xs-ng&amp;gt;button&lt;br&gt;
Syntax:&lt;br&gt;
Parentlocator &amp;gt; directchildlocator
&lt;h3&gt;
  
  
  Sub Child or Child
&lt;/h3&gt;

&lt;p&gt;Sub child identification includes the same way to identify the elements as that of the direct child but we can ignore ‘&amp;gt;’ symbol as sub child as shown in the example below.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div id="primary" class="content area"&amp;gt;
&amp;lt;div id="content" class="site content" role="main"&amp;gt;
&amp;lt;header class="archive header"&amp;gt;
&amp;lt;h1 class="archive title"&amp;gt;Category Archives : Infographics &amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Sub Child or child would be represented as:&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div#primary header
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Syntax:&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;parent locator=""&amp;gt; &amp;lt;child locator=""&amp;gt; or &amp;lt;sub child="" locator=""&amp;gt;&amp;lt;/sub&amp;gt;&amp;lt;/child&amp;gt;&amp;lt;/parent&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;
  
  
  Nth Child For Opting A Specific Value From A List
&lt;/h2&gt;

&lt;p&gt;This is an advanced way of handling the element locators through CSS selectors in Selenium while navigating through child elements. There are three possibilities as below:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Direct Child&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sub Child&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nth Child&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Direct Child
&lt;/h3&gt;

&lt;p&gt;Direct child to the parent locator is represented with a ‘&amp;gt;’ symbol. Let’s assume we have a button tag inside a div tag which happens to be a direct child as shown in HTML snippet below.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="lambdatest-xs-ng"&amp;gt;
 &amp;lt;button id="tertiary" class="sidebar-container" role="complementary"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;div is parent locator and the button is the child locator is represented as:&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div.lambdatest-xs-ng&amp;gt;button
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Syntax:&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Parentlocator &amp;amp;gt; directchildlocator
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;
  
  
  Sub Child or Child
&lt;/h3&gt;

&lt;p&gt;Sub child identification includes the same way to identify the elements as that of the direct child but we can ignore ‘&amp;gt;’ symbol as sub child as shown in the example below.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div id="primary" class="content area"&amp;gt;
 &amp;lt;div id="content" class="site content" role="main"&amp;gt;
 &amp;lt;header class="archive header"&amp;gt;
&amp;lt;h1 class="archive title"&amp;gt;Category Archives : Infographics &amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Sub Child or child would be represented as:&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div#primary header
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Syntax:&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Parent locator&amp;gt; &amp;lt;child locator&amp;gt; or &amp;lt;sub child locator&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;
  
  
  Nth Child For Opting A Specific Value From A List
&lt;/h3&gt;

&lt;p&gt;N-th child concept would be useful while navigating through ordered or unordered list elements. N becomes the number of the desired list user wants to select. Let’s go through below example to understand how n-th child works. In o&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;&amp;lt;ul id = "lambdaTestBrowsers"&amp;gt;
&amp;lt;li&amp;gt;Chrome&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Firefox&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Edge&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Safari&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Nth child of firefox from the list of lambda test browsers would be represented as:&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#lambdaTestBrowsers li:nth-child(2)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Syntax:&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;HTML Tag&amp;gt; &amp;lt;Clas or ID&amp;gt; &amp;lt;list&amp;gt; &amp;lt;:&amp;gt; &amp;lt;nth-child (number of desired item in the list)&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Are you using &lt;a href="https://www.lambdatest.com/blog/cypress-test-automation-framework/?utm_source=devto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=aug16_kj&amp;amp;utm_term=kj&amp;amp;utm_content=blog" rel="noopener noreferrer"&gt;Playwright automated testing&lt;/a&gt;? Run your Playwright 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;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We have come across different identification strategies through the above element locator conundrums. To get familiar with CSS Selectors in Selenium by querying you make use of Chrome dev tools and also there is an open-sourced tool for the same to try out and view results more interactively at &lt;a href="http://flukeout.github.io/" rel="noopener noreferrer"&gt;http://flukeout.github.io/&lt;/a&gt;. We also discussed the benefits of using CSS selectors in Selenium over other element locators. One of the major drawbacks of the CSS selectors in Selenium is traversing the DOM is not possible with CSS as that of XPath. We can navigate from child to parent and parent to child using XPath. But we can only navigate from parent to child by CSS Selectors in Selenium. If you have any queries or suggestions regarding the CSS Selectors please drop a comment below and I would love to interact. Have fun locating elements through CSS Selectors. Happy testing!&lt;/p&gt;

</description>
      <category>css</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
