<?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>Forem: Muthu Raja</title>
    <description>The latest articles on Forem by Muthu Raja (@muthuraja).</description>
    <link>https://forem.com/muthuraja</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%2F130977%2F0616dc9e-6392-4c40-a478-f1a05870fcaf.png</url>
      <title>Forem: Muthu Raja</title>
      <link>https://forem.com/muthuraja</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/muthuraja"/>
    <language>en</language>
    <item>
      <title>Running Selenium Automation Tests Using Selenide, IntelliJ, And Maven</title>
      <dc:creator>Muthu Raja</dc:creator>
      <pubDate>Fri, 08 Mar 2019 11:14:16 +0000</pubDate>
      <link>https://forem.com/muthuraja/running-selenium-automation-tests-using-selenide-intellij-and-maven-3d0e</link>
      <guid>https://forem.com/muthuraja/running-selenium-automation-tests-using-selenide-intellij-and-maven-3d0e</guid>
      <description>&lt;p&gt;There are a lot of tools in the market who uses Selenium as a base and create a wrapper on top of it for more customization, better readability of code and less maintenance for eg., Watir, Protractor etc., To know more details about Watir please refer &lt;a href="https://www.lambdatest.com/blog/cross-browser-automation-testing-using-watir/?utm_source=Dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=mu-14-080319us&amp;amp;utm_term=OrganicPosting" rel="noopener noreferrer"&gt;Cross Browser Automation Testing&lt;/a&gt; using Watir and Protractor please refer &lt;a href="https://www.lambdatest.com/blog/automated-cross-browser-testing-with-protractor-selenium/?utm_source=Dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=mu-14-080319us&amp;amp;utm_term=OrganicPosting" rel="noopener noreferrer"&gt;Automated Cross Browser Testing with Protractor &amp;amp; Selenium&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We are going to take a look on another popular library “Selenide”, that uses Selenium as a base for automated cross browser testing.&lt;/p&gt;

&lt;p&gt;Powered by Selenium WebDriver, testing with Selenide is free as Selenide is an open source library for automation testing. In fact, this library is addressed and more focus on automation testing especially Concise API and stable tests. Selenium testing with Selenide has been very convenient and effective.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits Of Selenium Testing With Selenide
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Testing with Selenide supports multiple languages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;Scala&lt;/li&gt;
&lt;li&gt;Groovy&lt;/li&gt;
&lt;li&gt;Clojure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Integration Options are:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can use BDD&lt;/li&gt;
&lt;li&gt;Can use with JUnit, TestNG, JBehave, Cucumber, Serenity&lt;/li&gt;
&lt;li&gt;Can use to integrate with Extent Report, Allure Report etc.,&lt;/li&gt;
&lt;li&gt;Supports Cross Browser Parallel execution&lt;/li&gt;
&lt;li&gt;Page Objects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To know about which companies perform Selenium testing with Selenide, please refer this link.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do We Still Need Another Wrapper?
&lt;/h2&gt;

&lt;p&gt;There are several testing libraries around Selenium WebDriver, but what makes Selenium testing with Selenide special?&lt;/p&gt;

&lt;p&gt;Below are some of the major attractions of performing Selenium testing with Selenide.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Concise UI Test&lt;/strong&gt;: Selenide API consist of very few classes which were build on top of Selenium. Implementing Automation test code used for Selenium testing with Selenide is clean, better readability and ease to use.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AJAX challenges&lt;/strong&gt;: The beauty of AJAX is to make the web page retrieve data from server without loading the entire page. For eg., if you add the entry in the form, assume at left pane in the page the recent added data is displayed then the whole page not getting refreshed and return the data. When automate this in web page, we often we end up the issue “No Such Element Exception”. To handle this, different wait method should be applied in Selenium WebDriver. However, when we perform Selenium testing with Selenide, this is already addressed and no additional code is required.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Time out issues&lt;/strong&gt;: While running automation sometime we end up with timeout issue for eg.,loading web page takes time or finding elements takes time. This is handled well through Selenium testing with Selenide, by default it waits 4 seconds if uses Selenide Inbuild methods. On top of it, you can still configurable more secs for better synchronization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automated Screenshots&lt;/strong&gt;: Selenium testing with Selenide by default, takes snapshot of failed test cases unlike Selenium WebDriver. In Selenium WebDriver you need to add explicit code. Please take a look on below snapshot which actually takes snapshot and share the location where it’s located.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2Fpasted-image-0-39.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2Fpasted-image-0-39.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;StaleElementException&lt;/strong&gt;: There are two reason this exception occurs:&lt;/li&gt;
&lt;li&gt;The element no longer attached in the DOM but you code might have referenced to the element&lt;/li&gt;
&lt;li&gt;The element has been deleted or modified with same id or same attribute completely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concentrate on Business Logic&lt;/strong&gt;: Just focus on what needs to be tested for your business logic, rest Selenide will take care for eg., Conditions, validation, synchronization, timeout issues, browser configuration etc.,&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More focus on Testing&lt;/strong&gt;: Selenium testing with Selenide develops more focus on automation testing with better convenience in top of Selenium WebDriver.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2Fimage14-4.png"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As Selenide was developed as a wrapper on top of Selenium, here are some key libraries that you may find familiar if you have already used Selenium frameworks:&lt;/p&gt;

&lt;p&gt;| selenium-java: Used latest version of selenium Java API |&lt;br&gt;
| selenium-server: to support selenium Grid for parallel execution |&lt;br&gt;
| webdrivermanager: to support inbuild browser configuration to avoid initialization |&lt;br&gt;
| testng: Support TestNG framework |&lt;br&gt;
| commons-fileupload: To handle file uploads capability to your servlet and web application |&lt;br&gt;
| junit: Support JUnit Framework |&lt;/p&gt;

&lt;p&gt;The beauty of Selenium testing with Selenide is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can still use Selenium WebDriver Directly&lt;/li&gt;
&lt;li&gt;You can use any webdriver instance&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Kick-Starting Selenium Testing With Selenide
&lt;/h2&gt;

&lt;p&gt;Selenium testing with Selenide group offer 3 simple things to kick start your test automation, which are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the page&lt;/li&gt;
&lt;li&gt;$(element).doAction()&lt;/li&gt;
&lt;li&gt;$(element).check(condition)
For e.g., Please take a look on below snapshot:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;SELENIUM WEBDRIVER&lt;/th&gt;
&lt;th&gt;SELENIDE&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;driver.get(“&lt;a href="https://www.lambdatest.com/" rel="noopener noreferrer"&gt;https://www.lambdatest.com/&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;Open(&lt;a href="https://www.lambdatest.com/" rel="noopener noreferrer"&gt;https://www.lambdatest.com/&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;driver.findElement(By.className(“#submit”)).click()&lt;/td&gt;
&lt;td&gt;$(“#submit”).click();&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;String actualResult=driver.findElement(By.className.message).getText()&lt;/td&gt;
&lt;td&gt;//Conditions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;If(text.contains(actualResults)&lt;/td&gt;
&lt;td&gt;$(“.message.”).shouldHave(text(“Hello”))&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You can observe the readable and concise syntax used for testing with Selenide.&lt;/p&gt;
&lt;h2&gt;
  
  
  Selenium Testing With Selenide: Setting Up The Environment
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The pre-requisites are JDK 1.8.0 and Intellij.&lt;/strong&gt;&lt;br&gt;
For installing Java, minimum JDK 8 is required, to download in official site click &lt;a href="https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After download, installation is very simple and self-explanatory to complete.&lt;/p&gt;

&lt;p&gt;After installation is complete, you would have to setup the classpath so that the program understand where the java is located in your machine&lt;/p&gt;

&lt;p&gt;This can be done in windows operating system by searching for “Environment Variables” and selecting “Edit System Environment Variables”. Create JAVA_HOME in system variable and PATH as mentioned in the below snapshot.&lt;/p&gt;

&lt;p&gt;Create JAVA_HOME in System variable and update the value where the Java is located in your machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F003_Java_Home.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F003_Java_Home.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to edit the Path system variable and add JAVA_HOME in it so that all run time programs are able to detect Java in your machine. Make sure you append the value after adding a semicolon.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F004_Adding_JavaHome_in_Path.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F004_Adding_JavaHome_in_Path.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To verify, if JDK is properly installed or not. You need to supply the below command:&lt;br&gt;
&lt;code&gt;java -version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F005_Verifying_Java_Version.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F005_Verifying_Java_Version.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kudos! You just installed JDK successfully on your machine.&lt;/p&gt;
&lt;h2&gt;
  
  
  Selenium Testing With Selenide – Download IntelliJ And Setting Up Maven project
&lt;/h2&gt;

&lt;p&gt;There are multiple IDE’s available in the market. In this article, I recommend using IntelliJ for Selenium testing with Selenide. IntelliJ is a free, open-source Java IDE(Integrated Development Environment) for developing Java, Kotlin based software programming. This tool has Community and Ultimate version, community version of IntelliJ can be downloaded from here.&lt;/p&gt;

&lt;p&gt;After download Intellij, the installation part is pretty much easy, just follow with instruction and keep going with default parameter and complete it.&lt;/p&gt;

&lt;p&gt;Open Intellij and select “Create New Project” from Dashboard window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F006_IntelliJ_Launch_Page.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F006_IntelliJ_Launch_Page.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this article, I would prefer to use a “Maven” project. Select the particular Java version that we installed and click on Next with Default parameters.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F007_Select_Maven.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F007_Select_Maven.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter values in necessary fields like GroupID, ArtifactID and keep it as default version.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F008_projectName.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F008_projectName.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Leave the project name and select where your project is to be located.&lt;/p&gt;

&lt;p&gt;The created project for testing with Selenide is displayed in IntelliJ as mentioned below.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F009_Maven_model.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F009_Maven_model.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add Selenide Maven Dependency as mentioned below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;!-- https://mvnrepository.com/artifact/com.codeborne/selenide --&amp;gt;
    &amp;lt;dependency&amp;gt;
        &amp;lt;groupId&amp;gt;com.codeborne&amp;lt;/groupId&amp;gt;
        &amp;lt;artifactId&amp;gt;selenide&amp;lt;/artifactId&amp;gt;
        &amp;lt;version&amp;gt;5.1.0&amp;lt;/version&amp;gt;
    &amp;lt;/dependency&amp;gt;
&amp;lt;/dependencies&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to add the required transient dependencies in your class path. As I previously mentioned, Selenide library supports TestNG, JUnit frameworks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Selenium Testing With Selenide- Sample Code(Self Explanatory)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

import org.openqa.selenium.By;
import org.testng.Assert;
import org.testng.annotations.Test;

import static com.codeborne.selenide.CollectionCondition.texts;
import static com.codeborne.selenide.Condition.text;
import static com.codeborne.selenide.Selenide.*;

public class LambdaSampleParallelTestAutomation extends BaseConfig_LambdaTest {


    /**
     * Author: Muthuraja R
     * Description: Validate Error message in Registration Page and capture one of error throws correct or not
     */
    @Test
    public void verifyStartTestingButton() {
        //Launch Lambdatest page
        open("https://www.lambdatest.com/");
        //use CSS Selector to find element and click for navigating register page
        $(".nav&amp;gt;li.login&amp;gt;a").click();
        //Verifying Page title using Selenide reusable method
        Assert.assertEquals("Sign up for free | Cross Browser Testing Tool | LambdaTest - LambdaTest", title());
        //Verifying text "Sign up"
        $(".signup-titel").shouldHave(text("SIGN UP"));
        //Feeding value to the text using .val
        //Feeding value to the text using sendkeys
        $(By.name("organization_name")).val("org");
        $(By.name("name")).sendKeys("Name");
        $(By.name("email")).sendKeys("test@gmail.com");
        $(By.name("password")).sendKeys("test1234");
        //using shortcut to signup instead of clicking button
        $(By.name("phone")).val("13452").pressEnter();
        //Capturing actual results and verifying with expected one using collections
        $$(".error-mass").shouldHave(
                texts("This email is already registered",
                        "Please enter a valid Phone number",
                        "To proceed further you must agree to our Terms of Service and Privacy Policy"));
    }

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

&lt;/div&gt;



&lt;p&gt;In the above example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login to LambdaTest Page.&lt;/li&gt;
&lt;li&gt;Click on Register button.&lt;/li&gt;
&lt;li&gt;Enter invalid value in org, fullname, work email, desired password and phone to target on mandatory fields to make sure it returns error.&lt;/li&gt;
&lt;li&gt;Finally capture all errors throws in the page using collections.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As compared in previous section, testing with Selenide is lightweight, ease to use and offers better readability with comparison to Selenium. I didn’t include browser configuration or any pre-requisites like @BeforeClass or @BeforeMethod and not used loops to iterate and get content of error message.&lt;/p&gt;

&lt;p&gt;To run your local browser simply, just use url and write basic test as mentioned above.&lt;/p&gt;

&lt;p&gt;The Default browser is “chrome” browser, in case you haven’t declared any configuration. Here is the test result for local test execution without browser configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F011_default_chrome.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F011_default_chrome.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F010_Local_Instance_Test_Results.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F010_Local_Instance_Test_Results.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wish To Perform Selenium Testing With Selenide On A Different Browser?
&lt;/h2&gt;

&lt;p&gt;To run the same test in other browsers is also pretty simple. For example, in case you want to use Firefox browser I configured as below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2FFirefox_config.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2FFirefox_config.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To know more about browser configuration and how to know Selenide support which browsers, please take a look on below snapshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F013_More_Browser_config.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F013_More_Browser_config.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reusable Commands For Selenium Testing With Selenide&lt;/strong&gt;&lt;br&gt;
Here we deep dive on Selenide reusable commands:&lt;br&gt;
&lt;/p&gt;

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

import org.openqa.selenium.By;
import org.testng.Assert;
import org.testng.annotations.Test;

import static com.codeborne.selenide.CollectionCondition.texts;
import static com.codeborne.selenide.Condition.text;
import static com.codeborne.selenide.Selenide.*;

public class LambdaSampleParallelTestAutomation extends BaseConfig_LambdaTest {


    /**
     * Author: Muthuraja R
     * Description: Validate Error message in Registration Page and capture one of error throws correct or not
     */
    @Test
    public void verifyStartTestingButton() {
        //Launch Lambdatest page
        open("https://www.lambdatest.com/");
        //use CSS Selector to find element and click for navigating register page
        $(".nav&amp;gt;li.login&amp;gt;a").click();
        //Verifying Page title using Selenide reusable method
        Assert.assertEquals("Sign up for free | Cross Browser Testing Tool | LambdaTest - LambdaTest", title());
        //Verifying text "Sign up"
        $(".signup-titel").shouldHave(text("SIGN UP"));
        //Feeding value to the text using .val
        //Feeding value to the text using sendkeys
        $(By.name("organization_name")).val("org");
        $(By.name("name")).sendKeys("Name");
        $(By.name("email")).sendKeys("test@gmail.com");
        $(By.name("password")).sendKeys("test1234");
        //using shortcut to signup instead of clicking button
        $(By.name("phone")).val("13452").pressEnter();
        //Capturing actual results and verifying with expected one using collections
        $$(".error-mass").shouldHave(
                texts("This email is already registered",
                        "Please enter a valid Phone number",
                        "To proceed further you must agree to our Terms of Service and Privacy Policy"));
    }

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

&lt;/div&gt;



&lt;p&gt;In above simple reusable method, we are going to take a look on what is “$” and “$$” and selenium action and conditional commands.&lt;/p&gt;

&lt;p&gt;$ and $$ Method Definitions:&lt;/p&gt;

&lt;p&gt;In Selenide Terminology:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;$ Indicate finds Single Element&lt;/li&gt;
&lt;li&gt;$$ Indicate finds More than one Elements used Collections&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F015_Element_Locators.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F015_Element_Locators.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F016_elements_locators_collections.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F016_elements_locators_collections.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In above snapshot, an argument in Selenide method accepts different types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WebElement (Element)&lt;/li&gt;
&lt;li&gt;cssSelector as String&lt;/li&gt;
&lt;li&gt;Xpath as String&lt;/li&gt;
&lt;li&gt;SeleniumSelector as By (for eg., By.xpath(“”))
For the cssSelector and xpath, you can assign locator directly as string which is ease to use and maintain locators.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conditions:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F017_conditions.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F017_conditions.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In above sample program, we use the following condition to verify the results without assertion:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;$(“.signup-titel”).shouldHave(text(“SIGN UP”));&lt;/li&gt;
&lt;li&gt;In this method, I verify “SIGN UP”text exists which I use “shouldHave” method&lt;/li&gt;
&lt;li&gt;“.signup-title” is cssLocator&lt;/li&gt;
&lt;li&gt;&lt;p&gt;$ indicates find/return single element&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;$$(“.error-mass”).shouldHave(texts(“This email is already registered”, “Please enter a valid Phone number”,”Another condition to verify…..“));&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Used CSS Selector to locate error message which returns more than one error.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;shouldHave is method to verify the condition the necessary text appears.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;texts accepts argument in array where you can pass multiple expected text conditions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This method should verify condition between actual and expected results.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In build, the above condition like shouldbe, ShouldHave exhibits smart waiting capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;shouldbe(“visible”)&lt;/li&gt;
&lt;li&gt;shouldHave(Text(“Hello Test”))&lt;/li&gt;
&lt;li&gt;shouldNotBe(“selected”)&lt;/li&gt;
&lt;li&gt;should(“disappear)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By default, $.should() Method waits up to 4 seconds. However, if you wish to change the timeout then you can customize it in the following ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configuration.timeout=4000 (Millisecs)&lt;/li&gt;
&lt;li&gt;Mvn –Dselenide.timeout=8000 //mvn specific command&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Verifying expected text in collections:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$(By.xpath("//p[@class='error-mass']")).shouldBe(Condition.visible).shouldHave(
        textCaseSensitive("This email is already registered",
            “Another Text”,
            “Another Text”));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More Functions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;$(“div”).scrollTo();&lt;/td&gt;
&lt;td&gt;$(“div”).doubleClick();&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$(“div”).innertText();&lt;/td&gt;
&lt;td&gt;$(“div”).contextClick();&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$(“div”).innerHtml();&lt;/td&gt;
&lt;td&gt;$(“div”).hover();&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$(“div”).exists();&lt;/td&gt;
&lt;td&gt;$(“div”).dragAndDrop();&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$(“select”).isImage();&lt;/td&gt;
&lt;td&gt;Zoom(3.5);&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$(select”).getSelectedText();&lt;/td&gt;
&lt;td&gt;$(“select).getSelectedValue();..many more&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Cross Browser Parallel Test Automation
&lt;/h2&gt;

&lt;p&gt;So far we have seen how to implement Selenium testing with Selenide and run test on a single instance using local browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem Statement&lt;/strong&gt;: In order to execute the same tests in multiple browsers and its multiple versions on sequential basis is tedious and mentally exhausting process. Also, it becomes infeasible to get automation test results feedback at earliest or soon. Especially, in an agile release window following CI/CD(&lt;a href="https://www.lambdatest.com/blog/what-is-continuous-integration-and-continuous-delivery/?utm_source=Dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=mu-14-080319us&amp;amp;utm_term=OrganicPosting" rel="noopener noreferrer"&gt;Continuous Integration and Continuous Delivery&lt;/a&gt;) Integration process. In your local system , you can install a limited number of browsers, what if you wish to use 40-50 browsers or even more with multiple browser versions?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Selenium Grid:&lt;/strong&gt; To address this challenge, Selenium Grid is a solution. There are option to address this problem by adding additional machines as selenium node where in our desired capabilities are utilized to pass appropriate browser version. However, maintaining a local grid could be very challenging. This is where “Cloud” solutions play a vital role.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LambdaTest&lt;/strong&gt; – A Free Cross Browser Testing Tool: LambdaTest offers automated and live interactive cross browser testing on a Selenium grid consisting 2000+ real browsers and operating system online. LambdaTest has capability to select multiple operating systems with combination of its browser to ensure your web application runs seamlessly across different configuration. In real world, most of testing is carried out in Windows with combination of Chrome, Firefox etc. How about Linux platform with different browsers? How about MAC OS with IE browser? You can test it all using LambdaTest for &lt;a href="https://www.lambdatest.com/feature?utm_source=Dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=mu-14-080319us&amp;amp;utm_term=OrganicPosting" rel="noopener noreferrer"&gt;browser compatibility testing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;LambdaTest also offer Cross Browser Test Automation in Parallel. We can run a single automation test on multiple browsers and their versions.&lt;/p&gt;

&lt;p&gt;In the below section, I’m going to setup Selenium Grid (Hub and Node) and how to run test in parallel on Chrome and Firefox browser using TestNG suite.xml&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Selenium Grid Configuration Setup:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to seleniumhq website.&lt;/li&gt;
&lt;li&gt;Download Selenium Server latest version and store in your comfortable folder location.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2Fimage16-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2Fimage16-3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To run Selenium Grid in Local, go to the folder location in command prompt and enter the command as mentioned below.&lt;br&gt;
&lt;code&gt;java –jar selenium-server-standalone-3.141.59.jar –role hub&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;hub indicates server where it acts as host and control your browser.
Selenium Server gets started successfully as show in the below snapshot.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F020_Selenium_Grid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F020_Selenium_Grid.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, it’s turn for Selenium Node.&lt;/p&gt;

&lt;p&gt;Selenium Node Configuration Setup:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F021_Selenium_Node.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F021_Selenium_Node.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above snapshot, I downloaded Chrome Driver and Firefox Driver which are required to run your test in remote instance. I also created batch file to run the configuration by one click instead of each time open command prompt and enter the commands.&lt;/p&gt;

&lt;p&gt;To create a batch file, enter the following commands. Please make sure the extension must be “.bat”&lt;br&gt;
&lt;code&gt;java -jar selenium-server-standalone-3.141.59.jar -role node -hub&lt;/code&gt;&lt;br&gt;
&lt;a href="http://localhost:4444/grid/register" rel="noopener noreferrer"&gt;http://localhost:4444/grid/register&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To run the batch file, navigate to specific folder in command prompt and enter “file name of your batch file” as mentioned like below snapshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F022_Selenium_Node_start.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F022_Selenium_Node_start.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To verify no of browser instance in Grid console, Navigate to &lt;a href="http://localhost:4000" rel="noopener noreferrer"&gt;http://localhost:4000&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F023_selenium_grid_Host.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F023_selenium_grid_Host.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default 5 Firefox, 5 Chrome and 1 IE browser exists. It’s up to your convenient number of browser instance required which can be configured in your Selenium node configuration.&lt;/p&gt;

&lt;p&gt;Now, it’s time to run your parallel automation in cross browser platform.&lt;/p&gt;
&lt;h2&gt;
  
  
  Selenium Testing With Selenide– Sample Code(Self Explanatory): Cross Browser Parallel Automation in Local
&lt;/h2&gt;

&lt;p&gt;In this example, I keep it as same class in previous section but one slight modification is, I create inheritance relationship between this class and base class.&lt;/p&gt;

&lt;p&gt;Derived Class:&lt;br&gt;
&lt;/p&gt;

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

import org.openqa.selenium.By;
import org.testng.Assert;
import org.testng.annotations.Test;

import static com.codeborne.selenide.CollectionCondition.texts;
import static com.codeborne.selenide.Condition.text;
import static com.codeborne.selenide.Selenide.*;

public class LambdaSampleParallelTestAutomation extends BaseConfig_LambdaTest {


    /**
     * Author: Muthuraja R
     * Description: Validate Error message in Registration Page and capture one of error throws correct or not
     */
    @Test
    public void verifyStartTestingButton() {
        //Launch Lambdatest page
        open("https://www.lambdatest.com/");
        //use CSS Selector to find element and click for navigating register page
        $(".nav&amp;gt;li.login&amp;gt;a").click();
        //Verifying Page title using Selenide reusable method
        Assert.assertEquals("Sign up for free | Cross Browser Testing Tool | LambdaTest - LambdaTest", title());
        //Verifying text "Sign up"
        $(".signup-titel").shouldHave(text("SIGN UP"));
        //Feeding value to the text using .val
        //Feeding value to the text using sendkeys
        $(By.name("organization_name")).val("org");
        $(By.name("name")).sendKeys("Name");
        $(By.name("email")).sendKeys("test@gmail.com");
        $(By.name("password")).sendKeys("test1234");
        //using shortcut to signup instead of clicking button
        $(By.name("phone")).val("13452").pressEnter();
        //Capturing actual results and verifying with expected one using collections
        $$(".error-mass").shouldHave(
                texts("This email is already registered",
                        "Please enter a valid Phone number",
                        "To proceed further you must agree to our Terms of Service and Privacy Policy"));
    }

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Base Class:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

import org.openqa.selenium.WebDriver;
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.Parameters;

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

import static com.codeborne.selenide.Selenide.open;
import static com.codeborne.selenide.WebDriverRunner.setWebDriver;

public class BaseConfig_LambdaTest {
    private WebDriver driver;
    private DesiredCapabilities desiredCapabilities;

    public String getLambdaUserName() {
        return System.getenv("LAMBDA_USERNAME");
    }

    public String getLambdaPassword() {

        return System.getenv("LAMBDA_PASSWORD");
    }

    @BeforeClass
    @Parameters({"browserName", "platform", "browserVersion", "visualEnable"})
    public void init(String browserName, String platform, String browserVersion, String visualEnable) throws MalformedURLException {
        desiredCapabilities = new DesiredCapabilities();
        if (browserName.equals("chrome")) {
            desiredCapabilities.setCapability("browserName", "chrome");
        } else if (browserName.equals("firefox")) {
            desiredCapabilities.setCapability("browserName", "firefox");
        }
        desiredCapabilities.setCapability("platform", platform);
        desiredCapabilities.setCapability("version", browserVersion);
        desiredCapabilities.setCapability("visual", visualEnable);
        desiredCapabilities.setCapability("build", "LambdaTestBuild");
        desiredCapabilities.setCapability("name", "LambdaTest Execution");
        System.out.println("https://" + getLambdaUserName() + ":" + getLambdaPassword() + "@hub.lambdatest.com/wd/hub");
        driver = new RemoteWebDriver(new URL("https://muthu.crr:Kw8xyUoShEO9GAtPqW509OWHggQYzzaLJnznu9R3RChfRSnmhh@hub.lambdatest.com/wd/hub"), desiredCapabilities);
        //driver = new RemoteWebDriver(new URL("https://" + getLambdaUserName() + ":" + getLambdaPassword() + "@hub.lambdatest.com/wd/hub"), desiredCapabilities);
        setWebDriver(driver);
        open("https://www.lambdatest.com/");
        driver.manage().window().maximize();
    }

    @AfterClass
    public void tearDown() {
        if (driver != null)
            driver.quit();

    }


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

&lt;/div&gt;



&lt;h2&gt;
  
  
  What Is Desired capability?
&lt;/h2&gt;

&lt;p&gt;It’s a key/value pairs that stores browser properties, platform properties etc., For eg., It’s specific to what browser name, browser version, platform name like Windows 10, Linux etc., This will determine the behaviour of the browser during run time.&lt;/p&gt;

&lt;p&gt;The setCapability method help to initialize and let “WebDriver” know which environment and browser to run.&lt;/p&gt;

&lt;p&gt;The beauty of Desired Capability is, to run same test cases in different browsers with combination of its version and operating system in parallel.&lt;/p&gt;

&lt;p&gt;In above example, I’m going to explain how I created sample test that run more than one browser.&lt;/p&gt;

&lt;p&gt;Baseconfig class is a “Base Class” which holds Parameters, BeforeClass and AfterClass which are actually annotation of TESTNG. To know more details about TESTNG, please visit here but this example step by step how I designed for sample test.&lt;/p&gt;

&lt;p&gt;Step 1: Configure TestNG XML with Thread configuration and Parameterization as below.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F024_testng_parallel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F024_testng_parallel.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;thread-count&lt;/td&gt;
&lt;td&gt;5 (Mention how many thread count need)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parameter&lt;/td&gt;
&lt;td&gt;Initialize parameter name and its value for eg., chrome or firefox&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Class&lt;/td&gt;
&lt;td&gt;Include class name indicates which class you would like to execute&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;TESTNG makes your life easier in terms of running test in parallel. Configure same class under Test tag in the suites and make sure parameters added under Test for independent execution.&lt;/p&gt;

&lt;p&gt;Step 2: @Parameters name must be same as what as mentioned in TestNG suites.xml&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F025_baseConfig.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F025_baseConfig.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While executing this code in multiple thread , two browser instances get created and run your test in parallel.4&lt;/p&gt;

&lt;p&gt;As we already configured selenium server and it’s running. We use RemoteDriver to initialize the server host details and configure desired capabilities.&lt;/p&gt;

&lt;p&gt;setWebDriver(driver): This method is important to initialize your customized browser configuration let WebDriverRunner in Selenide Framework otherwise it will throw timeout error and consider default browser (chrome) will execute the test in single instance.&lt;/p&gt;

&lt;p&gt;Here is the test result in parallel execution for multiple browsers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F026_Parallel_Test_Results.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F026_Parallel_Test_Results.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Parallel Test In LambdaTest For Selenium Testing With Selenide
&lt;/h2&gt;

&lt;p&gt;To execute same test in Parallel on LambdaTest is very simple and straightforward. I’m going to explain same scripts in LambdaTest except few tweak in the code on BaseConfig class &amp;amp; TestNG.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F027_Parallel_Lambdatest.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F027_Parallel_Lambdatest.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, I added few more parameters to run the same script in LambdaTest.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Browser Name&lt;/td&gt;
&lt;td&gt;Customized way to configure your browser name like Chrome, Firefox etc&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Platform&lt;/td&gt;
&lt;td&gt;LambdaTest offers to run in different platform Windows 10, Linux etc.,&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser Version&lt;/td&gt;
&lt;td&gt;LambdaTest offers you to select different browser version which actually help you to validate your test like how your product is being used by customers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visual Enable&lt;/td&gt;
&lt;td&gt;This feature is basically to record all execution in videos and logs.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You still can add customized configuration, please visit &lt;a href="https://www.lambdatest.com/capabilities-generator/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F028_Capability_generator.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F028_Capability_generator.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Changes In BaseConfig Class For LambdaTest
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F029_BaseConfig_LambdaTest.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F029_BaseConfig_LambdaTest.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above code, I use two method which are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;getLambdaUserName()&lt;/li&gt;
&lt;li&gt;getLambdaPassword()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These methods will actually get LambdaTest User account and password from environment variable which you set in the machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  How To Set Environment Variable For LambdaTest Username/Password?
&lt;/h2&gt;

&lt;p&gt;In Windows 10 -&amp;gt; Search Environment Variable -&amp;gt; Edit the System Environment Variable -&amp;gt; Click New button&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter variable name as “LAMBDA_USERNAME”&lt;/li&gt;
&lt;li&gt;Enter variable value as “YOUR_LAMBDA_ACCOUNT”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2Fimage18-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2Fimage18-3.png"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Similarly do the same for Password&lt;/li&gt;
&lt;li&gt;API key can be generated in your profile page in LambdaTest Login&lt;/li&gt;
&lt;li&gt;Click “Ok” button&lt;/li&gt;
&lt;li&gt;To Run Parallel:&lt;/li&gt;
&lt;li&gt;Open “testsuites_Parallel_Lambda.xml”.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2Fimage27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2Fimage27.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test results run in LambdaTest portal and the result can be displayed in the below snapshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F032_Detail_Veiw_Test_Results.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F02%2F032_Detail_Veiw_Test_Results.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Navigated to specific test for detail view, where you can see the following parameter of the screen.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;li&gt;Exception&lt;/li&gt;
&lt;li&gt;Command&lt;/li&gt;
&lt;li&gt;Network&lt;/li&gt;
&lt;li&gt;Logs&lt;/li&gt;
&lt;li&gt;Metadata&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Selenide is a wonderful library which actually addresses many issues which was developed on top of Selenium. This library helps you to achieve your test with better reusable and better readability. The advantage of make use of this tool is, you still can write both Selenium WebDriver and Selenide code part of your framework which makes Stable and strong.&lt;/p&gt;

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

&lt;p&gt;Original Source: &lt;a href="https://www.lambdatest.com/blog/selenium-testing-with-selenide-using-intellij-maven/?utm_source=Dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=mu-14-080319us&amp;amp;utm_term=OrganicPosting" rel="noopener noreferrer"&gt;lambdatest.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.lambdatest.com/blog/wp-content/uploads/2018/11/Adword-Cyber2.jpg?utm_source=Dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=mu-14-080319us&amp;amp;utm_term=OrganicPosting" rel="noopener noreferrer"&gt;&lt;img src="https://media.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%2F0e5vtqzcoqm2zr3cb7la.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Related Articles&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.lambdatest.com/blog/automated-testing-with-junit-and-selenium-for-browser-compatibility/?utm_source=Dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=mu-14-080319us&amp;amp;utm_term=OrganicPosting" rel="noopener noreferrer"&gt;Automated Testing With JUnit And Selenium For Browser Compatibility&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.lambdatest.com/blog/13-reasons-why-selenium-webdriver-should-be-your-first-choice-for-automation-testing/?utm_source=Dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=mu-14-080319us&amp;amp;utm_term=OrganicPosting" rel="noopener noreferrer"&gt;13 Reasons Why Selenium WebDriver Should Be Your First Choice for Automation Testing!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.lambdatest.com/blog/how-pro-testers-use-css-selectors-in-selenium-automation-scripts/?utm_source=Dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=mu-14-080319us&amp;amp;utm_term=OrganicPosting" rel="noopener noreferrer"&gt;How Pro-Testers Use CSS Selectors In Selenium Automation Scripts?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.lambdatest.com/blog/automation-testing-with-selenium-cucumber-testng/?utm_source=Dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=mu-14-080319us&amp;amp;utm_term=OrganicPosting" rel="noopener noreferrer"&gt;Automation Testing With Selenium, Cucumber &amp;amp; TestNG&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>testing</category>
      <category>java</category>
      <category>scala</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Using Galen Framework For Automated Cross Browser Layout Testing</title>
      <dc:creator>Muthu Raja</dc:creator>
      <pubDate>Mon, 28 Jan 2019 16:04:23 +0000</pubDate>
      <link>https://forem.com/testmuai/using-galen-framework-for-automated-cross-browser-layout-testing-3g77</link>
      <guid>https://forem.com/testmuai/using-galen-framework-for-automated-cross-browser-layout-testing-3g77</guid>
      <description>&lt;p&gt;Galen Framework is a &lt;a href="https://www.lambdatest.com/blog/automated-cross-browser-testing/" rel="noopener noreferrer"&gt;test automation&lt;/a&gt; framework which was originally introduced to perform cross browser layout testing of a web application in a browser. Nowadays, it has become a fully functional testing framework with rich &lt;a href="https://www.lambdatest.com/blog/why-your-startup-needs-test-management/" rel="noopener noreferrer"&gt;reporting and test management system&lt;/a&gt;. This &lt;a href="https://www.lambdatest.com/blog/top-javascript-frameworks-for-2019/" rel="noopener noreferrer"&gt;framework supports both Java and Javascript&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Are you wondering about what &lt;a href="https://www.lambdatest.com/blog/performing-cross-browser-testing-with-lambdatest/" rel="noopener noreferrer"&gt;cross browser layout testing&lt;/a&gt; is? Well let me clarify, so you develop a fast-functioning website using Google Chrome. Everything is working as per intended functionality for you. The UI is neat and you feel a sense of accomplishment. Now, you show this to your product manager, stakeholder or any other user who has his/her default browser set to Mozilla Firefox/ Safari/ Opera or any browser other than Google Chrome then you are surprised to notice the UI deviations in website rendering. This implies that your website isn’t &lt;a href="https://www.lambdatest.com/blog/how-to-make-a-cross-browser-compatible-website/" rel="noopener noreferrer"&gt;cross browser compatible&lt;/a&gt; as it is working abruptly when accessed through different browsers. The practice to ensure that the layout of a website looks and runs seamlessly across various browsers is called Cross Browser Layout Testing. We are living in an era where responsive design is turning into a necessity for every website. If you are looking to address the following challenges for Responsive Site Layout in multiple devices for eg., Mobile, Desktop etc., then Galen Framework is one of the best open source framework to choose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is your text aligned correctly?&lt;/li&gt;
&lt;li&gt;Is logo aligned properly at top left pane?&lt;/li&gt;
&lt;li&gt;Is Width and Height of Textbox or any other UI object size is correct?&lt;/li&gt;
&lt;li&gt;Are you able to play with color Scheme?&lt;/li&gt;
&lt;li&gt;All GUI show up appropriate in different browsers in different devices&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, we will take a look on how to set up test automation environment for Galen Framework with IntelliJ and then go ahead with the script. I would also show you how to generate reports for your &lt;a href="https://www.lambdatest.com/blog/17-lessons-i-learned-for-writing-effective-test-cases/" rel="noopener noreferrer"&gt;automation test cases&lt;/a&gt; along with few troubleshooting tips to help you in getting started on browser automation with Galen Framework for cross browser layout testing. Let’s dive right in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Setting up the Environment:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The only pre-requisite required would be the installation of JDK 8 in your machine. For installing JDK 8 (minimum JDK version), visit the official website to download by clicking &lt;a href="https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After download, installation is simple, just click and continue to finish.&lt;br&gt;
Once the installation is complete, you would have to provide a set up the path. Here is how you can do so!&lt;br&gt;
Go to windows button and look for “Environment Variables”. Once that is done, you need to select the option to “Edit System Environment Variables”. After that, click on the “New” button for adding “JAVA_HOME” as your installation path.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FSetup_EnvironmentVariables.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FSetup_EnvironmentVariables.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, find “Path” in variable section and double-click. In variable value, add “ %JAVA_HOME%\bin” in the path to make sure specified version of java is accessible in the machine.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FAdding_JavaHome_in_Path.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FAdding_JavaHome_in_Path.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, in order to validate if JDK is properly installed or not! Mention the below command in your cmd(Command Prompt):&lt;br&gt;
&lt;code&gt;java-version&lt;/code&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FVerifying_Java_Version.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FVerifying_Java_Version.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kudos! You just installed JDK successfully on your machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2 – Download IntelliJ and Setup Maven Project&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;IntelliJ is a free, open-source Java IDE(Integrated Development Environment) for developing Java-based computer software. You can download Community version of IntelliJ from here.&lt;/p&gt;

&lt;p&gt;After download, installation is easy, just click next and finish with a default value.&lt;br&gt;
In Windows -&amp;gt; Search “IntelliJ”-&amp;gt; A window will open to “Create New Project”.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FIntelliJ_Launch_Page.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FIntelliJ_Launch_Page.png" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
Click on Create New Project, select Maven and click ‘Next’ button.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FCreate_New_Maven_Project.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FCreate_New_Maven_Project.png" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
Enter GroupId, ArtifactId and leave version default and click ‘Next’ button.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FCreate_project_Artifact_version.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FCreate_project_Artifact_version.png" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
Leave the project name and select the location where your project is to be located. Click on ‘Finish’ button&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fcreate_Project_Location_project_Location.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fcreate_Project_Location_project_Location.png" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
The created project displayed in IntelliJ as below snapshot. Please make sure to enable auto import.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FPOM_xml_in_Intellij.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FPOM_xml_in_Intellij.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add Maven Dependency in IntelliJ by following the steps&lt;br&gt;
Go to Maven repository &lt;a href="https://mvnrepository.com/" rel="noopener noreferrer"&gt;https://mvnrepository.com/&lt;/a&gt; and search for Galen framework.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FPOM_xml_in_Intellij.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FPOM_xml_in_Intellij.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the latest Galen Framework Support for Java Test Framework.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FChoosing_Galen_Framework_Version-1.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FChoosing_Galen_Framework_Version-1.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the latest version which lists in the top and copy the Galen Framework dependency which is highlighted in the below snapshot.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FCopying_Galen_Dependencies.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FCopying_Galen_Dependencies.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy the above Maven dependency in pom.xml in your project. Once copied, it’s dependencies and transient dependencies are downloaded from the Maven repository. For eg., Dependency like Galen Framework and transient dependencies like Selenium, along with some common libraries.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FGalen_Dependencies_in_IntelliJ.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FGalen_Dependencies_in_IntelliJ.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;org.testng&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;testng&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;6.9.10&amp;lt;/version&amp;gt;
    &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/pre&gt;

&lt;p&gt;And, the maven project structure looks like 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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FMaven_Project_Structure_In_Intellij.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FMaven_Project_Structure_In_Intellij.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Implementing a Spec File&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Understanding of How to write Spec file&lt;/b&gt;:&lt;br&gt;
Galen spec language is quite flexible and gives you the opportunity to express the exact manner in which you would want your website to behave when accessed through different devices. There are two main parts in the page spec file: Object Definitions and Object Specs.&lt;/p&gt;

&lt;p&gt;This spec file is important and a pre-requisites to run your automation based on definition added as expected result, which runs and compare actual result in your application.&lt;/p&gt;

&lt;p&gt;Let me write a simple spec file for the website &lt;a href="https://www.lambdatest.com/" rel="noopener noreferrer"&gt;https://www.lambdatest.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create spec file the extension must be “.gspec”&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FImplementing_Spec_File.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FImplementing_Spec_File.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above spec files and its image is copied under specs directory in the resource folder.&lt;/p&gt;

&lt;p&gt;Note: The spec file will understand if an image is present in the same directory. If not, then you would have to explicitly mention the folder name/image file. However, keep in mind that the sub-folder must reside where your spec files exist.&lt;/p&gt;

&lt;p&gt;The above spec is just for sample test execution. To more familiarization please visit the site and play with more examples: &lt;br&gt;
&lt;a href="http://galenframework.com/docs/reference-galen-spec-language-guide/" rel="noopener noreferrer"&gt;http://galenframework.com/docs/reference-galen-spec-language-guide/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Writing Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to write code for our automation script to work with Galen Framework. Before you start writing code for browser automation through Galen framework, you need a directory for your program. You can create a directory by going to Java directory under test. Goto test-&amp;gt;java directory-&amp;gt; create a directory name called “testsuites” and create a new class.&lt;/p&gt;

&lt;p&gt;Here is an example demonstrating browser automation with Galen framework. I will be writing code in order to verify logo present and pixel for LAMBDATEST logo and background colour, font-size for the button that says “START TESTING”.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FLamda_page_Screenshot.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FLamda_page_Screenshot.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the IntelliJ window that you are seeing now, write the following code:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;CODE(Self Explanatory):&lt;/b&gt;&lt;/p&gt;

&lt;pre&gt;
SampleUILayoutTest.java
Last week
Dec 27, 2018
M
Muthuraja Ramakrishnan uploaded an item
Java
SampleUILayoutTest.java
package testSuites;
import com.galenframework.api.Galen;
import com.galenframework.reports.GalenTestInfo;
import com.galenframework.reports.HtmlReportBuilder;
import com.galenframework.reports.model.LayoutReport;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
public class SampleUILayoutTest {
    private static final String lambdaTestpage = "src/main/resources/specs/lambdatest.gspec";
    private static final String baseURL="https://www.lambdatest.com/";
    private WebDriver driver;
    private LayoutReport layoutReport;

    /* initialize webdriver, make sure you download chrome driver in http://chromedriver.chromium.org/downloads
    and drop the exe file under resources folder
     */
    @BeforeClass
    public void init() {
        //declaration and instantiation of Objects/variables
        System.setProperty("webdriver.chrome.driver", "src/main/resources/chromedriver.exe");
        driver = new ChromeDriver();
        //triggers chrome to launch for directing it towards the base url
        driver.get(baseURL);
        //Maximize the browser window
        driver.manage().window().maximize();
    }
    &lt;a class="mentioned-user" href="https://dev.to/test"&gt;@test&lt;/a&gt;
    public void checkLogoVisibleAndImageVerification() throws IOException {
        //Executing Layout check and obtaining the Layout report
        layoutReport = Galen.checkLayout(driver, lambdaTestpage, Arrays.asList("desktop"));
    }
    @AfterMethod
    public void reportUpdate() {
        try {
            //Creating a list of tests
            List tests = new LinkedList&amp;lt;&amp;gt;();
            //The object you create will be consisting the information regarding the test
            GalenTestInfo test = GalenTestInfo.fromString("Test Automation Using Galen Framework");
            //Adding layout report to the test report
            test.getReport().layout(layoutReport, "Verify logo present and log image comparison");
            tests.add(test);
            //Exporting all test report to html
            new HtmlReportBuilder().build(tests, "target/galen-html-reports");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @AfterClass
    public void tearDown() {
        //Close and Quit the driver.
        driver.quit();
    }

}
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Report Generation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you run the above code, the report gets generated under target -&amp;gt;galen-html-reports&lt;br&gt;
Open reports.html which returns the following report&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FGalen_Report_Summary.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FGalen_Report_Summary.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on hyperlink label at left side.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FGalen_Detailed_report.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FGalen_Detailed_report.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will find the detailed report and failures shown on the summary page. Click on any one of the links, for eg., I clicked on the visible link &amp;amp; it validated the below-presented logo.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FLAMBDATEST_Logo.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FLAMBDATEST_Logo.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is another example, as I clicked on css “background-colour” the background colour was verified as black.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FStart-Testing_snapshot.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FStart-Testing_snapshot.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Trouble Shooting
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;After setup the project, in case you get any error in IntelliJ, Please double check by navigating to Right-click on Project-&amp;gt;Open Module Settings-&amp;gt;Modules-&amp;gt;Select JDK version 1.8&lt;/li&gt;
&lt;li&gt;We should maintain proper indentation in spec file otherwise it may throw an error. Please visit the website for more details.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="http://galenframework.com/docs/reference-galen-spec-language-guide/" rel="noopener noreferrer"&gt;http://galenframework.com/docs/reference-galen-spec-language-guide/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That was all you need to know for &lt;a href="https://www.lambdatest.com/blog/top-10-books-for-getting-started-with-automation-testing/" rel="noopener noreferrer"&gt;getting started with browser automation&lt;/a&gt; using Galen framework to perform cross browser layout testing of your website or web-app. Feel free to share your opinion of this tutorial in the comment section below. I would appreciate if you have any questions for me or if you share about your experience with Galen framework for cross browser layout testing has been so far? Happy testing!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.lambdatest.com/blog/using-galen-framework-for-automated-cross-browser-layout-testing/" rel="noopener noreferrer"&gt;Original Source: lambdatest.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>java</category>
      <category>framework</category>
      <category>automation</category>
    </item>
    <item>
      <title>Automated Cross Browser Testing With Protractor &amp; Selenium</title>
      <dc:creator>Muthu Raja</dc:creator>
      <pubDate>Thu, 24 Jan 2019 10:47:13 +0000</pubDate>
      <link>https://forem.com/testmuai/automated-cross-browser-testing-with-protractor--selenium-411i</link>
      <guid>https://forem.com/testmuai/automated-cross-browser-testing-with-protractor--selenium-411i</guid>
      <description>&lt;p&gt;We are living in an era where numerous test automation tools or libraries are available in the market. The abundance brings along confusion and choosing the right framework turns out to be very challenging. Identifying the right tool at the earliest is crucial to for greater ROI. When come to Angular JS based application we don’t have to worry too much because we have Protractor in place. Google strongly recommends Protractor for end-to-end automation for AngularJS because both are maintained and owned by Google, and they build JavaScript test automation framework to handle AngularJS component in a better manner. In this article, we will be looking into details about what do we mean by JavaScript test automation Framework? What is Protractor? Why Protractor Is a good fit for test automation? How it helps to achieve cross browser test automation with different browsers?&lt;/p&gt;

&lt;h3&gt;
  
  
  What Do We Mean By JavaScript Test Automation Frameworks?
&lt;/h3&gt;

&lt;p&gt;There has been major growth in JavaScript Framework usage over the past few years, the reason is, nowadays most of the apps are developed using technology like Angular JS or React JS. In fact, initially, &lt;a href="https://www.lambdatest.com/blog/angularjs-a-developers-first-choice/" rel="noopener noreferrer"&gt;AngularJS was the first choice for web developers&lt;/a&gt;, however, by the end of 2018, we could see major dominance over the web for ReactJS. &lt;a href="https://www.lambdatest.com/blog/will-reactjs-continue-to-dominate-in-2019/" rel="noopener noreferrer"&gt;ReactJS may even continue to dominate 2019 as well&lt;/a&gt;. To deal with these in test automation, we should adopt right programming language and test automation framework.&lt;/p&gt;

&lt;p&gt;JavaScript test automation frameworks are end-to-end framework is specialized to run automation scripts for web application. However, choosing the right could be very challenging based on the following criteria selection.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.lambdatest.com/blog/all-you-need-to-know-about-end-to-end-testing/" rel="noopener noreferrer"&gt;End to End Testing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Assertion library&lt;/li&gt;
&lt;li&gt;BDD/TDD Integration&lt;/li&gt;
&lt;li&gt;Integration test&lt;/li&gt;
&lt;li&gt;Regular updates from the community&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.lambdatest.com/blog/using-galen-framework-for-automated-cross-browser-layout-testing/" rel="noopener noreferrer"&gt;Cross Browser Layout Testing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.lambdatest.com/smart-visual-ui-testing" rel="noopener noreferrer"&gt;Visual Regression Testing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why JavaScript Framework Is Necessary When Compare With Other Languages?
&lt;/h3&gt;

&lt;p&gt;JavaScript is no news to web developers. Most of the developers in an organization write JavaScript code for developing web applications, unit test etc. Here are the following reasons for considering JavaScript framework pivotal.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy to follow &lt;a href="https://www.lambdatest.com/blog/how-shift-left-testing-can-help-your-product-quality/" rel="noopener noreferrer"&gt;Shift left testing for better product quality&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Provides developers the flexibility of generating end to end tests, along with unit testing for faster and reliable shipping.&lt;/li&gt;
&lt;li&gt;More collaboration between Dev and QA in same language for &lt;a href="https://www.lambdatest.com/blog/automated-cross-browser-testing/" rel="noopener noreferrer"&gt;test automation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Helps to implement Dev QA test and pair programming in test automation side.&lt;/li&gt;
&lt;li&gt;More flexible to work all in same languages and better productivity.&lt;/li&gt;
&lt;li&gt;Right tools and right approach in same languages gets greater benefits.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What Is Protractor?
&lt;/h3&gt;

&lt;p&gt;Protractor is a &lt;a href="https://www.lambdatest.com/blog/top-javascript-frameworks-for-2019/" rel="noopener noreferrer"&gt;JavaScript framework&lt;/a&gt;, end-to-end test automation framework for Angular and AngularJS application. It test against your application in real browser, like a real user would.&lt;/p&gt;

&lt;p&gt;Protractor is built on top of WebDriver JS (Selenium) and apart from default locator, it comes up with Angular-specific locator strategies. It’s not intended to test only AngularJS application but also helps to write automation test for Non-Angular JS application.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Makes Protractor A Good Fit For Your Automation Test Scripts?
&lt;/h3&gt;

&lt;p&gt;Protractor is an open-source, End to End test automation framework, that is brought up by Google which makes it a reliable, renowned and up-to-date framework. Protractor is a Node.js program that supports testing framework like Jasmine, Mocha and Cucumber.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features of Protractor:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Protractor is developed as a wrapper build around Selenium WebDriver JS and Selenium Server. All key feature of Selenium WebDriver JS and additional implementation helps to do better automation supports and less maintenance when compare with Selenium.&lt;/li&gt;
&lt;li&gt;Protractor offers new locator strategies on top of native locator which actually helps to locate element in DOM easily.&lt;/li&gt;
&lt;li&gt;* by.model, by.binding, by.repeater etc.,&lt;/li&gt;
&lt;li&gt;Protractor supports page object design pattern – helps on writing clean and readable code. Writing clean code is imperative for Automation testers. Here are &lt;a href="https://www.lambdatest.com/blog/8-actionable-insights-to-write-better-automation-code/" rel="noopener noreferrer"&gt;8 actionable insights for writing better automation code&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Protractor make use of Selenium Grid to initialize, control and run browser instance.&lt;/li&gt;
&lt;li&gt;Can easily integrate with jasmine, mocha and cucumber framework to write your test.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Advantage of Protractor when combined with Selenium:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Excellent speed compare with other tools or libraries.&lt;/li&gt;
&lt;li&gt;Support cross browser parallel testing through multiple browsers.&lt;/li&gt;
&lt;li&gt;No need to work on synchronization strategy for eg., waits like implicit, explicits and sleep etc., Protractor has in build capabilities and intelligence to connect with Angular JS framework and knows when Angular has finished rendering the DOM for eg., page loading wait, synchronization,&lt;/li&gt;
&lt;li&gt;Angular-specific locator support.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Started With Cross Browser Automation Testing With Protractor and Selenium
&lt;/h3&gt;

&lt;p&gt;Here are the prerequisite required for performing cross browser automation testing with Protractor and Selenium on Windows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;Install protractor using npm&lt;/li&gt;
&lt;li&gt;Update webdriver manager and start up a server&lt;/li&gt;
&lt;li&gt;Visual Studio Code&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Setting Up Automation Environment For Testing With Protractor And Selenium In Windows
&lt;/h3&gt;

&lt;p&gt;This section has detailed steps explaining how to setup environment for performing end to end cross browser automation testing with Protractor and Selenium through Windows.&lt;br&gt;
&lt;strong&gt;Step 1: Installation of Node.js&lt;/strong&gt;&lt;br&gt;
You need to install npm for Node.js.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is npm?&lt;/strong&gt;&lt;br&gt;
npm is a free to use, package manager for javascript development which helps you to download all public software packages&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is package manager&lt;/strong&gt;&lt;br&gt;
A package in node.js contains group of files that you need for a module. Module is nothing it’s javascript libraries that can be included in your project.&lt;br&gt;
To install Node.js, click &lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;here&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-21.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-21.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you are done downloading the installer, run it as administrator.&lt;/p&gt;

&lt;p&gt;Click on ‘Next’ button in Node.js setup window to proceed further.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage9-5.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage9-5.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on checkbox for accepting license agreement and click on Next button.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage20-1.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage20-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep default windows location or feel free to change the location and click next.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage11-4.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage11-4.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thereafter, click on Next and Install button. Wait for a couple minutes for the installation to complete.&lt;/p&gt;

&lt;p&gt;You would have seen the following screen after installation completed.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage18-1.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage18-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To verify npm gets installed in your machine. Please supply the following command:&lt;br&gt;
&lt;code&gt;npm –version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Installation of Protractor using npm&lt;/strong&gt;&lt;br&gt;
To download a package, open a command prompt and supply the following command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install –g protractor&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;install command is for download the package&lt;/p&gt;

&lt;p&gt;-g stands for global which means any command to operate in global mode.&lt;/p&gt;

&lt;p&gt;The below snapshot indicates that protractor is installed successfully.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage12-3.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage12-3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To verify installed protractor version, supply the following command&lt;br&gt;
&lt;code&gt;protractor –version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Update WebDriver Manager and Start Up A Server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To update webdriver manager, supply the following commands&lt;/p&gt;

&lt;p&gt;&lt;code&gt;webdriver-manager update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once supply the above commands, it would download all necessary dependencies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage31.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage31.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;WebDriver manager is a helper tool to download necessary binaries. It will help to start and stop selenium server.&lt;/p&gt;

&lt;p&gt;To start up with selenium server,&lt;br&gt;
&lt;code&gt;webdriver-manager start&lt;/code&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage28.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage28.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To verify selenium server is running in browser, please use the following url&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:4444/wd/hub" rel="noopener noreferrer"&gt;http://localhost:4444/wd/hub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Protractor test will send request to this server and control a local browser where you can see information about the status of the server. So, you could later go ahead and run your JS automation script with Protractor and Selenium.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Installation of Visual Studio Code&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;What is Visual Studio Code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Developed by Microsoft, Visual Studio code is a source code editor for Windows, Mac and Linux operating systems. It is a lot similar to other programming editor like Eclipse or Intellij. This tool was developed by Microsoft for Windows, Linux and Mac OS. It supports number of programming languages, to know more about Visual Studio code please visit &lt;a href="https://en.wikipedia.org/wiki/Visual_Studio_Code" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Double click on Visual Studio installer and click “Next” button.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage14-1.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage14-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on “I accept the agreement” in Setup – Visual Studio Code window&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage21-1.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage21-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep default installation location (or) feel free to change different path in your computer and click “Next’ button.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage13-2.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage13-2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Continue to click “Next” and check Desktop Shortcut if you want, finish the installation.&lt;/p&gt;

&lt;p&gt;Once installation is complete, the following window would appear.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage15-1.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage15-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click “Finish” button, finally Visual Studio Code Editors open up.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage30.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage30.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the language which you want to install, I would suggest you to install JavaScript and TypeScript for executing automation test cases using Protractor and Selenium. Once clicked, it prompts you to select “ok” button, it would take few seconds to install the selected languages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Writing Sample Code for Automation Testing With Protractor and Selenium
&lt;/h3&gt;

&lt;p&gt;Now, we will have a look at a sample Javascript code for automation testing with Protractor and Selenium, and execute the test in local instance meaning execute the test that run on your browser installed in your machine.&lt;/p&gt;

&lt;p&gt;To run protractor test for end to end automation, you must need two files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Specs&lt;/li&gt;
&lt;li&gt;Config&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Specs: Specs is actual test suites that have more than on test cases designed in Javascript using Jasmine framework.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Jasmine Framework?&lt;/strong&gt;&lt;br&gt;
Jasmine is a BDD(Behaviour Driven Deployment) testing framework for Javascript. This framework helps you to write clean and better readability of code. To know more about Jasmine Framework, please visit &lt;a href="https://jasmine.github.io/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Executing Single Instance For Automation Testing With Protractor and Selenium WebDriver(Local)
&lt;/h3&gt;

&lt;p&gt;Here is the simple example config file and how to write basic code in Protractor using Jasmine Framework.&lt;/p&gt;

&lt;p&gt;Config.js:&lt;/p&gt;

&lt;pre&gt;exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['lambdatest_spec.js'],
  multiCapabilities: [{
    'browserName': 'chrome',
  },
  {
    'browserName': 'firefox'
  }]
}&lt;/pre&gt;

&lt;p&gt;In the above snapshot shows the syntax of how to define config file to execute browser automation with Protractor and Selenium.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;seleniumAddress: Protractor make use to Selenium Grid to run your test in specified browser.&lt;/li&gt;
&lt;li&gt;specs: specs indicates test suite that you can mention in one or more spec files to run multiple tests.&lt;/li&gt;
&lt;li&gt;Capabilities: This is the place where you can capability setting for your test configuration for eg., browser version, platform etc., in case no capabilities is provided then by default, it takes chrome browser in your machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;describe('To verify Angular and non Angular application test', () =&amp;gt; {
    it('To verify page title of Lambdattest', () =&amp;gt; {
        browser.get("https://lambdatest.com");
        element(by.css('p.home-btn &amp;gt; a.home-cta')).click();
        expect(browser.getTitle()).toEqual('Signup - LambdaTest App | Free Cross Browser Testing Tool');
    });
});&lt;/pre&gt;

&lt;p&gt;We will see clear explanation of what is the above code indicating.&lt;/p&gt;

&lt;p&gt;describe –&amp;gt; describe is the keyword from Jasmine to write syntax for test suites. This is definition of collection of test cases in your script file.&lt;/p&gt;

&lt;p&gt;it –&amp;gt; is the keyword for test cases to meet specific condition. There can be more than one “it” added under describe in Jasmine framework.&lt;/p&gt;

&lt;p&gt;In the above code, we launch the browser, navigate to sign up page, see the title gets matched and pass the results.&lt;/p&gt;

&lt;p&gt;To run your test:&lt;/p&gt;

&lt;p&gt;In Visual Studio Code: Go to View Menu-&amp;gt; Click “Terminal” and supply the following command&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage6-3.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage6-3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax: To run your test suites protractor followed by config file name&lt;/strong&gt;&lt;br&gt;
Note: Before run your test, please make to run selenium Grid by supply the following commands:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;webdriver-manager start&lt;/code&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage32.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage32.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After executing the above test, observed the following failures which is expected.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-22.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-22.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above screenshot indicates the website &lt;a href="https://lambdatest.com/" rel="noopener noreferrer"&gt;https://lambdatest.com&lt;/a&gt; is not developed using AngularJS component. This is best real time examples to realize how Protractor works while launching browser. As mentioned in “Advantages” topic in above, the Protractor basically tries to connect with Angular JS framework while launching application. The moment Protractor identified and realized it’s not an AngularJS component, it recommended us to turn off waiting for Angular.&lt;/p&gt;

&lt;p&gt;To Address this problem: we have a method called “browser.waitForAngularEnabled(false);”&lt;/p&gt;

&lt;p&gt;Now, the method is added in the script and as you can see in the below screenshot, Protractor now supports with non-angular js application.&lt;/p&gt;

&lt;pre&gt;describe('To verify Angular and non Angular application test', () =&amp;gt; {
    it('To verify page title of Lambdattest', () =&amp;gt; {
        browser.waitForAngularEnabled(false);
        browser.get("https://lambdatest.com");
        element(by.css('p.home-btn &amp;gt; a.home-cta')).click();
        expect(browser.getTitle()).toEqual('Signup - LambdaTest App | Free Cross Browser Testing Tool');
    });
});&lt;/pre&gt;

&lt;p&gt;After executing the test, the test is passed successfully.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage5-4.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage5-4.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Executing Parallel Execution For Automation Testing With Protractor and Selenium WebDriver(Local)
&lt;/h3&gt;

&lt;p&gt;In this example I’m trying to use same script like above except small tweak in conf.js page. So I copied existing config and update configuration details to run same test in multiple browsers to perform cross browser parallel testing.&lt;/p&gt;

&lt;pre&gt;exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['lambdatest_spec.js'],
  multiCapabilities: [{
    'browserName': 'chrome',
  },
  {
    'browserName': 'firefox'
  }]
}&lt;/pre&gt;

&lt;p&gt;In the above examples, I modified “multiCapabilities” and included firefox browser. This is the best advantage when we compare with other libraries/packages, no maintenance is needed in case of automation testing with Protractor and Selenium. Protractor supports in-build code to run cross browser automation.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage7-4.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage7-4.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This time we run both same tests in chrome and firefox which executed and pass the results. So far we have seen how to run the test in protractor for Non-Angular JS application. The below section will show how to run AngularJS application in parallel and cloud execution (using Lambdatest).&lt;/p&gt;

&lt;h3&gt;
  
  
  Executing Parallel Execution for AngularJS Application
&lt;/h3&gt;

&lt;p&gt;To run parallel execution for AngularJS application, the configuration remains but I implement use async and await for right way to queue up events.&lt;/p&gt;

&lt;p&gt;Make sure to disable promise manage in your config file.&lt;/p&gt;

&lt;pre&gt;exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['calculator_spec.js'],
  multiCapabilities: [{
    'browserName': 'chrome',
  },
  {
    'browserName': 'firefox'
  }],
  SELENIUM_PROMISE_MANAGER: false
}&lt;/pre&gt;

&lt;pre&gt;describe('To verify super calculator functionality', () =&amp;gt; {
    it('perform addition with 2 values', async () =&amp;gt; {
        await browser.get('http://juliemr.github.io/protractor-demo/');
        await browser.element(by.model('first')).sendKeys('25');
        await browser.element(by.model('second')).sendKeys('25');
        await browser.element(by.id('gobutton')).click();
        expect(await browser.element(by.css('h2.ng-binding:nth-child(5)')).getText()).toEqual('50')
    })
})&lt;/pre&gt;

&lt;p&gt;Executing Cross Browser Parallel testing, Protractor &amp;amp; LambdaTest (Cloud)&lt;/p&gt;

&lt;p&gt;There are always challenges and limitation to run your test with multiple version of browsers in local machines. You can’t think of installing thousands of available browser in your local machine to perform extensive, automated cross browser testing. To achieve more browser usage, remote execution in cloud is the only solution. LambdaTest offers 2000+ browsers to run your automation test scripts on their Selenium grid over a variety of devices and different browser version.&lt;/p&gt;

&lt;p&gt;In this example, I’m going to explain how to execute cross browser parallel testing with Protractor and Selenium on LambdaTest cloud provider.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configuration Details to run in LambdaTest:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;exports.config = {

  seleniumAddress: 'https://:&lt;a class="mentioned-user" href="https://dev.to/hub"&gt;@hub&lt;/a&gt;.lambdatest.com/wd/hub',

  multiCapabilities: [{
    'name': 'Protractor LambdaTest Parallel_Chrome',
    'build': 'Protractor Javascript Example',
    'browserName': 'Chrome',
    'platform': 'WIN10',
    'version': '70.0',
    'video': true,  //To Enable video recording
    'visual': true, //To Enable step by step screenshot
    'network': true,    //To capture Network logs     
    'console': true   //To capture Console Logs 
  }, {
    'name': 'Protractor LambdaTest Parallel_Safari',
    'build': 'Protractor JavaScript Example',
    'browserName': 'safari',
    'platform': 'macOS High Sierra',
    'version': '11.0',
    'video': true,  //To Enable video recording
    'visual': true, //To Enable step by step screenshot
    'network': true,    //To capture Network logs     
    'console': true   //To capture Console Logs  
  }],
  specs: ['calculator_spec.js'],
  SELENIUM_PROMISE_MANAGER: false
};&lt;/pre&gt;

&lt;p&gt;In the above screenshot:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;seleniumAddress:&lt;/b&gt; ‘https://:&lt;a class="mentioned-user" href="https://dev.to/hub"&gt;@hub&lt;/a&gt;.lambdatest.com/wd/hub’&lt;/p&gt;

&lt;p&gt;&lt;b&gt;User_Account:&lt;/b&gt; It’s your login account of LambdaTest&lt;/p&gt;

&lt;p&gt;&lt;b&gt;API_KEY:&lt;/b&gt; it’s access key which can be found in Profile page of your login. In case no API key, feel free to generate.&lt;/p&gt;

&lt;p&gt;multicapabilities indicates to run your test on multiple browsers in parallel.&lt;/p&gt;

&lt;p&gt;The other configurations mostly platform, browser specific and LambdaTest cloud provider specific to enable or disable the options.&lt;/p&gt;

&lt;p&gt;I’m going to execute the following code on LambdaTest with Chrome and Safari in parallel.&lt;/p&gt;

&lt;pre&gt;describe('To verify Angular and non Angular application test', () =&amp;gt; {
    it('To verify page title of Lambdattest', () =&amp;gt; {
        browser.waitForAngularEnabled(false);
        browser.get("https://lambdatest.com");
        element(by.css('p.home-btn &amp;gt; a.home-cta')).click();
        expect(browser.getTitle()).toEqual('Signup - LambdaTest App | Free Cross Browser Testing Tool');
    });
});&lt;/pre&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage19-1.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage19-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The below results indicates the test is success and passed on lambdatest cloud 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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-23.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-23.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s take a look on example in cloud.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage23-1.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage23-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Detail snapshot of Test Cases in LambdaTest page for Safari Browser:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage29.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage29.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this, we have seen how we can run simple scripts for Javascript automation testing with Protractor and Selenium WebDriver for both local and cloud execution of parallel testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;By delivering Protractor as an extensive end to end testing framework, Google has put a lot of efforts to make QA engineer works easy and protractor works like a charm. There are a lot of NPM modules available to utilize work with REST API, data generators etc along with browser automation to integrate all types of automation. All these point towards Protractor being the right choice for automated cross browser testing of AngularJS as well as Non-AngularJS application.&lt;/p&gt;

&lt;p&gt;Original Source: &lt;a href="https://www.lambdatest.com/blog/automated-cross-browser-testing-with-protractor-selenium/" rel="noopener noreferrer"&gt;lambdatest.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>showdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Cross Browser Automation Testing Using Watir</title>
      <dc:creator>Muthu Raja</dc:creator>
      <pubDate>Tue, 22 Jan 2019 11:11:24 +0000</pubDate>
      <link>https://forem.com/testmuai/cross-browser-automation-testing-using-watir-5g83</link>
      <guid>https://forem.com/testmuai/cross-browser-automation-testing-using-watir-5g83</guid>
      <description>&lt;p&gt;We are living in an era where software development demands for automation. Software development methodologies such as RAD(Rapid Application Development), Agile and so on requires you to incorporate &lt;a href="https://www.lambdatest.com/blog/automated-cross-browser-testing/" rel="noopener noreferrer"&gt;automation testing&lt;/a&gt; as a part of your release cycle. There exist numerous test automation frameworks used for automation testing. Today, I will be picking up Watir an open source, selenium-based web driver used for browser automation. Cross browser automation testing using Watir would help you to ensure a good rendering user interface of your web app. If you are a beginner to automation testing and are unaware of basics then don’t worry as I will also be talking about browser automation, [cross browser automation], parallel testing and what makes Watir special than other several tools and libraries. Without further ado, here we go!&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is Browser Automation?
&lt;/h3&gt;

&lt;p&gt;Browsers have become indispensable to our daily basis productivity. We explore, learn, shop, invest and do a lot more with browsers. There are times when we feel the need for browsers to automate our repetitive tasks. Imagine how cool that would be? Is it possible? Yes, any task you perform in browsers is automatable.&lt;/p&gt;

&lt;p&gt;Let us take some considerations based on basic practical scenarios. You can use browser automation if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need to fill a lot of forms for data entry.&lt;/li&gt;
&lt;li&gt;You need to generate a report from web portal on daily basis and send email to the team.&lt;/li&gt;
&lt;li&gt;You navigate to a specific website and upvote on daily basis for a particular candidate on a reality TV show.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the software industry, testing a web app can demand for a huge investment of time, resources and money. Testing a web app to check how well it renders could be very strenuous if relied upon manual testing alone. The manual testing ensures your application is functioning as expected, based on client requirements and expectations. Browser automation comes to rescue so we could avoid repeated manual testing, regression test cases, and obtaining early feedbacks along with reduced effort.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is Cross Browser Automation Testing?
&lt;/h3&gt;

&lt;p&gt;Now, there are thousands of browsers available on the internet and your website may render in a unique manner on every browser or browser version. It could be very complex to test your website across every single one of them. &lt;a href="https://www.lambdatest.com/blog/automated-cross-browser-testing/" rel="noopener noreferrer"&gt;Cross browser automation testing&lt;/a&gt; is to verify your application renders seamlessly across different browsers and its combination version. This is primarily performed to check &lt;a href="https://www.lambdatest.com/blog/how-to-make-a-cross-browser-compatible-website/" rel="noopener noreferrer"&gt;cross browser compatibility&lt;/a&gt; of your shippable application’s functionality on combinations of the various OS running separate browsers like &lt;a href="https://www.lambdatest.com/test-on-chrome-browsers" rel="noopener noreferrer"&gt;Google Chrome&lt;/a&gt;, &lt;a href="https://www.lambdatest.com/test-on-firefox-browsers" rel="noopener noreferrer"&gt;Mozilla Firefox&lt;/a&gt;, &lt;a href="https://www.lambdatest.com/test-on-edge-browsers" rel="noopener noreferrer"&gt;Edge&lt;/a&gt;, &lt;a href="https://www.lambdatest.com/test-on-internet-explorer-browsers" rel="noopener noreferrer"&gt;IE&lt;/a&gt;, &lt;a href="https://www.lambdatest.com/test-on-opera-browsers" rel="noopener noreferrer"&gt;Opera&lt;/a&gt;, &lt;a href="https://www.lambdatest.com/test-on-safari-browsers" rel="noopener noreferrer"&gt;Safari&lt;/a&gt;, &lt;a href="https://www.lambdatest.com/test-on-yandex-browsers" rel="noopener noreferrer"&gt;Yandex&lt;/a&gt; and many more.&lt;/p&gt;

&lt;p&gt;To run all browsers and its combination of version is time-consuming. For eg., your client asks to perform a regular basis &lt;a href="https://www.lambdatest.com/feature" rel="noopener noreferrer"&gt;cross browser compatibility&lt;/a&gt; check across 5 versions of latest and 5 versions of legacy Chrome, Safari, Firefox and Edge browser that would bring a total number of browser combinations to be of 40 completely different distinctive browsers and its version for one test case. Consider how overwhelmingly time-consuming and tedious it could be to perform a cross browser compatibility check over all those browser combinations and provide sign off, that needed positively proper planning, huge investments in QA resource, handling challenges, time and cost. To deal with this issue, Cross Browser automation testing for parallel test sessions is the solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is Cross Browser Parallel Test Automation?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.lambdatest.com/selenium-automation" rel="noopener noreferrer"&gt;Cross Browser Parallel testing&lt;/a&gt; is performed to run a single test across multiple browser combinations, simultaneously. This is a very practical and powerful consumption scenario of automation testing. Cross browser parallel test automation allows you to scale back execution time while not compromising with coverage of your check and leading to faster rotation of your test results.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is Watir?
&lt;/h3&gt;

&lt;p&gt;Watir is an open source Ruby Libraries which helps to achieve cross browser automation testing. Watir supports Ruby which is object oriented language and typically it’s simpler and faster than other languages. The good thing about Watir is, it supports any web application irrespective of the technology used to develop that application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Watir?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;It’s a free open source tool belonging to a family of Ruby.&lt;/li&gt;
&lt;li&gt;It supports headless browser execution.&lt;/li&gt;
&lt;li&gt;It supports page object design pattern.&lt;/li&gt;
&lt;li&gt;It supports Cucumber Integration.&lt;/li&gt;
&lt;li&gt;Tests can be maintained simple and flexible.&lt;/li&gt;
&lt;li&gt;It supports your web app no matter what technology used to develop your app.&lt;/li&gt;
&lt;li&gt;It supports multiple browsers on different platforms.&lt;/li&gt;
&lt;li&gt;It is lightweight and easy to use.&lt;/li&gt;
&lt;li&gt;It supports execution in Cloud through cloud based cross browser automation testing tools like LambdaTest.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, we will take a look on how to setup test automation environment for Watir with RubyMine IDE and then go ahead with the sample script. I would also show how to run the script and see the failure in RubyMine. Let’s dive right in.&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting Started With Cross Browser Automation Testing Using Watir
&lt;/h3&gt;

&lt;p&gt;Here are the prerequisite required for performing cross browser automation testing using Watir on Windows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RubyInstaller&lt;/li&gt;
&lt;li&gt;Watir&lt;/li&gt;
&lt;li&gt;RubyMine IDE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The RubyInstaller is must because Watir supports Ruby code, so this installation is very important before we proceed with Automation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up Automation Environment
&lt;/h3&gt;

&lt;p&gt;This section has detailed steps explaining how to setup automation environment for performing cross browser automation testing using Watir through Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Installation of Ruby:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Navigate to Official Ruby Installer page &lt;a href="https://rubyinstaller.org/downloads/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Click on Latest version With DEVKIT to download. Select your OS architecture type, for e.g., I select (X64) 64 bit operating system.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-12.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-12.png" alt="IMAGE" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After download, right click on installer and run as administrator in Windows machine.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage1-7.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage1-7.png" alt="IMAGE" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The setup window popups to accept license agreement, you need to accept this and move next.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage10-2.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage10-2.png" alt="IMAGE" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would recommend selecting all checkboxes and clicking install button to proceed further.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage7-2-1.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage7-2-1.png" alt="IMAGE" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The below progress bar indicates the install is in-progress, which takes few minutes time to install 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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-13.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-13.png" alt="IMAGE" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After installation is complete, the following window will popup to install updated component. This is optional either you can leave it by closing the window or hit “Enter” button to update all components.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage16.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage16.png" alt="IMAGE" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open command prompt in windows and enter the following command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ruby-version
The installation version of Ruby version is displayed in the command prompt, which indicates Ruby installer is success.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage2-3.png" alt="image" width="800" height="400"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To verify once again the installation is success and Ruby programs works fine. Enter the following commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;irb&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;irb or IRB stands for Interactive Ruby Shell which is a REPL(read-eval print loop) for programming in the object-oriented scripting language Ruby.&lt;/p&gt;

&lt;p&gt;I will write a simple code that will put “&lt;a href="http://lambdatest.com/" rel="noopener noreferrer"&gt;lambdatest.com&lt;/a&gt;” to print it.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-14-1.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Funnamed-14-1.png" alt="image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Installation of Watir:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Installation of Watir is very simple. As I mentioned in the above section to verify Watir, you must first installed Ruby. To install, supply the below gem command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gem install watir&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;gem indicates RubyGems that is a package manager for the Ruby programming which provides a standard format of disturbing Ruby libraries.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage23.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage23.png" alt="image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Installation of RubyMine IDE:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RubyMine is an IDE(Integrated Development Environment) that helps you to write, debug and testing code for your application. Ruby also support multiple OS like Windows, MacOS and Linux etc.&lt;/p&gt;

&lt;p&gt;Note: RubyMine comes up with Free 30- day Trial license.&lt;/p&gt;

&lt;p&gt;To download the RubyMine, click &lt;a href="https://www.jetbrains.com/ruby/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Click on the following button, which will download in your machine.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage3-3.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage3-3.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Right click on installer and run as Administrator, which pop ups the following windows.&lt;/p&gt;

&lt;p&gt;Click next and continue till the installation is complete and launch RubyMine&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage20.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage20.png" alt="image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep default with existing plugins and click Next until you see the below window.&lt;/p&gt;

&lt;p&gt;Click “Create New 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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage13.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage13.png" alt="image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter project name and select “Ruby SDK” which will be available if you install Ruby Installer.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage18.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage18.png" alt="image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Right click on created project and create a new directory called “testsuites”&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage9-3.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage9-3.png" alt="image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a subdirectory called “resources” under testsuites and drop “chromedriver.exe”&lt;/p&gt;

&lt;p&gt;To run browser based automation, chromedriver is required which is a separate executable that WebDriver uses to control chrome. Similarly we have different driver for each browser for eg., geckodriver for Mozila firefox, edge driver for Microsoft Edge browsers etc.,&lt;/p&gt;

&lt;p&gt;To download chromedriver, please visit &lt;a href="http://chromedriver.chromium.org/downloads" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Writing Code for Sample Test
&lt;/h3&gt;

&lt;p&gt;To write code in RubyMine is very simple.&lt;/p&gt;

&lt;p&gt;Right click on testsuites and select “TestUnit Test Template”&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage19.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage19.png" alt="image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter file name “my_script.rb” in filename and click ok button.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage5-2.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage5-2.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the RubyMine window that you are observing now, write the following code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CODE (Self Explanatory):&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;
require 'watir'
require 'selenium-webdriver'
require 'test/unit'
require 'test/unit/ui/console/testrunner'
 
class Sampletest &amp;lt; Test::Unit::TestCase
 
  "" "
    LambdaTest Watir automation sample example
    Configuration
    ----------
    Download Chrome driver from http://chromedriver.chromium.org/downloads and drop into your resource folder
 
    Result
    -------
    Execute Watir Automation Tests on LambdaTest website
    " ""
 
  def setup
    "" "
        Setup local driver
        Params
        ----------
        platform : Windows 10
        browserName : Supported platform - (chrome in your local box)
 
        Result
        -------
        " ""
    #Initializing chrome driver
    Selenium::WebDriver::Chrome.driver_path = "resources/chromedriver.exe"
    &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt; = Watir::Browser.new
  end
 
  def test_verifyLambdapage()
      #Navigate to lambdatest.com website
      &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.goto 'https://lambdatest.com'
      #Maximize the browser window
      &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.window.maximize
      #Initializing element with Link text
      ele_starttestingbutton = &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.link(:text =&amp;gt; "START TESTING")
      #Perform click operation
      ele_starttestingbutton.click
      #printing page title
      puts("Actual Page title is: "+&lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.title)
      #Verifying actual and expected title of the page. This examples I intentionally fail the test by adding spell error
      assert_equal("Signup - LambdaTest App | Free Cross Browser Testing To0ol", &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.title)
  end
 
 
  def teardown
    #Quit the browser
    &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.quit
  end
end&lt;/pre&gt;

&lt;p&gt;Right click on the script and select “Run” in IDE to see test results and what is the output&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage11-2.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage11-2.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above test script I intentionally fail to verify results in terms of comparing actual vs. expected page title.&lt;/p&gt;

&lt;p&gt;The below snapshot explain the test gets failed and the difference is highlighted in colour.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage22.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage22.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Local WebDriver To Perform Cross Browser Automation Testing Using Watir
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Code Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;def setup
  "" "
      Setup local driver
      Params
      ----------
      platform : Windows 10
      browserName : Supported platform - (chrome in your local box)
 
      Result
      -------
      " ""
  #Initializing chrome driver
  Selenium::WebDriver::Chrome.driver_path = "resources/chromedriver.exe"
  &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt; = Watir::Browser.new
end&lt;/pre&gt;

&lt;pre&gt;def teardown
  #Quit the browser
  &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.quit
end&lt;/pre&gt;

&lt;p&gt;In TestUnit template,the IDE automatically create def setup and teardown. These methods actually run before and after test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setup&lt;/strong&gt;: This method is precondition to run the test, you may setup something like initialize browser or any test data setup and&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Teardown&lt;/strong&gt;: This method is after your test run, you may close.quit the browser or delete the data in database etc.,&lt;/p&gt;

&lt;pre&gt;Selenium::WebDriver::Chrome.driver_path = "resources/chromedriver.exe"
    &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt; = Watir::Browser.new&lt;/pre&gt;

&lt;p&gt;The above code is initializing the chrome driver and create new instance and assign object reference to variable browser.&lt;/p&gt;

&lt;p&gt;The next line of code is typical Watir script which actually steps of:&lt;/p&gt;

&lt;p&gt;Note: The method name start with “test_” is mandatory which Unit Test Runner actually realize this is test method.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to browser&lt;/li&gt;
&lt;li&gt;Maximize the Window&lt;/li&gt;
&lt;li&gt;Click on “Start Testing” button in &lt;a href="http://lambdatest.com/" rel="noopener noreferrer"&gt;lambdatest.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Prints Current Page Title&lt;/li&gt;
&lt;li&gt;Finally verifying whether expected vs actual title&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;
def test_verifyLambdapage()
    #Navigate to lambdatest.com website
    &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.goto 'https://lambdatest.com'
    #Maximize the browser window
    &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.window.maximize
    #Initializing element with Link text
    ele_starttestingbutton = &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.link(:text =&amp;gt; "START TESTING")
    #Perform click operation
    ele_starttestingbutton.click
    #printing page title
    puts("Actual Page title is: "+&lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.title)
    #Verifying actual and expected title of the page. This examples I intentionally fail the test by adding spell error
    assert_equal("Signup - LambdaTest App | Free Cross Browser Testing To0ol", &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt;.title)
end&lt;/pre&gt;

&lt;h3&gt;
  
  
  Using Remote WebDriver At LambdaTest To Perform Cross Browser Automation Testing Using Watir
&lt;/h3&gt;

&lt;p&gt;The drawback of executing &lt;a href="https://www.lambdatest.com/selenium-automation" rel="noopener noreferrer"&gt;cross browser automation testing&lt;/a&gt; using Watir for Local WebDriver is that you only get to test your script over the browsers installed in your local machine. However, it isn’t feasible to install thousands of browsers on your system. This is why, cloud is a more preferred platform to perform cross browser automation testing. Cloud provider offers to run your test scripts with support of Selenium grid. The great factor is, you don’t have to be compelled to maintain or any setup needed, all you wish to try and do is slightly tweak your code to support selenium grid. I’m going to explain how to tweak your same code to run test in Lambdatest. LambdaTest provides an extensive Selenium grid offering more than 2000 browsers to test from. You can even perform cross browser automation testing of your locally hosted web apps using their SSH tunnel. Let me show how you can leverage LambdaTest for browser automation using Watir.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run Single Instance In LambdaTest Using Watir
&lt;/h3&gt;

&lt;p&gt;LambdaTest provide cross browser parallel test in terms of running your cross browser automation testing scripts parallely to reduce great execution efforts. We will take a look in detail below regarding how to run simple test and how to run same set of test with different browsers in LambdaTest.&lt;/p&gt;

&lt;p&gt;I’m using same script which I connected in my previous section in above, except the subsequent changes in setup techniques as mentioned within the below snapshot.&lt;/p&gt;

&lt;pre&gt;
def setup
  "" "
      Setup remote driver
      Params
      ----------
      platform : Supported platform - (Windows 10, Windows 8.1, Windows 8, Windows 7,  macOS High Sierra, macOS Sierra, OS X El Capitan, OS X Yosemite, OS X Mavericks)
      browserName : Supported platform - (chrome, firefox, Internet Explorer, MicrosoftEdge)
      version :  Supported list of version can be found at https://www.lambdatest.com/capabilities-generator/
 
      Result
      -------
      " ""
  username = "USER_NAME"
  accessToken = "PASSWORD"
  gridUrl = "beta-hub.lambdatest.com/wd/hub"
  caps = Selenium::WebDriver::Remote::Capabilities.new
  caps[:browserName] = "chrome"
  caps[:version] = "67.0"
  caps[:platform] = "win10"
  caps[:name] = "LambdaTest Watir Signup Page Name verification"
  caps[:build] = "LambdaTest Watir Signup Page Name verification"
  caps[:network] = true
  caps[:visual] = true
  caps[:video] = true
  caps[:console] = true
  puts(caps)
  # URL: https://{username}:{accessToken}@beta-hub.lambdatest.com/wd/hub
  &lt;a class="mentioned-user" href="https://dev.to/browser"&gt;@browser&lt;/a&gt; = Watir::Browser.new(
      :remote,
      :url =&amp;gt; "https://" + username + ":" + accessToken + "@" + gridUrl,
      :desired_capabilities =&amp;gt; caps)
end&lt;/pre&gt;

&lt;p&gt;LambdaTest supports Selenium grid, so to run your test in LambdaTest you need to initialize remote webdriver and point where your Selenium hub or server is running.&lt;/p&gt;

&lt;p&gt;Template of Selenium Grid URL to run in LambdaTest is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://%7Busername%7D:%7BaccessToken%7D@beta-hub.lamdatest.com/wd/hub" rel="noopener noreferrer"&gt;https://{username}:{accessToken}@beta-hub.lamdatest.com/wd/hub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;User Name:You can find it in LambdaTest dashboard page.&lt;/p&gt;

&lt;p&gt;Access Token: You can find it on your profile page. In case no token, feel free to click on generate Access Token button.&lt;/p&gt;

&lt;p&gt;Grid URL: &lt;a href="http://beta-hub.lamdatest.com/" rel="noopener noreferrer"&gt;beta-hub.lamdatest.com&lt;/a&gt; where your selenium grid is running.&lt;/p&gt;

&lt;p&gt;The other important feature is the &lt;a href="https://www.lambdatest.com/capabilities-generator/" rel="noopener noreferrer"&gt;Capabilities Generator&lt;/a&gt;: To run your test suites in LambdaTest Selenium grid you must set the desired capabilities for example, which browser, which operating system and so on basic configurations that you want to test on.&lt;/p&gt;

&lt;p&gt;You can configure which browser, platform etc., and finally it generates a code based upon your selections. Below is the result for Ruby language.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage12-2.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage12-2.png" alt="capability-generator" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Capabilities Generator also supports Java, JavaScript, C#, Python, and PHP.&lt;/p&gt;

&lt;p&gt;That’s all you need to run your tests successfully at LambdaTest for performing cross browser automation testing using Watir.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run Cross Browser Parallel Testing With Watir Using LambdaTest
&lt;/h3&gt;

&lt;p&gt;So far you have got seen a way to run single instance in LambdaTest, this section is detail about regarding a way to run same set of test with different totally browsers in LambdaTest. This section would assist you to grasp a way to generic code run different browser in Watir.&lt;/p&gt;

&lt;p&gt;The below code would facilitate to realize the parallel execution:&lt;/p&gt;

&lt;pre&gt;require 'watir'
require 'selenium-webdriver'
require 'test/unit'

class DumTest &amp;lt; Test::Unit::TestCase

  "" "
    LambdaTest Watir automation sample example with Cross Browsers
    Configuration
    ----------
    username: Username can be found at automation dashboard or profile page
    accessToken:  AccessToken can be generated from automation dashboard or profile section

    Result
    -------
    Execute Watir Automation Tests on LambdaTest using Selenium Grid
    " ""

 #Confuring Multiple browser and its versions
  BROWSERS = {firefox: '64',
              chrome: '67'}


  def setup (browser_name, browser_version)
    username = "USER_NAME"
    accessToken = "PASSWORD"
    gridUrl = "beta-hub.lambdatest.com/wd/hub"

    #Initializing Capabilities
    caps = Selenium::WebDriver::Remote::Capabilities.new
    caps[:browserName] = browser_name
    caps[:version] = browser_version
    caps[:platform] = "win10"
    caps[:name] = "LambdaTest Watir Signup Page Name verification"
    caps[:build] = "LambdaTest Watir Signup Page Name verification"
    caps[:network] = true
    caps[:visual] = true
    caps[:video] = true
    caps[:console] = true

    puts(caps)
    # URL: https://{username}:{accessToken}@beta-hub.lambdatest.com/wd/hub
    Thread.current[:&lt;a class="mentioned-user" href="https://dev.to/driver"&gt;@driver&lt;/a&gt;] = Watir::Browser.new(
        :remote,
        :url =&amp;gt; "https://" + username + ":" + accessToken + "@" + gridUrl,
        :desired_capabilities =&amp;gt; caps)
  end


  #Using Thread to achieve parallel execution
  def runthreads
    threads = []
    BROWSERS.each_pair do |browser, browser_version|
      threads &amp;lt;&amp;lt; Thread.new do
        setup(browser, browser_version)
        yield
        teardown
      end
    end
    threads.each {|thread| thread.join}
  end


  # Called after every test method runs. Can be used to tear
  # down fixture information.

  def teardown
    Thread.current[:&lt;a class="mentioned-user" href="https://dev.to/driver"&gt;@driver&lt;/a&gt;].quit
  end
end

#Test Runner
#Instantiate test method and use threads to run paralle execution
mytest = DumTest.new(self)
mytest.runthreads do
  Thread.current[:&lt;a class="mentioned-user" href="https://dev.to/driver"&gt;@driver&lt;/a&gt;].goto "https://lambdatest.com"
  Thread.current[:&lt;a class="mentioned-user" href="https://dev.to/driver"&gt;@driver&lt;/a&gt;].window.maximize
  Thread.current[:&lt;a class="mentioned-user" href="https://dev.to/driver"&gt;@driver&lt;/a&gt;].link(:text =&amp;gt; "START TESTING").click
  if "Signup - LambdaTest App | Free Cross Browser Testing Tool" == Thread.current[:&lt;a class="mentioned-user" href="https://dev.to/driver"&gt;@driver&lt;/a&gt;].title
    puts("Test is passed")
  else
    puts("Test is failed")
  end
end&lt;/pre&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage17.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage17.png" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage21.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage21.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The logic is simple, used Thread concepts to run the same set of test scripts in parallel. The thread creates dynamic based on how many browsers and its version are added in BROWSERS variable.&lt;/p&gt;

&lt;p&gt;I passed argument username, password in setup method for demo purpose but for more customization please embody multiple parameters and replace with capabilities.&lt;/p&gt;

&lt;p&gt;Well, now you have your test results look in LambdaTest Cloud platform. Please take a look on 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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage15.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2Fimage15.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kudos! We made it, with this you have successfully run your first script for cross browser automation testing using Watir at LamdaTest cloud platform.&lt;/p&gt;

&lt;p&gt;LambdaTest offers great in-depth detail for every test. If you look at the screenshot below, you will be able to notice the environment details, status, start time, end time and many more information that is automatically represented. You would also find a video log of your test session and analytics related tab alongside, timeline.&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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FImage026_test_results_.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%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F01%2FImage026_test_results_.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That was all you need to know for getting started with cross browser automation using Watir at LambdaTest to perform UI test for your website or web-app. I would be interested to know your thoughts and feedbacks on this tutorial in the comment section. I would appreciate if you have got any questions for me. Happy Testing!&lt;/p&gt;

&lt;p&gt;Original Source: &lt;a href="https://www.lambdatest.com/blog/cross-browser-automation-testing-using-watir/" rel="noopener noreferrer"&gt;lambdatest.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>automation</category>
      <category>java</category>
      <category>ruby</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
