<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nate-Grey</title>
    <description>The latest articles on DEV Community by Nate-Grey (@nategrey).</description>
    <link>https://dev.to/nategrey</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%2F363025%2F004a7947-7f3d-4ed2-b929-b20aafc62867.png</url>
      <title>DEV Community: Nate-Grey</title>
      <link>https://dev.to/nategrey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nategrey"/>
    <language>en</language>
    <item>
      <title>Updates: Github Actions, LT Browser &amp; More!</title>
      <dc:creator>Nate-Grey</dc:creator>
      <pubDate>Wed, 22 Jul 2020 12:03:41 +0000</pubDate>
      <link>https://dev.to/nategrey/updates-github-actions-lt-browser-more-43d2</link>
      <guid>https://dev.to/nategrey/updates-github-actions-lt-browser-more-43d2</guid>
      <description>&lt;p&gt;Hey Testers! I’ve got amazing news for you, we’ve come up with new features to make your life as testers a tad bit easier! And we hope, our efforts keep making testing better for you with every new feature &amp;amp; product release. At LambdaTest we believe our goal is to bring the whole testing ecosystem to the cloud for you, and we’re constantly working towards it with each release at a time.&lt;/p&gt;

&lt;p&gt;That being said, I am happy to announce to you the exciting new features and product, we’ve added in June on our &lt;a href="https://www.lambdatest.com/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-22072020&amp;amp;utm_term=Rana"&gt;cross browser testing&lt;/a&gt; platform!&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub Actions For LambdaTunnel
&lt;/h2&gt;

&lt;p&gt;First thing First! A shout out for our team for launching LambdaTest tunnel action on the GitHub marketplace. Here’s the tweet shared by our VP Engineering announcing the launch!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/Mayankbhola/status/1278959215399153666"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QjiUx0_K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yw5nb1zy2q2j28zp2rid.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our launch received a warm welcome, our efforts were appreciated by none other than Country Manager of GitHub India. Kudos to the team for a great effort!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/msupernaut/status/1278961319715065857"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z5jRb5mZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/g5ysfeb2u4ma2j4np9w6.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, moving onto the Github Action! Using our Github action for Lambda Tunnel, you can now easily test your privately or locally hosted website! All you need to do is embed the LambdaTest tunnel GitHub action into your job and you’re all set. Whenever the GitHub action is triggered, it automatically takes care of setting up the binary file. It also takes care of performing Selenium test automation using the LambdaTest tunnel.&lt;/p&gt;

&lt;p&gt;After integrating with the tunnel, you can perform local page testing on 2000+ browsers and OS using our Selenium grid. You can also test your website on mobile devices and make sure they are responsive.&lt;/p&gt;

&lt;h2&gt;
  
  
  LT Browser For Live Mobile View Debugging
&lt;/h2&gt;

&lt;p&gt;Earlier in June, we launched LT Browser, a browser for developers and designers, which help them validate their design and debug their website on various mobile viewports. With LT Browser you can perform live testing to ensure &lt;a href="https://www.lambdatest.com/lt-browser?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-22072020&amp;amp;utm_term=Rana"&gt;responsive web design&lt;/a&gt; of your website on different viewports. So far we’ve received great responses on it, you might want to check it out for yourself.&lt;/p&gt;

&lt;p&gt;These are some of the features you should not miss out on:&lt;/p&gt;

&lt;h3&gt;
  
  
  Check Responsive Design On Different Device Viewports
&lt;/h3&gt;

&lt;p&gt;You can now check the mobile view of your website in different mobile view and see how it renders on different devices.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nvp6JxGL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/pasted-image-0-46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nvp6JxGL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/pasted-image-0-46.png" alt="LT Browser"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Create Your Own Custom Device
&lt;/h3&gt;

&lt;p&gt;Now you are not restricted to the devices we offer, you can easily create your custom devices and save it for any future responsive testing efforts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4p1-NTC0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/pasted-image-0-47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4p1-NTC0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/pasted-image-0-47.png" alt="LT Browser Custom Device"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Built-In Developer Tools To Make Your Debugging Process Blazing Fast
&lt;/h3&gt;

&lt;p&gt;With LT Brower you can now perform live mobile view debugging and validate any changes on your website instantly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EEdpQVN9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/LT-Browser.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EEdpQVN9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/LT-Browser.png" alt="DevTools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  LambdaTest Integration With Airtable
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6zqqcyR3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/LambdaTest-And-Airtable.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6zqqcyR3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/LambdaTest-And-Airtable.png" alt="Integration"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For all the Airtable fans, we’ve finally come out with the integration of the popular collaboration tool. Airtable is certainly admired by many with its raw power and simplicity, with its powerful databases and interactive spreadsheets.&lt;/p&gt;

&lt;p&gt;Now you can log your bugs in Airtable whenever you are performing &lt;a href="https://www.lambdatest.com/blog/june-2020-platform-updates-github-actions-lt-browser-more/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-22072020&amp;amp;utm_term=Rana"&gt;cross browser testing&lt;/a&gt; with LambdaTest. Using this integration you can easily mark bugs on your website whenever you are performing browser compatibility testing. All you need to do is mark the bug &amp;amp; highlight the issue, a form pops up just like the one shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7ymXgL-M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Airtable.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7ymXgL-M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Airtable.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you’ve created the issue, it automatically gets logged into your bug tracker in Airtable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pNkWbL1s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Airtable-Bug-Tracker.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pNkWbL1s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Airtable-Bug-Tracker.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using this tool you can easily collaborate with your team and see the progress on the bug as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  New Browsers For Live-Testing
&lt;/h2&gt;

&lt;p&gt;We’re constantly working towards bringing in new browsers to the table, to make sure that your test coverage keeps getting better. You can now perform live browser compatibility testing on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chrome 83 &amp;amp; Chrome 84 Beta&lt;/li&gt;
&lt;li&gt;Firefox 77&lt;/li&gt;
&lt;li&gt;Test on Edge 81, Edge 83 &amp;amp; Edge 84 Beta&lt;/li&gt;
&lt;li&gt;Opera 68, Opera 69 Beta&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Test On Chrome 83 &amp;amp; Chrome 84 Beta
&lt;/h3&gt;

&lt;p&gt;With the new Chrome browser 83, HTML forms have gone through a revamp. This is something you might not want to miss, as you want to make sure that your users get a seamless experience while interacting with your user forms. Also, TLS 1.0 and TLS1.1 Protocol has been removed due to certain vulnerabilities. You can perform live cross browser testing in both on these browsers on LambdaTest.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yKO5VtiQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Test-on-Chrome-83-84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yKO5VtiQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Test-on-Chrome-83-84.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Test On Firefox 77
&lt;/h3&gt;

&lt;p&gt;Firefox is one of the widely used browsers, only after Chrome and Safari. It makes sense to include it in your test coverage for cross browser testing efforts. This is why we’ve come up with the latest firefox browser to ensure better test coverage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qfyApUKe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Test-on-Firefox-77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qfyApUKe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Test-on-Firefox-77.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Test On Edge 81, Edge 83, Edge 84 Beta
&lt;/h3&gt;

&lt;p&gt;Latest Edge browsers have seen an addition of collection feature, better mouse support in full screen. You can easily check out these features while performing cross browser testing on Edge 81, Edge 83, Edge 84 Beta.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aGWmv5wy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Test-on-Edge-81-83-84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aGWmv5wy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Test-on-Edge-81-83-84.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Test On Opera 68 &amp;amp; Opera 69 Beta
&lt;/h3&gt;

&lt;p&gt;Even though it is not as popular as other browsers, it is still being used by a considerable amount of users for their browsing activities. That’s why you should certainly test on Opera 68 &amp;amp; Opera 69 Beta.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LSBP6FYv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Test-on-Opera-68-69.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LSBP6FYv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/07/Test-on-Opera-68-69.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To know more about this update you can read our previous update on latest browser versions.&lt;/p&gt;

&lt;h2&gt;
  
  
  This Is Just The Beginning!
&lt;/h2&gt;

&lt;p&gt;Expect a lot more in the future. As we’re working towards bringing in a lot more features to our platform. I hope you liked these new additions to our rosters. Give it a spin and do share your take on them. We always appreciate good feedback or even feature requests. You can do so by reaching us on &lt;a href="mailto:support@lambdatest.com"&gt;support@lambdatest.com&lt;/a&gt; or dropping us a message on customer support!&lt;/p&gt;

&lt;p&gt;That’s all for now! More amazing features are on the way, till then, Happy Testing!!!😊&lt;/p&gt;

</description>
      <category>github</category>
      <category>responsive</category>
      <category>integration</category>
    </item>
    <item>
      <title>Introduction To Nightwatch.js For Selenium Testing</title>
      <dc:creator>Nate-Grey</dc:creator>
      <pubDate>Fri, 10 Jul 2020 09:47:42 +0000</pubDate>
      <link>https://dev.to/nategrey/introduction-to-nightwatch-js-for-selenium-testing-49gl</link>
      <guid>https://dev.to/nategrey/introduction-to-nightwatch-js-for-selenium-testing-49gl</guid>
      <description>&lt;p&gt;With massive competition in the market, every company wants to employ a faster go-to-market strategy. This puts a lot of pressure on both the development and testing teams. As not only the development cycle has to be faster, but you also need to make sure that testing efforts keep up so that the end product is of high quality. Also, as the product grows, it becomes more intricate, and the chance of outage in the code increases.&lt;/p&gt;

&lt;p&gt;This requires consistent testing efforts and running some of the test cases repeatedly. It can become quite hectic and costly, as often companies have limited resources, and they can’t afford to put them all in testing. To tackle this issue, many organizations are using &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-10072020&amp;amp;utm_term=Rana"&gt;Selenium test automation&lt;/a&gt;, to automate the testing process.&lt;/p&gt;

&lt;p&gt;A lot of agile organizations are now employing automation testing right from the beginning of their development process. Be it unit or end to end testing, they are doing everything they can to shorten the test cycle. As well as to catch potential bugs at an earlier level without repetitive testing and make development more swift. Nightwatch.js is one such javascript testing framework, which helps organisations automate their testing process.&lt;/p&gt;

&lt;p&gt;In this Nightwatch.js tutorial, I will give you an overview of Nighwatch.js with Selenium. So, let’s get started!!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Nightwatch.js?
&lt;/h2&gt;

&lt;p&gt;Nightwatch.js is an open-source, node.js powered, automated browser testing framework. It was developed in Amsterdam &amp;amp; derives its name from the famous painting ‘The Night Watch’ by Dutch 17th century artist Rembrandt van Rijn.&lt;/p&gt;

&lt;p&gt;Nightwatch.js facilitates end-to-end testing of web applications and websites, by utilizing W3C Webdriver API (also known as &lt;a href="https://www.lambdatest.com/selenium#selenium-webdriver?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-10072020&amp;amp;utm_term=Rana"&gt;Selenium Webdriver&lt;/a&gt;) as Selenium wrapper for interacting with different browsers. It helps in making the implementation of CI/CD much easier. At the same time, it can be used to perform Selenium test automation for both unit and integration tests. This popular automated browser testing framework provides several commands and assertions to perform interactions with web elements.&lt;/p&gt;

&lt;p&gt;It is, at times referred to as a Selenium Binding library only, which is entirely true as it is mostly used together with Selenium Server. But while implementing, the tester must remember that Nightwatch.js in itself, is complete as it contains a built-in CLI test runner, an extendible command and assertion library, and support for page object model.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Nightwatch.js Works?
&lt;/h2&gt;

&lt;p&gt;Nightwatch.js works by communicating with WebDrivers of different browsers, like ChromeDriver for Chrome or GeckoDriver for Firefox. It does this communication over a restful HTTP api utilizing the HTTP protocol defined by W3C WebDriver API and derived from JSONWire protocol.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3itO6A7u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/06/nightwatch-tutorial.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3itO6A7u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/06/nightwatch-tutorial.png" alt="nightwatch-tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nightwatch.js sends two requests to the WebDriver server in order to perform any browser interaction. It can be a command, an assertion or even an action on page objects of the web application.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First is to request the Selenium server to create a session with the browser and locate the desired element using the CSS or XPath selector of the object, on which action is to be performed.&lt;/li&gt;
&lt;li&gt;Second request to perform the action on the fetched web element from the previous request.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All major browsers have a categorical WebDriver implementation, called a driver, which Nightwatch.js uses behind the scenes to communicate with the browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hDHXOgwb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/06/nightwatch-tutorial-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hDHXOgwb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/06/nightwatch-tutorial-1.png" alt="nightwatch tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Makes Nightwatch.js So Popular?
&lt;/h2&gt;

&lt;p&gt;In this Nightwatch.js tutorial, so far I have explored what Nightwatch is and how it works. Now, I’ll explain some important reasons for its popularity. The advantages it provides so that while utilizing it one can make the best of the offerings that come with this Selenium test automation framework.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Built Test Runner –&lt;/strong&gt; Inbuilt command-line test runner for Selenium test automation execution with retries and implicit waits along with Grunt support.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved Test Execution –&lt;/strong&gt; Effective test case execution in many ways – parallel testing, sequential, or in groups or using tags. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clean Syntax –&lt;/strong&gt; Simple yet powerful syntax helps the tester to write more efficient and effective test cases quickly using Javascript and CSS or XPath for web element selectors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Integrity –&lt;/strong&gt; Being a complete testing framework in its own, it reduces dependencies on any third-party software and hence improves data integrity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selenium WebDriver Server –&lt;/strong&gt; Ability to manage Selenium or various WebDriver (ChromeDriver, GeckoDriver etc) servers in a dedicated child process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Continuous Integration –&lt;/strong&gt; Can be integrated with continuous build process systems like Jenkins and provides inbuilt Junit XML reporting which can assist in building and testing software continuously.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Support for cloud services –&lt;/strong&gt; Provides the ability to integrate with cloud-based testing platforms like LambdaTest and support for &lt;a href="https://www.lambdatest.com/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-10072020&amp;amp;utm_term=Rana"&gt;Cross Browser testing&lt;/a&gt; with JS and Selenium.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Page Object Model –&lt;/strong&gt; Easy to use with Page object models by supporting CSS and XPath locators making browser automation more manageable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy to scale –&lt;/strong&gt; Provides ease of scalability as per application under test by means of custom assertions and commands.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Drawbacks Of Using Nightwatch.js?
&lt;/h2&gt;

&lt;p&gt;Having perceived the reasons for tremendous popularity and all the benefits of using this automated browser testing framework, it’s hard to think of any bottlenecks associated with it. But there are a couple of drawbacks which I’ll explore in this Nightwatch.js tutorial you should look out for.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Limited framework choices for writing unit test cases, since it comes with its own testing framework and assertion library.&lt;/li&gt;
&lt;li&gt;Lesser community support in comparison to its counterparts WebdriverIO and Protractor.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrapping It Up!
&lt;/h2&gt;

&lt;p&gt;In this &lt;a href="https://www.lambdatest.com/blog/introduction-to-nightwatch-js-for-selenium-testing/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-10072020&amp;amp;utm_term=Rana"&gt;Nightwatch.js tutorial&lt;/a&gt;, I covered the basics for the automated browser testing framework. By now you are aware of what nightwatch.js is, and how it helps us with Selenium test automation. Further, I explored the features of Nightwatch.js which makes it really popular along with a couple of its drawbacks you need to look out for!&lt;/p&gt;

&lt;p&gt;I hope you found this Nightwatch.js tutorial informative, in case of any doubts or questions, do reach out to us in the comment section down below. Help us reach out to your peers by sharing this article with them on Twitter and LinkedIn or any other social media platform they use. That’s all for now.😊&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>testing</category>
      <category>selenium</category>
    </item>
    <item>
      <title>9 Key Features Of Responsive Testing</title>
      <dc:creator>Nate-Grey</dc:creator>
      <pubDate>Mon, 22 Jun 2020 09:09:53 +0000</pubDate>
      <link>https://dev.to/nategrey/9-key-features-of-responsive-testing-48bd</link>
      <guid>https://dev.to/nategrey/9-key-features-of-responsive-testing-48bd</guid>
      <description>&lt;p&gt;Nowadays, we use our mobile devices more than our desktop devices. It’s pretty convenient and with the performance of mobile devices catching up with laptops, it was about time that we would prefer them. After all, isn’t it convenient to binge on your favorite shows online just before you head to sleep or catching up on your newsfeed while you’re on commute to the office on your mobile devices?&lt;/p&gt;

&lt;p&gt;This is why as a developer, you need to make sure that your users get seamless experience on your website regardless of the device they are using. Since every mobile device might use a different viewport, you need to make sure that your website looks and perform on mobile devices as well as your desktop website. One way to make sure of this is by ensuring that your website has responsive web design and it renders perfectly on the different mobile devices. In case you’re wondering, what is a responsive web design, you can refer to our article on the topic.&lt;/p&gt;

&lt;p&gt;It can be tricky to test on so many different viewports and debug them simultaneously. That’s where LambdaTest comes in, you can test your website for responsiveness on 56+ devices and make sure that your website looks great on all of them! In this article, I’ll highlight 9 important features that will help you to do &lt;a href="https://www.lambdatest.com/blog/9-key-features-of-responsive-testing-to-try-on-lambdatest/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-22062020&amp;amp;utm_term=Rana"&gt;Responsive testing&lt;/a&gt; easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Test Locally Hosted Website
&lt;/h2&gt;

&lt;p&gt;You can now test your local website before making the website live. With LambdaTest you can test you locally or private hosted website easily by using a tunnel to connect your machines to our cloud servers with a secure shell hosting(SSH) based integration tunnel. Using our tunnels you can easily validate your website with responsive testing across 56+ mobile devices and test on these different mobile devices for responsiveness.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z111Mx-V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/responsive-testing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z111Mx-V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/responsive-testing.png" alt="responsive-testing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are two ways to configure Lambda Tunnel, you can use the command line or use our Underpass desktop application to bypass command line.&lt;/p&gt;

&lt;p&gt;In order to set up the Lambda tunnel with the command line, you’ll have to use the following syntax to configure your tunnel:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;LT --user {username} --key {access key}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can also use our Underpass desktop application to configure the tunnel without using the command line. With Underpass you can save that extra effort to connect with the command line and get started with website responsive test with just a click! All you need to do is download the app, install, enter your credentials and you can easily perform local page testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Switch To Real-Time On The Same Configuration
&lt;/h2&gt;

&lt;p&gt;This feature was actually requested by one of our users, and it has actually worked like a charm for a lot of users and helped them save their time while easily switching from responsive testing to real-time cross browser testing. A lot of time users would want to move to live sessions from responsive testing. Earlier this process at times proved to be a hassle as users would have to go again with the process of selecting browsers, OS, and their version. With this simple but effective feature, users can easily switch to live testing sessions on the same configuration&lt;/p&gt;

&lt;p&gt;This was one of many times our users have helped us to improve. For us, at LambdaTest our users are really important and any such suggestions are always welcome and we’d love to go the extra mile for you guys.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KGp_G0eu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/responsive-testing-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KGp_G0eu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/responsive-testing-1.png" alt="responsive-testing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As mentioned above, with the real-time feature, you can easily switch the session and perform live interactive testing of your website on the same configurations.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Switch Monitor Size
&lt;/h2&gt;

&lt;p&gt;With Lambdatest you can pick your monitor size( diagonal length of your screen). This feature was rolled out in order to make sure that the viewport remains with different screen sizes, and there is no discrepancy in checking responsiveness on different screen sizes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kd8wDP4G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/website-responsive-test.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kd8wDP4G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/website-responsive-test.png" alt="website responsive test"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Mark Bugs With Single Click
&lt;/h2&gt;

&lt;p&gt;Now you don’t have to worry about taking screenshots of bugs manually and uploading them to your project management tool to share it with your team. LambdaTest saves this effort by making this process much easier.&lt;/p&gt;

&lt;p&gt;You can easily mark any bugs on your website with our ‘Mark as bug’ feature. It allows you to easily capture any UI deviation on your website and share it directly with your team. With our in-built image editor, you can easily highlight any UI deviation by using different shapes, text, and crayons in different colors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1QnF4-KY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/mobile-website-test.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1QnF4-KY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/mobile-website-test.png" alt="mobile website test"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After marking the bug you can easily share it with your team on your favorite project management tool. We offer integrations to various third-party tools such as Asana, Jira, Trello, etc. You can view all the integrations we offer here, in case we’re missing out on your tool do reach out to us and we’d make sure that we get it onboard for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Enable Smart Scroll
&lt;/h2&gt;

&lt;p&gt;In certain cases, your pages might have some iframes and they have scrolls. What happens when we perform responsive testing then? Well, in such cases you’d have to scroll through every iframe, and scrolling through each one can prove to be such a hassle. So, how do you fix it? This issue can be easily fixed by turning on the smart scroll. This would ignore any scroll in the iframe and you wouldn’t have to spend eternity just scrolling down the page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X5FCGTqN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Responsive-testing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X5FCGTqN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Responsive-testing.png" alt="Responsive testing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Basic Authentication For Password Protected Websites?
&lt;/h2&gt;

&lt;p&gt;There might be certain pages which are password protected and you need to get through them to test. So what do you do in such situations?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yHs9NB81--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Basic-Authentication.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yHs9NB81--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Basic-Authentication.png" alt="Basic Authentication"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ve got nothing to worry about as LambdaTest has a feature addressing the issue. With our ‘Basic Authentication’ feature, you can enter your login details, click on save and you’re good to go.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gDAB_LO9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/mobile-website-test-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gDAB_LO9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/mobile-website-test-1.png" alt="mobile website-test"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you’ve clicked on ‘Save’, you’d notice that basic authentication is enabled and now you can run website responsive test on your password-protected website or web applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Debug Your Website
&lt;/h2&gt;

&lt;p&gt;You can now debug your websites with the new add-in functionality of &lt;a href="https://www.lambdatest.com/lt-browser?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-22062020&amp;amp;utm_term=Rana"&gt;LT Brower&lt;/a&gt;. You just need to click on the debug icon and it’ll take you to the LT Browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VTOToRmM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/responsive-testingg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VTOToRmM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/responsive-testingg.png" alt="responsive-testingg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With LT Browser you can easily perform mobile website test and debug with the inbuilt chrome dev tools. You can test a website on different devices in side by side view and debug using separate dev tools for both the devices simultaneously.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. How to Create Projects
&lt;/h2&gt;

&lt;p&gt;You can now create different Projects and their different versions with LambdaTest. These project can also be viewed in the project tab to keep a tab on your website responsive test&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GEAXydfY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GEAXydfY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-3.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  9. How To View The Website On Landscape Mode?
&lt;/h2&gt;

&lt;p&gt;You can also test your website both on landscape and portrait mode. All you have to do is click on the rotate button marked below and you can ensure that your website is also responsive on the landscape mode as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6qK1fy_q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Website-On-Landscape-Mode.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6qK1fy_q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Website-On-Landscape-Mode.png" alt="Website On Landscape Mode"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s a lot more than that you can do with responsive testing with LambdaTest. You can also set ‘ &lt;strong&gt;defer time&lt;/strong&gt; ’ for the website to load on different devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Step: Using LT Browser for Responsive Testing
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0GB-yi0Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/LT-Browser-for-Responsive-Testing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0GB-yi0Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/LT-Browser-for-Responsive-Testing.png" alt="LT Browser for Responsive Testing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At LambdaTest, we’ve come with a tool to make &lt;a href="https://www.lambdatest.com/lt-browser?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-22062020&amp;amp;utm_term=Rana"&gt;website responsive test&lt;/a&gt; easier for you. With LT Browser you can check the mobile view of the website on 25+ devices. With different iOS and Android devices to choose from you can check your website for responsiveness. You can also create custom devices to test on a viewport of your choice, with different device sizes and resolutions to choose from, no device is out of your reach.&lt;/p&gt;

&lt;p&gt;Now you can do mobile website test and compare different devices simultaneously, now you can test on android phone and iPad simultaneously with LT Browser. Use chrome dev tools in LT Browsers to debug on the devices simultaneously as well. The major advantage of using LT Browser is that it is blazing fast in comparison to any cloud-based application.&lt;/p&gt;

&lt;p&gt;Apart from these features, the LT Browser also has the option of integrating your favorite bug management tool to collaborate with your team. You can easily take screenshots of your webpage and even record different sections as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping It Up!
&lt;/h2&gt;

&lt;p&gt;Responsive testing is becoming more important every day as the number of mobile users keeps on increasing. You need to ensure that your website renders on all the viewports seamlessly. In this article, I explored different features you can use with LambdaTest to perform responsive testing. These features help you to test your local website, mark bugs, test for a password-protected website. Further, I went through how you could utilize LT Browser for mobile website test.&lt;/p&gt;

&lt;p&gt;If there any feature you feel that should be a part of LambdaTest for responsive testing, do let us know in the comment section down below. We’re always open to suggestions and would love to add any new features that would help our users along the way. &lt;strong&gt;Happy Testing!!!&lt;/strong&gt; 😃&lt;/p&gt;

</description>
      <category>responsive</category>
      <category>mobiletesting</category>
      <category>webdev</category>
      <category>ux</category>
    </item>
    <item>
      <title>Maven Tutorial For Selenium Test Automation</title>
      <dc:creator>Nate-Grey</dc:creator>
      <pubDate>Mon, 15 Jun 2020 09:34:15 +0000</pubDate>
      <link>https://dev.to/nategrey/maven-tutorial-for-selenium-test-automation-5hjj</link>
      <guid>https://dev.to/nategrey/maven-tutorial-for-selenium-test-automation-5hjj</guid>
      <description>&lt;p&gt;While working on a project for test automation, you’d require all the Selenium dependencies associated with it. Usually these dependencies are downloaded and upgraded manually throughout the project lifecycle, but as the project gets bigger, managing dependencies can be quite challenging. This is why you need build automation tools such as Maven to handle them automatically.&lt;/p&gt;

&lt;p&gt;Maven can be more specifically defined as a software project management tool which uses the concepts of project object model (POM). It enables the user to create initial folder structure, perform compilation and testing and then package and deploy the final product. It efficiently cuts down several steps followed in the build process and rather makes the build a one step process.&lt;/p&gt;

&lt;p&gt;In this &lt;a href="https://www.lambdatest.com/blog/getting-started-with-maven-for-selenium-testing/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-15062020&amp;amp;utm_term=Rana"&gt;Selenium Maven tutorial&lt;/a&gt;, I’ll explain what Maven is and why Maven is important as a build automation tool. Further, I’ll show you how to install Maven for your Selenium test automation projects and running your first project in this Selenium Maven tutorial.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use Maven?
&lt;/h2&gt;

&lt;p&gt;Maven plays a crucial role in managing a project lifecycle, which typically includes validation, code generation, compilation, testing, packaging and much more. It is a software build tool that works in phases rather than tasks(as in the case of Ant). It is basically used to manage the life cycle of a project. Maven makes the build management process much easier, as you’ll only need to specify the dependencies in the pom.xml files and Maven will take care of the rest!&lt;/p&gt;

&lt;p&gt;Some of the key reasons Maven is used are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It simplifies the build process &amp;amp; provides a uniform system &lt;/li&gt;
&lt;li&gt;It handles compilation, distribution, dependency management and other tasks efficiently.&lt;/li&gt;
&lt;li&gt;It increases reusability.&lt;/li&gt;
&lt;li&gt;It reduces the steps like adding jar files to the project library, building reports, executing Junit test cases, creating jar/war/ear files for deployment.&lt;/li&gt;
&lt;li&gt;It has a repository that is centralized that manages jar files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we know why to use Maven, let’s explore a bigger question in this Selenium Maven tutorial, What is Maven?&lt;/p&gt;

&lt;h2&gt;
  
  
  So What Is Maven? Let’s Deep Dive
&lt;/h2&gt;

&lt;p&gt;By now, you already have the idea that &lt;a href="https://maven.apache.org/"&gt;Maven&lt;/a&gt; is a build automation tool that is used to manage the project dependency and the whole project lifecycle. Maven is built by Apache Software Foundation and is used majorly for Java projects. It was initially developed to make the build process of the Jakarta Turbine Project much simpler and is now widely used to make build processes easy and uniform.&lt;/p&gt;

&lt;p&gt;Maven can be more specifically defined as a software project management tool that uses the concepts of the project object model (POM). It enables the user to create an initial folder structure, perform compilation and testing and then package and deploy the final product. It efficiently cuts down several steps followed in the build process and rather makes the build a one-step process.&lt;/p&gt;

&lt;p&gt;Some key terms you should know for this Selenium Maven tutorial:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maven Local repository:&lt;/strong&gt; It is a local repository in the developer’s machine which holds all the project artifacts. On executing a Maven build, all the project dependent jars are downloaded into the local repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maven Central Repository:&lt;/strong&gt; It is a default repository in every new project which is official to Maven. Whenever any dependency is not present in local repository Maven automatically consults the central repository to download it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project Object Model:&lt;/strong&gt; POM XML contains project information and configuration details used by Maven build. It is located in the root directory of each project. A sample POM looks like below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eHhkWcE8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Tutorial.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eHhkWcE8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Tutorial.png" alt="Selenium Maven Tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dependency:&lt;/strong&gt; Any library on which a java project is dependent on, to run or build is called a dependency. Examples: Log4j jars, Apache Poi jars, Selenium Jars, etc. Dependencies are mentioned in pom.xml as below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kS8cXH8d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kS8cXH8d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-1.png" alt="selenium test automation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Surefire PlugIn:&lt;/strong&gt; To execute the unit tests of an application during the test phase of the build lifecycle one can use the Surefire Plugin. A surefire report is available in two file formats, viz Plain text file(.txt) and XML file(.xml). This plugin is a must to use as it helps Maven identify tests even when using TestNG or Junit frameworks.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Install Maven In Windows?
&lt;/h2&gt;

&lt;p&gt;Maven can be installed either through Command-Line or with Eclipse IDE. We’ll first go by the steps on how to install it through Eclipse IDE.&lt;/p&gt;

&lt;h3&gt;
  
  
  How To Install Maven in Eclipse IDE?
&lt;/h3&gt;

&lt;p&gt;Installing Maven in Eclipse is pretty straightforward, here are the steps involved:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: &lt;/strong&gt; Click on Help from the top menu in Eclipse and select ‘Install New Software’.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: &lt;/strong&gt; On the newly opened window, click on the Add button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fHv6RbM---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Dependency.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fHv6RbM---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Dependency.png" alt="Selenium Maven Dependency"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: &lt;/strong&gt; In the name text box type “Maven”, and in the location text box type “&lt;a href="http://download.eclipse.org/technology/m2e/releases/%E2%80%9D"&gt;http://download.eclipse.org/technology/m2e/releases/”&lt;/a&gt;. This URL is the location from where Maven can be downloaded.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HhIgsC6o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/add-repository-maven.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HhIgsC6o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/add-repository-maven.png" alt="add-repository-maven"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: &lt;/strong&gt; A check-box will appear in the pop window, Check the check-box and click on the Next button.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: &lt;/strong&gt; Wait for a few minutes for the window to complete its process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: &lt;/strong&gt; Keep the default settings and click on the Next button.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7: &lt;/strong&gt; Accept the Terms &amp;amp; Conditions and click on Finish.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8: &lt;/strong&gt; Wait for the installation to finish.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 9: &lt;/strong&gt; Once the installation is finished, it will ask you to restart your eclipse. Click on Yes so as to see the changes being reflected.&lt;/p&gt;

&lt;p&gt;Boom! This is it. You’ve now installed Maven successfully to your Eclipse IDE.&lt;/p&gt;

&lt;p&gt;Just in case you want to go around the other way of installing through the command line, please follow the below steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  How To Install Maven Through Command Line?
&lt;/h3&gt;

&lt;p&gt;Here are the steps to install Maven through command line in this Selenium Maven tutorial:&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Step 1:  Download &amp;amp; Install Java&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;You need to install Java in your system, if not already done. The latest version of java can be downloaded from this link&lt;/p&gt;

&lt;p&gt;To check the java version of your system, please go running and type ‘cmd’ to launch the command prompt. Type ‘Java -version’ and press Enter to see which java version is installed.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Step 2:  Set Up Java Environment Variable&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;After installation of Java, set up the Java Environment Variable. Open the system settings to set the Java Environment Variable.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to This PC and right-click on the empty space anywhere within and select Properties&lt;/li&gt;
&lt;li&gt;Click on Advanced System Settings so that a new pop up opens up.&lt;/li&gt;
&lt;li&gt;Now, from the pop-up window click on Environment Variables &lt;/li&gt;
&lt;li&gt;Click on the New button under System variables.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aRLaYpqn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/elenium-Maven-Tutorial.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aRLaYpqn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/elenium-Maven-Tutorial.png" alt="Selenium Maven Tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Type “JAVA_HOME” in the Variable name box and ‘C:\Program Files\Java\jdk1.8.0_20’ JDK path in the Variable value box and save the same.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sSlfBt1K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/java-file.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sSlfBt1K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/java-file.png" alt="java-file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can now see the newly created Java variable under ‘System Variables’&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TO_WsWTu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TO_WsWTu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-2.png" alt="Selenium Test Automation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Step 3:  Download Maven and Set Up Maven Environment Variable&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Maven can be downloaded from below location:
&lt;a href="https://Maven.apache.org/download.cgi"&gt;https://Maven.apache.org/download.cgi&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vfhtlGsL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-file.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vfhtlGsL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-file.png" alt="maven-file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Extract it to some location in your machine as per your convenience. For me it is lying at ‘C:/apache-Maven-3.6.1’&lt;/li&gt;
&lt;li&gt;You can set up the Maven Environment Variable similar to how we set up the Java Environment Variable in steps above.&lt;/li&gt;
&lt;li&gt;Type ‘Maven_HOME‘ in the Variable name box and ‘C:\apache-Maven-3.6.1’ in the Variable value box.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uHH_PIB5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-automation.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uHH_PIB5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-automation.png" alt="selenium-automation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You’ll now be able to see the newly created Maven variable under ‘System Variables’.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lQ1gP2xd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-tutorial.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lQ1gP2xd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-tutorial.png" alt="maven-tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Step 4: Updating the Path Variable&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;In order to run Maven from the command line, we have to necessarily update the Path Variable with Maven’s installation ‘bin’ directory.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open system properties through My Computer.&lt;/li&gt;
&lt;li&gt;Navigate to ‘Advanced System Settings’.&lt;/li&gt;
&lt;li&gt;Click on ‘Environment Variables’.&lt;/li&gt;
&lt;li&gt;Click on the Edit button under user variables.&lt;/li&gt;
&lt;li&gt;Type ‘PATH’ in the Variable name box &amp;amp; ‘C:\apache-Maven-3.6.1\bin’ in the Variable value box.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jyWr6NwL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Tutorial-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jyWr6NwL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Tutorial-1.png" alt="Selenium-Maven-Tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Step 5: Testing the Maven Installation&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Maven is now successfully installed in your system. Now let’s verify it from the Windows command line. Open command prompt and type mvn -version and hit Enter. Check to see the version of Maven installed in your system being displayed in the results.&lt;/p&gt;

&lt;p&gt;Now you’re all set with Maven Installation now and can go ahead with creating projects using Maven.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create your First Maven Project
&lt;/h2&gt;

&lt;p&gt;Just like the Maven installation we discussed earlier in the Selenium Maven tutorial, you can also create a Maven project either through Eclipse IDE or through Command Line.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Maven Project with Eclipse IDE
&lt;/h3&gt;

&lt;p&gt;Below are the steps to create a Maven Project with Eclipse IDE:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: &lt;/strong&gt; Create a new project from the Eclipse IDE.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: &lt;/strong&gt; From the new project window expand Maven and select Maven Project and then click on Next.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: &lt;/strong&gt; You may create a simple project or just let go of this option. For now, we’ll use a simple project which would create a simple Maven-enabled Java project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mv_83zQM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-java-project.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mv_83zQM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-java-project.png" alt="maven-java-project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: &lt;/strong&gt; Now upon clicking Next you’ll need to type information of the Maven project is created. You may refer below descriptions to fill in the values:&lt;/p&gt;

&lt;p&gt;Group Id- corresponds to your organization’s name.&lt;br&gt;&lt;br&gt;
Artifact Id- refers to the project name.&lt;/p&gt;

&lt;p&gt;The version can be chosen flexibly. If your project does not have any parent dependencies, you don’t need to fill in the project dependencies. Just fill in the appropriate information and click on ‘Finish’.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NdE0eIl5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-tutorial-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NdE0eIl5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-tutorial-1.png" alt="maven-tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: &lt;/strong&gt; Your Maven project has now been created!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--McsZ6Dub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-maven.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--McsZ6Dub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-maven.png" alt="selenium-maven"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Java code is placed in /src/main/java, resources are kept in /src/main/resources, testing code is placed in /src/test/java and the testing resources are placed in /src/test/resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: &lt;/strong&gt; You may now open the pom.xml to view the structure set up by Maven. You’ll see all the information that we entered in ‘step 4’ here. You can use the tabs at the bottom to change the view. The pom.xml tab has the pom XML code for the Maven project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NZJREhkR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/getting-started-with-maven.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NZJREhkR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/getting-started-with-maven.png" alt="getting-started-with-maven"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RunGfvDS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-tutorials.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RunGfvDS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-tutorials.png" alt="maven-tutorials"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Maven Project is now ready to be used.&lt;/p&gt;

&lt;p&gt;Next, let us see how we can create a Maven project using Command-Line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: &lt;/strong&gt; Open a Command Prompt and navigate to the folder where you want to set up your project. Once navigated, type below command:&lt;/p&gt;

&lt;p&gt;mvn archetype:generate -DgroupId=demoProject -DartifactId=DemoMavenProject -DarchetypeArtifactId=Maven-archetype-quickstart -DinteractiveMode=false&lt;/p&gt;

&lt;p&gt;Here, DgroupId is the organization name, DartifactId is the project name and DarchetypeArtifactId is the type of Maven project.&lt;/p&gt;

&lt;p&gt;On clicking Enter, your Maven project will be created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OMdeckBi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-java-code.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OMdeckBi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-java-code.png" alt="maven-java-code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: &lt;/strong&gt; You can go to the project location to see the newly created Maven project. You can open the pom.xml file, which is in the project folder, by default the POM is generated like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OtvGW5ge--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Tutorial-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OtvGW5ge--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Tutorial-2.png" alt="Selenium Maven Tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: &lt;/strong&gt; You can view the default folder structure of your Maven project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KJHllz8q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KJHllz8q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-5.png" alt="maven-file-save"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we know how to create a Maven project, let’s try to integrate Selenium with Maven. But before we do that, we need to understand the various Dependencies that would help with this integration.&lt;/p&gt;
&lt;h2&gt;
  
  
  Selenium Maven Dependency For Your Automation Project
&lt;/h2&gt;

&lt;p&gt;All the external libraries that are used in a project are called dependencies. Maven has an excellent feature that automatically downloads required libraries from its central repository, which makes it easy as you don’t have to store them locally. Below is an example of writing a Selenium Maven dependency in your pom.xml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;dependency&amp;gt;
         &amp;lt;groupId&amp;gt;org.Seleniumhq.Selenium&amp;lt;/groupId&amp;gt;
         &amp;lt;artifactId&amp;gt;Selenium-java&amp;lt;/artifactId&amp;gt;
         &amp;lt;version&amp;gt;4.0.0-alpha-1&amp;lt;/version&amp;gt;
     &amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;On adding the above Selenium Maven dependency, Maven will download the Selenium java library into our local Maven repository.&lt;/p&gt;

&lt;p&gt;There is another Selenium Maven dependency that can be added to pom.xml based on the requirement. Few examples that you might have to use in our Selenium project are :&lt;/p&gt;

&lt;h3&gt;
  
  
  TestNG Selenium Maven Dependency:
&lt;/h3&gt;

&lt;p&gt;This would import the testing framework dependency for Java.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;org.testng&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;testng&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;6.14.3&amp;lt;/version&amp;gt;
    &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;       
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Apache POI Selenium Maven dependency:
&lt;/h3&gt;

&lt;p&gt;This would download the libraries required to access Microsoft format files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;org.apache.poi&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;poi&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;3.17&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;

&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;org.apache.poi&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;poi-ooxml&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;3.17&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can add these Selenium Maven dependencies in your pom.xml as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;project xmlns="http://Maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://Maven.apache.org/POM/4.0.0 http://Maven.apache.org/xsd/Maven-4.0.0.xsd"&amp;gt;
    &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;
    &amp;lt;groupId&amp;gt;organisationName&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;myDemoProject&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;0.0.1-SNAPSHOT&amp;lt;/version&amp;gt;

    &amp;lt;dependencies&amp;gt;

     &amp;lt;dependency&amp;gt;
         &amp;lt;groupId&amp;gt;org.Seleniumhq.Selenium&amp;lt;/groupId&amp;gt;
         &amp;lt;artifactId&amp;gt;Selenium-java&amp;lt;/artifactId&amp;gt;
         &amp;lt;version&amp;gt;4.0.0-alpha-1&amp;lt;/version&amp;gt;
     &amp;lt;/dependency&amp;gt;

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

    &amp;lt;/dependencies&amp;gt;


&amp;lt;/project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In case you want to validate how these Selenium Maven dependency import the required libraries, you’ll have to go back to the demo project and see what libraries are present by default. For doing the same you need to right-click on your project name and Configure the Build Path for you project and check under the Libraries tab of the newly opened window:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VNPNIhLw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-java-tutorial.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VNPNIhLw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-java-tutorial.png" alt="maven-java-tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here you can see the default libraries present in your project for this Selenium Maven tutorial.&lt;/p&gt;

&lt;p&gt;For a much clearer vision, I’ll create a sample class to use Selenium components and some testNG annotations. Please note that I’ll create the sample test class under the src/test/java folder of our project structure. You can clearly see below that the error correction can be done after adding the libraries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kuJdd1s8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Dependency-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kuJdd1s8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Dependency-1.png" alt="Selenium Maven Dependency"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, now rather than manually adding libraries by configuring the project build path in this Selenium Maven tutorial, I’ll write the dependencies for the project in pom.xml, and Maven will directly download those from its repository. This saves the trouble of doing it manually and reducing the chance of missing out on adding some of the jars. So, here is how you add the dependencies:&lt;/p&gt;

&lt;p&gt;The pom.xml before the Selenium Maven dependency is added:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rOzQf1uI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rOzQf1uI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-6.png" alt="Selenium Maven Dependency"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pom.xml after the Selenium Maven dependency is added:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EJgNIqiq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EJgNIqiq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-3.png" alt="selenium test automation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you have saved and refreshed your project, check the build path and see the Selenium and testNG libraries being added Selenium Maven dependency.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qtwapSlD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-MavenDependency.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qtwapSlD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-MavenDependency.png" alt="Selenium MavenDependency"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, you can now go to your test class and see the different options to correct the error thrown in this Selenium Maven tutorial:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3UAOH8uL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/demo-project-maven.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3UAOH8uL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/demo-project-maven.png" alt="demo-project-maven"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can simply Import the WebDriver and you’d be good to go. Similarly for &lt;a class="comment-mentioned-user" href="https://dev.to/test"&gt;@test&lt;/a&gt;
 annotation just import the testng.annotations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h6HwR5GT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h6HwR5GT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-7.png" alt="maven-tutorials"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can add more dependencies like apache POI, extent reporting, commons email, or anything that might be specific to your project in a similar fashion to your pom.xml.&lt;/p&gt;

&lt;p&gt;Now that I am done with configuring the project, I’ll run the project to see if the tests work fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maven Lifecycle In Selenium
&lt;/h2&gt;

&lt;p&gt;There is a maven lifecycle in Selenium that every Maven build follows. The different methods are simply goals. Before going ahead I’ll explain what these goals are.&lt;/p&gt;

&lt;p&gt;Open a command line in your system and type mvn and then Enter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W_XQu9wV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Tutorial-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W_XQu9wV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Tutorial-3.png" alt="Selenium Maven Tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see a Build failure message with error being displayed saying that no goal has been defined in this Selenium Maven tutorial. As you parse through this message you can see the different goals that can be defined for our Maven project. I’ll quickly go through these default goals before going into detail about the goals required for the Selenium project.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;validate: would check if our project is correct and all the required information available&lt;/li&gt;
&lt;li&gt;compile: would compile the project source code&lt;/li&gt;
&lt;li&gt;test: would unit test the compiled source code of our project&lt;/li&gt;
&lt;li&gt;package: would package the compiled code into the distributable formats, like JAR&lt;/li&gt;
&lt;li&gt;integration-test: would deploy the package into an environment where we would run the integration tests&lt;/li&gt;
&lt;li&gt;verify: would verify if the package is valid&lt;/li&gt;
&lt;li&gt;install: would locally install the package&lt;/li&gt;
&lt;li&gt;deploy: would be used in integration or release environment by copying the final project into a remote repository where it can be accessed by other projects or developers&lt;/li&gt;
&lt;li&gt;clean: cleans up previous build artifacts&lt;/li&gt;
&lt;li&gt;site: creates site documentation for the project&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Of the above-said default goals, three are crucial for Selenium test automation. There are clean, install, and tests.&lt;/p&gt;

&lt;p&gt;You can either use these goals alone or use it as a combination like clean-install for this Selenium Maven tutorial.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clean-&lt;/strong&gt; It would clean the target folder, i.e. the folder where the previous build’s libraries, build files(war, tar or jar files), reports, output files, etc are saved. On executing mvn -clean this target folder will be deleted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install-&lt;/strong&gt; It would install all the dependencies, in case of missing jars, and create the deployment file(war/jar files in case of JAVA) and then it’ll run the test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test-&lt;/strong&gt; It will simply run the test without creating any deployment file.&lt;/p&gt;

&lt;p&gt;When using Eclipse IDE, you can directly use any of these three goals by right-clicking on your pom.xml, then Run As and selecting any of the options.&lt;/p&gt;

&lt;h3&gt;
  
  
  Maven Clean
&lt;/h3&gt;

&lt;p&gt;I’ll start with selecting Maven &lt;strong&gt;clean&lt;/strong&gt; in this Selenium Maven tutorial, you can see the output below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5RqB1A6W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5RqB1A6W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven.png" alt="maven"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So here the task of clean, which is to delete the target folder has been successfully completed and hence our Build is successful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Maven Install
&lt;/h3&gt;

&lt;p&gt;Before going to the second task of &lt;strong&gt;install&lt;/strong&gt; , you need to add a plugin called Maven Compiler plugin.Without it the &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-15062020&amp;amp;utm_term=Rana"&gt;Selenium test automation&lt;/a&gt; build will fail. This plugin is used to identify the specific location of the compiler. You can just add the below plugin in your pom.xml and refresh the project before executing Maven install.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;build&amp;gt;
   &amp;lt;plugins&amp;gt;
        &amp;lt;plugin&amp;gt;
    &amp;lt;groupId&amp;gt;org.apache.Maven.plugins&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;Maven-compiler-plugin&amp;lt;/artifactId&amp;gt;
    &amp;lt;configuration&amp;gt;
        &amp;lt;compilerVersion&amp;gt;1.5&amp;lt;/compilerVersion&amp;gt;
        &amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;
        &amp;lt;target&amp;gt;1.5&amp;lt;/target&amp;gt;
    &amp;lt;/configuration&amp;gt;
    &amp;lt;/plugin&amp;gt;
    &amp;lt;/plugins&amp;gt;
  &amp;lt;/build&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Upon adding this piece, your pom.xml would look like below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y-hMjTL8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/SeleniumMaven-Dependency.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y-hMjTL8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/SeleniumMaven-Dependency.png" alt="SeleniumMaven Dependency"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, go to Maven Install just like you did for Maven Clean in this Selenium Maven tutorial and observe the console output for the build installation:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i8hBBQ38--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i8hBBQ38--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-4.png" alt="selenium test automation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--luNV_3Qi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--luNV_3Qi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-5.png" alt="selenium test automation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3TzWnq1r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3TzWnq1r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-8.png" alt="test automation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see in the console output that the Maven installer executed the tests as well. To see the installed directories in your local system you refresh your project and see the directories generated. In the below snapshot you can see all the files generated(a jar file as well since this is a simple JAVA program) as a result of Maven install. You can share this jar file directly for others to execute.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--68Ergz11--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-selenium-tutorial.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--68Ergz11--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-selenium-tutorial.png" alt="maven-selenium-tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Maven Test
&lt;/h3&gt;

&lt;p&gt;Similarly, we can do &lt;strong&gt;Maven Test&lt;/strong&gt; in this Selenium Maven tutorial and see the build results in the console:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5BVUxnoA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-tests.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5BVUxnoA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-tests.png" alt="maven-tests"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above steps show how execution can be done through Eclipse IDE, but in real-time project execution is done mostly through the command line So now we would use these goals from the command line. Before proceeding onto these tasks make sure that your current working directory in cmd points to your local workspace location. If we do not do so our Maven command would not be able to find the desired pom.xml and hence our Selenium test automation build would fail.&lt;/p&gt;

&lt;p&gt;Let us first do the Maven Clean using the command prompt in this Selenium Maven tutorial. We simply need to write ‘mvn clean’:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--12UbIUZW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-test-script.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--12UbIUZW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-test-script.png" alt="maven-test-script"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see the target folder getting deleted. The next step in this Selenium Maven tutorial is to do Maven install which is done by typing ‘mvn install’ in the command prompt.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lxb8kW2L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lxb8kW2L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-9.png" alt="Selenium Maven Tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JpsMSUN7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JpsMSUN7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-10.png" alt="Selenium Maven Tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--caLDw3Oy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--caLDw3Oy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-11.png" alt="Selenium Maven Tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see the console output is almost similar to what was there through Eclipse execution. Let us now perform a Maven test by typing ‘mvn test’ which would result in the test being executed without building jar files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bgk1wkel--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bgk1wkel--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/selenium-test-automation-6.png" alt="selenium-test-automation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that you know the basic goals for executing our automation test you’re good to go to run your automation scripts through Maven!&lt;/p&gt;

&lt;h2&gt;
  
  
  Maven Surefire Plugin
&lt;/h2&gt;

&lt;p&gt;By now you have read this term in this Selenium Maven tutorial quite some time in your console output logs, so I’ll shed some light on it. The surefire plugin helps Maven to identify the tests and is used with whichever framework your project is built on. To add Surefire plugin to your pom.xml use below code snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&amp;lt;properties&amp;gt;
&amp;lt;suiteXmlFile&amp;gt;src/main/resources/testng.xml&amp;lt;/suiteXmlFile&amp;gt;
&amp;lt;/properties&amp;gt;


&amp;lt;build&amp;gt;
&amp;lt;plugin&amp;gt;
&amp;lt;groupId&amp;gt;org.apache.Maven.plugins&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;Maven-surefire-plugin&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.17&amp;lt;/version&amp;gt;
&amp;lt;configuration&amp;gt;
&amp;lt;suiteXmlFiles&amp;gt;
&amp;lt;suiteXmlFile&amp;gt;${suiteXmlFile}&amp;lt;/suiteXmlFile&amp;gt;
&amp;lt;/suiteXmlFiles&amp;gt;
&amp;lt;/configuration&amp;gt;
&amp;lt;/plugin&amp;gt;
&amp;lt;/build&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Your pom.xml should look like below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0ixSHVM6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-tutorialss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0ixSHVM6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/maven-tutorialss.png" alt="maven-tutorialss"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here I’ve put in testng.xml in src/main/resources and thereby giving its path in properties.&lt;/p&gt;

&lt;p&gt;Now I’ll run Maven test from eclipse in this Selenium Maven tutorial and see the results:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EtQXTQEz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Tutorial-4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EtQXTQEz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/Selenium-Maven-Tutorial-4.png" alt="Selenium Maven Tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now check the reports that have been generated by default and in a similar way by typing ‘mvn test’ can execute this suite from the command prompt.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qDzbqUqO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-12.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qDzbqUqO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/05/pasted-image-0-12.png" alt="maven file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  All In All
&lt;/h2&gt;

&lt;p&gt;In this Selenium Maven tutorial, I explored how Maven as a build automation tool can make managing Selenium Maven dependency better for your project. With Maven you wouldn’t have to worry about installing and upgrading your project libraries as they are done automatically with the tool. Now you know how to install Maven in your systems with both Eclipse IDE and with the command line. I also explained how to create a Maven project in eclipse. Also, I went through the Maven lifecycle, the goals used, and then I ran the Maven project.&lt;/p&gt;

&lt;p&gt;This pretty much sums up everything you need to know to get started with Maven in this Selenium Maven tutorial. Do reach out to us in case of any questions or doubts. Also, I’d appreciate it if you could help us share this article and retweet it. That’s all for now. &lt;strong&gt;Happy Testing!!!&lt;/strong&gt; 😊&lt;/p&gt;

</description>
      <category>java</category>
      <category>selenium</category>
      <category>maven</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>7 Effective Tips For Every Remote Testing Team</title>
      <dc:creator>Nate-Grey</dc:creator>
      <pubDate>Tue, 02 Jun 2020 07:53:20 +0000</pubDate>
      <link>https://dev.to/nategrey/7-effective-tips-for-every-remote-testing-team-5c5b</link>
      <guid>https://dev.to/nategrey/7-effective-tips-for-every-remote-testing-team-5c5b</guid>
      <description>&lt;p&gt;You’ve got a finicky toddler who won’t eat breakfast, a spouse or partner loudly watching Netflix in the living room, and a dog that’s begging for an extra play session. Oh, did we mention your conference call is scheduled to start in five minutes?&lt;/p&gt;

&lt;p&gt;So many distractions abound as most of us work from home during the COVID-19 pandemic. There are the above-mentioned family ones, social media, and what’s amounting to an endless stream of news.&lt;/p&gt;

&lt;p&gt;You don’t want to stop pulling your weight as part of your company, but you’re admittedly having a hard time staying focused and productive. What can you do to change that? Here are the top 7 productivity tips for remote testing teams.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Real-Time Collaboration With Instant Messaging Tools
&lt;/h2&gt;

&lt;p&gt;We’re all cooped up at home right now, which makes it easy to feel like our world is so small. For your mental health as well as your productivity, you need to be in regular communication with your colleagues and your boss/manager.&lt;/p&gt;

&lt;p&gt;Instead of sending emails back and forth, you can leverage an instant messaging tool like &lt;a href="https://slack.com/intl/en-in/"&gt;Slack&lt;/a&gt;, Microsoft Teams. &lt;a href="https://hangouts.google.com/"&gt;Google Hangouts&lt;/a&gt; has communications through video or text while &lt;a href="https://www.chanty.com/"&gt;Chanty&lt;/a&gt; is a team chat that uses AI. You don’t even have to pay for unlimited, secure messaging with Chanty, which is nice for companies trying to save a few bucks.&lt;/p&gt;

&lt;p&gt;Sure, your living room or bedroom might be your office right now, but you’ll feel like you’re getting more done when you can collaborate with your colleagues in real-time and work together as a unit with your remote testing team.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Video Conferencing &amp;amp; Online Meetings Can Help You Go A Long Way
&lt;/h2&gt;

&lt;p&gt;Do you remember the days when you and another colleague or two would sit in a conference room for the afternoon and get down to business on a project? You can’t do that anymore, well, at least not physically.&lt;/p&gt;

&lt;p&gt;Fortunately, there is a whole slew of video conferencing &amp;amp; online meeting web-apps that lets you and your remote testing team engage in video conferences &amp;amp; online meetings. I am referring to tools like &lt;a href="https://meet.google.com/"&gt;Google Meet&lt;/a&gt;, &lt;a href="https://zoom.us/"&gt;Zoom&lt;/a&gt;, and &lt;a href="https://www.skype.com/en/features/group-video-chat/"&gt;Skype&lt;/a&gt;. You and your team can host virtual meetings, share your screen, and even record the meeting to go back and review it later.&lt;/p&gt;

&lt;p&gt;Having a reason to wear something besides pajamas or sweats is always nice, as is being in closer touch with your coworkers. Plus, dressing for success may change your mindset and get you more in the mood to work.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Project Management Keeps Everyone On-Task
&lt;/h2&gt;

&lt;p&gt;Probably one of the biggest obstacles for IT companies is around individual effort tracking. Who is doing what? And how fast are they doing it? The QA managers and project leaders don’t have the flexibility to sit around the team for getting things done and they can’t possibly keep a track on their employees for the majority of the time while working from home.&lt;/p&gt;

&lt;p&gt;Thankfully, we’ve got project management tools like &lt;a href="https://proofhub.com/"&gt;ProofHub&lt;/a&gt;, &lt;a href="https://asana.com/"&gt;asana&lt;/a&gt;, &lt;a href="https://trello.com/"&gt;Trello&lt;/a&gt; that helps you keep a track on your entire team through a single dashboard. The tools are designed to help you become agile and deliver products faster. You can plan your sprint fasters, create tasks for your team, declare deadlines, set alerts, and get an idea of the bigger picture that your team is working on.&lt;/p&gt;

&lt;p&gt;Project management tools can really help your team adhere to your daily stand-ups.&lt;/p&gt;

&lt;p&gt;Also, while testing remotely you are probably going to have a hard time collecting &amp;amp; reporting bugs to your team. Unless you are leveraging tools like &lt;a href="https://www.atlassian.com/software/jira"&gt;Jira&lt;/a&gt; and &lt;a href="https://mantisbt.org/"&gt;Mantis&lt;/a&gt; who are designed to work as a bug-tracker for collecting and prioritizing your reported bugs.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Streamlined Customer Support Is The Key To Success
&lt;/h2&gt;

&lt;p&gt;Customer feedback is a pivotal part of every modern-day release cycle. If a new feature is shipped after getting the sign-off from you &amp;amp; your testing, you are going to be intrigued about the satisfaction of the end-user, right? After all, you worked hard to test that feature so it could work well for them.&lt;/p&gt;

&lt;p&gt;The first step of communication that takes place in customer feedback starts off with customer support. So you need to ensure that customer support is always available for your end-users. And not just for feedback but also for troubleshooting and queries.&lt;/p&gt;

&lt;p&gt;Your company is still doing business, which may mean you’re selling products or services. While your sales numbers may be down, for those customers who are still buying, if they need to be in touch, someone must be available to answer them.&lt;/p&gt;

&lt;p&gt;This becomes more troublesome for businesses that are running a 24/7 service or who are catering throughout the globe. If you are involved in one such business then you are going to have to ensure that your customers showing up from different time zones are well attended. However, ensuring seamless customer support while working from home could be much harder. And if the lady luck isn’t smiling upon your team then you could have an outage coming up in the middle of the night. Simply speaking, you can’t afford to be temporarily unavailable!&lt;/p&gt;

&lt;p&gt;One tool that can make customer support simpler to manage is &lt;a href="https://www.engagebay.com/"&gt;EngageBay&lt;/a&gt;. This sales and marketing tool includes a free CRM as well.&lt;/p&gt;

&lt;p&gt;Use automation to take care of time-consuming marketing tasks, drive customer engagement through sequences and email newsletters, and keep your customers satisfied until you’re back in the office.&lt;/p&gt;

&lt;p&gt;An all-in-one sales and marketing solution like EngageBay’s ensures that no area of your company operations is neglected during these challenging times. This will build up and maintain customer goodwill, which is especially important right now.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Use A Cloud Selenium Grid To Help You Save Resources and Time
&lt;/h2&gt;

&lt;p&gt;Deliver seamless user experience to your users through our online &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-2062020&amp;amp;utm_term=Rana"&gt;Selenium Grid&lt;/a&gt; of 2,000+ real browsers. We at LambdaTest, are continuously working towards delivering a complete testing ecosystem to all testers around the globe and we know firsthand how challenging it can be for you to validate your websites or web-app from home. Especially, for enterprises which are restricted to cross browser testing using in-house device labs or Selenium infrastructure.&lt;/p&gt;

&lt;p&gt;Which is why we are fully operational in these tough times to help you perform automated browser testing with ease. You can leverage our Selenium Grid on-cloud, without worrying about maintaining the testing infrastructure. We also offer integrations to project management tools, CI/CD tools, bug tracking tools, instant-messaging applications, and more to help you collaborate better with your remote testing teams. Do check all of the LambdaTest integrations.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Incorporate Test Automation In Your CI/CD Pipeline For Continuous Testing
&lt;/h2&gt;

&lt;p&gt;I can’t emphasize this enough. You may have a &lt;a href="https://www.lambdatest.com/blog/automated-testing-pipeline-with-gitlab-ci-cd-and-selenium/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-2062020&amp;amp;utm_term=Rana"&gt;CI/CD pipeline&lt;/a&gt; responsible for migrating multiple changes of a release from one staging to another. However, is that CI/CD pipeline integrated with an automation testing tool such as Selenium? If not, you are slowing the product delivery and increasing the chances of human error.&lt;/p&gt;

&lt;p&gt;Every release is a different story, some are not as exhaustive as others. Some releases might have dozens of features passing to Production. Such releases may consume a considerable amount of time from your testing team to perform regression testing. Not to forget, it is best recommended to push releases over non-business hours. That means you would either be pushing them late at night if you are a local business or over the weekends if you are an international one. Either way, the time frame provided for you to perform end-to-end testing would be limited. Plus, the probability of human error would increase with the size of the test suites.&lt;/p&gt;

&lt;p&gt;Integrating your CI/CD pipelines with Selenium can help you trigger a job which would automatically run Selenium test automation, every time a change is pushed through the pipeline. That way, you can come up with more critical test case scenarios by reducing your regression testing efforts. Plus, your remote testing team will be able to deliver test cycles on time.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Remote Desktop Access Tools Are Much Needed For Troubleshooting
&lt;/h2&gt;

&lt;p&gt;The final productivity tip I have for remote testing teams is to leverage remote desktop access. Now that we’re forced to work from home, you need to ensure cross-functional support across your company. As a tester, you may have to explain how to reproduce a test scenario to a developer in your team or maybe to some other tester. If a test scenario is too complex, and for some reason, they aren’t able to reproduce it on their system then you may want to rely on remote desktop access tools such as &lt;a href="https://anydesk.com/en"&gt;AnyDesk&lt;/a&gt;, &lt;a href="https://www.teamviewer.com/en/"&gt;TeamViewer&lt;/a&gt;, etc. Not just with your team, sometimes you may want remote access to your customer’s system for understanding their issue.&lt;/p&gt;

&lt;p&gt;Even for troubleshooting your own system’s hardware or software issue, you might want to rely on these tools to get you the right help from your IT department.&lt;/p&gt;

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

&lt;p&gt;There you have it, 7 productivity tips for remote testing teams that can help them get more done while working from home. The apps, tools, and programs we shared in this article will streamline your processes, automate when necessary, and connect you with your staff so you feel a little less alone.&lt;/p&gt;

&lt;p&gt;It can be hard to get into the working mindset right now, but with all the great suggestions in this article, you’ll be ready to tackle more items on your to-do list and closeout each workday feeling productive and satisfied. Cheers and happy testing! 🙂&lt;/p&gt;

</description>
      <category>testing</category>
      <category>remote</category>
      <category>qa</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Selenium Java Testing: Page Object Model</title>
      <dc:creator>Nate-Grey</dc:creator>
      <pubDate>Tue, 19 May 2020 10:47:32 +0000</pubDate>
      <link>https://dev.to/nategrey/selenium-java-testing-page-object-model-2cnh</link>
      <guid>https://dev.to/nategrey/selenium-java-testing-page-object-model-2cnh</guid>
      <description>&lt;p&gt;Performing &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-19052020&amp;amp;utm_term=Rana"&gt;Selenium test automation&lt;/a&gt; is not a luxury in agile development anymore, with increasing number of features to test, the workload on testers keeps piling up. To keep up with this pace, testers need to automate their tests. But, even while automating tests, a poor implementation can lead to wasted or increased efforts.&lt;/p&gt;

&lt;p&gt;Poor implementation can happen in cases, such as when your web application’s UI keeps changing, and you struggle to keep up with them while writing Selenium test automation scripts. For example, If you had different scripts using the same web element, whenever there is a change in the element you’d have to make the change in every script. This can not only be tedious and time-exhausting, but also takes up bandwidth, which the team could have used elsewhere.&lt;/p&gt;

&lt;p&gt;In this Selenium Java tutorial, I’ll explain how page object model (POM) can help in better script maintenance for ever increasing UI changes for Selenium test automation in Java.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Page Object Model?
&lt;/h2&gt;

&lt;p&gt;Page object model is an object design pattern in Selenium test automation used to make a repository of Web UI elements. POM improves test readability and reduces code duplication, by acting as an interface for the page under test. In the Page object model, all the webpages have individual page classes. These page classes find the web elements on the page, and contain all the relevant page methods.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;clickLoginButton();  
enterCredentials(user_name,user_password);  
checkIfImageIsDisplayed();  
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;So, while performing Selenium test automation, the test case uses the object of this Page class to call the various methods to perform actions on the web page. Since all the web elements related to a page are present at a common location, it becomes easy to implement Selenium Java testing routines, and update them when required.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do We Need a Page Object Model For Selenium Java Testing?
&lt;/h2&gt;

&lt;p&gt;We now know in this Selenium Java tutorial, as the UI of your webpage changes, so does the need of changing your Selenium test automation scripts. But, by implementing Page Object Model for Selenium Java testing, you only have to change the page objects, as all the changes needed for tests are in one location.&lt;/p&gt;

&lt;p&gt;This makes the project more reliable as you don’t have to update your tests with any change in UI. Now, a single locator change won’t have the developer walk to through the code to fix it.&lt;/p&gt;

&lt;p&gt;Let’s take a Selenium automation test scenario, where we look for the zipcode, ”12345” among the complete list on a webpage, then we click on it to find the city and match it to the city name, “MyCityName”.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;List&amp;lt;WebElement&amp;gt; zipCodes = driver.findElements(By.id("zipCodes"));  
for (WebElement zipCode : zipCodes) {  
     if (zipCode.getText().equals("12345")){  
          zipCode.click();  
          break;  
     }  
}  
WebElement city = driver.findElement(By.id("city"));  
assertEquals("MyCityName", city.getText());  
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Even with a simple test, changes to the UI are made frequently. It could be the new design or restructuring of fields and buttons. This impacts the test case as you’d have a suite of Selenium Java tests that needs updating.&lt;/p&gt;

&lt;p&gt;Some of the problems for this type of Selenium Java test are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Changes in the UI breaks multiple tests often in several places&lt;/li&gt;
&lt;li&gt;Duplication of selectors both inside and across tests – no reuse&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Are The Advantages of Page Object Model (POM)?
&lt;/h2&gt;

&lt;p&gt;Using Page Object Model for Selenium Java testing, we can prevent the test code from being brittle and lessen the chances of duplicated code. It also improves readability and makes the code more interactive and easy to understand.&lt;/p&gt;

&lt;p&gt;POM introduces a decoupling layer by separating the abstraction of the test object and the Selenium Java testing scripts. This is implemented by creating an UI object to be automated to wrap HTML elements and encapsulate interactions with the UI, which in turn takes all the WebDriver calls. So, in case of any element changes, this is the only page/class to be updated to incorporate the latest UI.&lt;/p&gt;

&lt;p&gt;Page object model helps to give more realistic names to functions which helps to map to operation being done. This design pattern can be used with any kind of framework like keyword-driven, Data-driven, hybrid framework, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  How To Implement Page Object Model?
&lt;/h2&gt;

&lt;p&gt;This Selenium Java tutorial will demonstrate how POM is suitable for applications with multiple pages. In the page object model structure, all the web elements present on each page are separated in a single page class file along with functions to do all possible interactions on that page and is generally known as *Page.java like LoginPage.java. Below are the important topics, you need to know before we start to write our first Selenium Java testing script:&lt;/p&gt;

&lt;h3&gt;
  
  
  Page Factory
&lt;/h3&gt;

&lt;p&gt;In order to use POM and support it effectively in project, we use Page Factory which says, create all the element locators for the page in starting of the class and initialize all the elements in the page when page is loaded and create an object of the page itself before the web element variables can be used.&lt;/p&gt;

&lt;p&gt;Elements of a webpage can be declared as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@FindBy(how=How.XPATH, using=”fld_username2”)  
WebElement usernameTxtBox2;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And can be initialized using initElements function on PageFactory as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RegisterPage register = new RegisterPage();  
PageFactory.initElements(driver, register);  
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Or in a more simpler code as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RegisterPage register = PageFactory.initElements(driver, RegisterPage.class);  
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Or even in class constructor as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public RegisterPage (WebDriver driver) {            
     this.driver = driver;  
     PageFactory.initElements(driver, this);  
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Understanding Web Element Locators
&lt;/h3&gt;

&lt;p&gt;PageFactory uses reference to actual elements on the page to initialize the referring web element on the page class file by means of locators. These locators are identified by the use of @FindBy annotation. With this annotation, the user defines a way to look up the element like by name along with the necessary information associated with the element as per given locator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@FindBy(how=How.XPATH, using=”fld_username2”)  
WebElement usernameTxtBox2;  
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Every time a function is called for any interaction on the web page which uses this webelement variable, the driver will first try to find the element again using PageFactory. This is very helpful in case some element might not be visible at the start of the page but after some action, then also that element is available for actions as Page Factory searches for the element again when it is called for some action. For elements which are loaded initially at the time of page load and are not changed and can be accessed via cache, Page Factory provides another annotation @CacheLookup for elements which are already there and need not be found again saving time and memory and action can be performed directly on them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@FindBy(how=How.XPATH, using=”fld_username2”)  
@CacheLookup  
WebElement usernameTxtBox2; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This entire definition of the WebElement variable can be replaced with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@FindBy(xpath = “fld_username2”)  
private WebElement usernameTxtBox2;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The @FindBy annotation supports a range of locator strategies that makes it easier to use as per available information about the web elements. Let us understand all these to make the project structure better.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. ID
&lt;/h4&gt;

&lt;p&gt;Id locators are used to locate unique elements in the DOM. ID locators are unique to the webelement and are the fastest method to locate any web element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;driver.findElement(By.id("your_text"));
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Name
&lt;/h4&gt;

&lt;p&gt;Name locators in Selenium Java testing are used to identify webelements of a page, unlike ID locators they may not be unique to a page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name locators in Selenium Java testing are used to identify webelements of a page, unlike ID  locators they may not be unique to a page.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Class
&lt;/h4&gt;

&lt;p&gt;Class Name locators in Selenium Java testing are used to identify webelements through class attributes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;driver.findElement(By.className("inputtext"));
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If more than one element has the same id/name/class then it always acts on the first search element occurrence. In such cases we need to make the locator unique or use some other locator that has a unique occurrence for the required element.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Link
&lt;/h4&gt;

&lt;p&gt;Link selectors can only be used for hyperlinks. Pick up the link text from the page html.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;driver.findElement(By.linkText("Blog"));
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  5. CSS
&lt;/h4&gt;

&lt;p&gt;CSS selectors can also be used when it’s difficult to access ID or name. Tagname and attributes are used to make a css element locator&lt;/p&gt;

&lt;p&gt;Text between the starting and ending tag is called innerText.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case 1 : tag with id &lt;code&gt;input id = “email”&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;driver.findElement(By.cssSelector("input# ch_login_email "))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Case 2: tag with class &lt;code&gt;input class=”btn btn-default form-post”&lt;/code&gt; //each space in class name is replaced by dot(.)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;driver.findElement(By.cssSelector("form-control mt-3 form-control-lg"))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  6. Xpath
&lt;/h4&gt;

&lt;p&gt;Xpath in Selenium Java Testing is used to identify web elements on the web page using XML expressions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GROUP-1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;input placeholder=’Search’ name=’firstname’&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;xpath with single attribute //need to use @ before attribute name and value of attribute must be in single quote&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpath= //input[@placeholder=’Search’]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;xpath with multiple attributes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpath= //input[@placeholder=’Search’ or @name=’firstname’]  //works as logical OR
xpath= //input[@placeholder=’Search’ and @name=’firstname’]  //works as logical AND
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Use * on place of attribute&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpath= //input[@*=’Search’]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Use * on place of tag name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpath= //*[@placeholder=’Search’ or @name=’firstname’]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;GROUP-2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Any Text&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;xpath with inner text&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpath= //a[text()=’any text’]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;xpath with inner text (contains)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpath= //a[contains(text(),’any’)]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;xpath with inner text (not contains)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpath= //a[not(contains(text(),’any text’))]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;xpath with inner text (starts-with)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpath= //a[starts-with(text(),’any’)]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;GROUP-3&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Multiple xpath for same element&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpath= //input[@id=’email’] | //input[@id=’emailNew’]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Dynamic xpath using contains&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpath= //input[contains(@id,’ema’)]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We have talked in depth about XPath and subgroups in great detail in our &lt;a href="https://www.lambdatest.com/blog/complete-guide-for-using-xpath-in-selenium-with-examples/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-19052020&amp;amp;utm_term=Rana"&gt;Selenium Xpath tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing Our First Selenium Java Test Case using Page Object Model
&lt;/h2&gt;

&lt;p&gt;Before we start writing the Selenium Automation test case, we must remember a few of unsaid rules of working with Page Object Model with Selenium Java testing to make it more effective&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A page object file should never have assertions or any kind of related functionality. It is only meant to store web element variables and their interactions.&lt;/li&gt;
&lt;li&gt;Page object for a web page, need not necessarily contain all the web elements of the page. Only meaningful and required elements are to be used.&lt;/li&gt;
&lt;li&gt;For almost all scenarios, web page interactions redirects/leads to a new page. So the page should return a page object of the following page in all valid cases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To write the first Selenium Automation test case, let us take the example of Gmail login flow for easy understanding.&lt;/p&gt;

&lt;p&gt;For our Selenium Java tutorial, this test case will have&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pages – GmailHomePage.java and GmailLoginPage.java and GmailInboxPage.java&lt;/li&gt;
&lt;li&gt;TestBase.java&lt;/li&gt;
&lt;li&gt;GmailLoginTestCase.java&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  TestBase Class
&lt;/h3&gt;

&lt;p&gt;In this class we create the object of WebDriver class and redirect to gmail login url&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class TestBase {  
     public static WebDriver driver;  

     @BeforeSuite  
     public void initializeWebDriver() throws IOException {  
          System.setProperty("webdriver.chrome.driver","\src\drivers\chromedriver.exe");  
          driver = new ChromeDriver();  

          // To maximize browser  
          driver.manage().window().maximize();  

          // Implicit wait  
          driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);  

          // To open Gmail site  
          driver.get("https:// www.gmail.com");  
     }  

     @AfterSuite  
     public void quitDriver() {  
          driver.quit();  
     }  
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  GmailHomePage Class
&lt;/h3&gt;

&lt;p&gt;In this, we identify the web elements of Gmail Home Page and methods to interact with web elements on it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class GmailHomePage {  

     WebDriver driver;  

     @FindBy(link = “Sign In”)  
     WebElement signInButton;  

     public GmailHomePage (WebDriver driver) {  
          this.driver = driver;  
          PageFactory.initElements(driver, this);  
     }  

     // This method is to click on signIn button  
     public GmailLoginPage clickSignInButton() {  
          signInButton.click();  
          return new GmailLoginPage(driver);  
     }  
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  GmailLoginPage Class
&lt;/h3&gt;

&lt;p&gt;In this, we identify the web elements of Gmail Login Page and methods to interact with web elements on it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class GmailLoginPage {  

     WebDriver driver;  

     @FindBy(xpath = "// input[@type='email']]")  
     WebElement emailTextBox;  

     @FindBy(xpath = "// input[@type='password']")  
     WebElement passwordTextBox;  

     @FindBy(xpath = "// div[@role = 'button' and @id  = 'identifierNext']")  
     WebElement nextButton;  

     public GmailLoginPage(WebDriver driver) {  
          this.driver = driver;  
          PageFactory.initElements(driver, this);  
     }  

     // This method is to set Email in the email text box  
     public void setEmail(String strEmail) {  
          emailTextBox.sendKeys(strEmail);  
     }  
     // This method is to set Password in the password text box  
     public void setPassword(String strPassword) {  
          passwordTextBox.sendKeys(strPassword);  
     }  

     // This method is to click on Next Button  
     public GmailInboxPage clickOnNextButton() {  
          nextButton.click();  
          return new GmailInboxPage (driver);  
     }  
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  GmailInboxPage Class
&lt;/h3&gt;

&lt;p&gt;In this, we identify the web elements of Gmail Home Page and methods to interact with web elements on it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class GmailInboxPage {  

     WebDriver driver;  

     @FindBy(xpath = “//a[@title='Gmail']”)  
     WebElement gmailHeader;  

     public GmailInboxPage (WebDriver driver) {  
          this.driver = driver;  
          PageFactory.initElements(driver, this);  
     }  

     // This method is to verify if gmail header is visible  
     public Boolean gmailHeaderVisibility() {  
          return gmailHeader.isVisible();  
     }  
} 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  GmailLoginTest class
&lt;/h3&gt;

&lt;p&gt;In this class we define the test case and sequence of webpage interactions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class GmailLoginTest extends TestBase {  

     @Test    
     public void init() throws Exception {    
          GmailHomePage gmailHomePage = new GmailHomePage(driver);    
          GmailLoginPage gmailLoginpage =  gmailHomePage.clickSignInButton();    
          gmailLoginpage.setEmail("abc@gmail.com");    
          gmailLoginpage.clickOnNextButton();    
          gmailLoginpage.setPassword("23456@qwe");    
          GmailInboxPage gmailInboxPage=  gmailLoginpage.clickOnNextButton();    
          Assert.assertTrue(gmailInboxPage.gmailHeaderVisibility);    
     }    
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The case can be executed by using any TestRunner for the code as per library used.&lt;/p&gt;

&lt;p&gt;This would make the first test case using POM and Selenium Java Testing, where we navigate to the gmail login page, do login and verify redirection to the inbox. A better approach would be to add another class file, GmailLoginFlow.java to add the page interactions and abstract them from main test class as following:&lt;/p&gt;

&lt;h3&gt;
  
  
  Updated GmailLoginTest class
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Test  
     public void testGmailLoginFlow() throws Exception {  
          GmailLoginFlow gmailLoginFlow = new GmailLoginFlow();  
          gmailLoginFlow.verifyGmailLoginFlow(driver);  
     }  
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  GmailLoginFlow class
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class GmailLoginFlow  
{  
     public GmailLoginFlow()  
     {}  

     public void verifyGmailLoginFlow(WebDriver driver){  
          GmailHomePage gmailHomePage = new GmailHomePage(driver);  
          GmailLoginPage gmailLoginpage =  gmailHomePage.clickSignInButton();  
          gmailLoginpage.setEmail("abc@gmail.com");  
          gmailLoginpage.clickOnNextButton();  
          gmailLoginpage.setPassword("23456@qwe");  
          GmailInboxPage gmailInboxPage=  gmailLoginpage.clickOnNextButton();  
          Assert.assertTrue(gmailInboxPage.gmailHeaderVisibility);  
     }  
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  How to Execute Page Object Model By Using LambdaTest Selenium Grid
&lt;/h3&gt;

&lt;p&gt;In order to execute the same Selenium Automation test scenario over LambdaTest, TestBase class can be modified as follows to incorporate LambdaTest properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class TestBase {  
     public static WebDriver driver;  

     @BeforeSuite  
     public void initializeWebDriver() throws IOException {  
          DesiredCapabilities capabilities = new DesiredCapabilities();    

          String username = "&amp;lt;your_lambdatest_username&amp;gt;";    
          String accesskey = "&amp;lt;your_lambdatest_accesstoken&amp;gt;";    
          String lambdaTestGridURL = "@hub.lambdatest.com/wd/hub";    

          capabilities.setCapability("build", "Selenium_POM_Project");    
          capabilities.setCapability("name", "Verify Gmail Login Flowt");    
          capabilities.setCapability("platform", "Windows 10");    
          capabilities.setCapability("browserName", "chrome");    
          capabilities.setCapability("version", "73.0");    
          capabilities.setCapability("visual",false);      
          capabilities.setCapability("network",false);      
          capabilities.setCapability("console",false);      
          capabilities.setCapability("tunnel",false);    
          try {    
               driver = new RemoteWebDriver(new URL("http://" + username + ":" + accesskey                
                + lambdaTestGridURL), capabilities);    
               }  
          catch (MalformedURLException e) {    
               System.out.println("Invalid grid URL");    
               }     

     // To maximize browser  
     driver.manage().window().maximize();  

     // To open Gmail site  
     driver.get("https:// www.gmail.com");  
     }  

     @AfterSuite  
     public void quitDriver() {  
          driver.quit();  
     }  
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Monitoring Test Results By LambdaTest Dashboard
&lt;/h3&gt;

&lt;p&gt;As the setup is completed and having run a sample test, we can now move to the dashboard to explore the run results.&lt;/p&gt;

&lt;p&gt;Login to your LambdaTest account redirects users to dashboard, which gives an overview of the whole tests and activities done so far along with available integrations.&lt;/p&gt;

&lt;p&gt;You can see the number of tests run via automation, run using real time browser utility, concurrent sessions. date of execution and much more.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BSdOZejx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/Cross-Browser-Testing-Dashboard-min.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BSdOZejx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/Cross-Browser-Testing-Dashboard-min.png" alt="Cross Browser Testing Dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next is the Realtime Browser Testing panel. It enables users to execute tests on any browser version of choice in any OS and resolution of user choice by just simply selecting from the available list.&lt;/p&gt;

&lt;p&gt;Visual UI Testing enabled users to run tests with screenshots taking capability on a varied set of OS and browser combinations. It also provides features to test across different UI for responsiveness depending on different screen sizes and resolutions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8rKgy8R9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/Screenshot-Testing-on-Different-Screen-min.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8rKgy8R9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/Screenshot-Testing-on-Different-Screen-min.png" alt="Screenshot Testing on Different Screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--byuUdkrA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/Responsive-Testing-on-Different-Screen-min.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--byuUdkrA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/Responsive-Testing-on-Different-Screen-min.png" alt="Responsive Testing on Different Screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Automation section of the dashboard helps users to keep track of all the automation run triggered along with all related automation logs and analytics.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qOMUkgXq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/Automation-Testing-Dashboarf-min.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qOMUkgXq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/Automation-Testing-Dashboarf-min.png" alt="Automation Testing Dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Automation logs provided by Lambdatest can be considered as the best utility provided owing to the range of different types of logs provided. Logs in the form of video, network and test run provides users with all possible information about the run and helps in facilitating debugging and troubleshooting to a large extent.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kCeeMYZM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/LambdaTest-Test-Automation-Logs-min.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kCeeMYZM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/LambdaTest-Test-Automation-Logs-min.png" alt="LambdaTest Test Automation Logs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Logs for any run other than the automation, like real time testing or screenshot testing or responsive one can be found under this section. This captures all associated information along with filters for better analysis and has the ability to download those reports and screenshots.&lt;/p&gt;

&lt;p&gt;Another important use case of using LambdaTest is that it allows you to add issues or bugs at the same time when they are encountered and provides a section in the same dashboard for easier tracking of its progress on different stages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dr59mF_6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/LambdaTest-Automation-Issue-Tracker-min.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dr59mF_6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/LambdaTest-Automation-Issue-Tracker-min.png" alt="LambdaTest Automation Issue Tracker"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also the ability to integrate with more than 30 apps for different purposes like communication, bug tracking, CI/CD, Project Management adds more to the positives of using this tool for cloud based testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping It Up
&lt;/h2&gt;

&lt;p&gt;An object repository design pattern, Page Object Model, helps to create the test code maintainable, reusable and optimised. Combined with Page Factory, It makes writing web pages easier for selenium automation by combining all web page interactions, in a separate page file. It makes the code simple and to be adapted easily for continuous changing requirements.&lt;/p&gt;

&lt;p&gt;In our previous Selenium Java Testing tutorials, we have covered how to test login process, user signup, access form.&lt;/p&gt;

&lt;p&gt;So, that was all for now, you should be able to create a page object model for Selenium Java Testing now. In case of any doubts, feel free to reach out to us in the comment section below. If you liked this article, share it with your friends on facebook, LinkedIn or twitter. Happy Testing&lt;/p&gt;

</description>
      <category>java</category>
      <category>selenium</category>
      <category>testing</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Business Driven Development By Selenium Testing With Gherkin</title>
      <dc:creator>Nate-Grey</dc:creator>
      <pubDate>Thu, 07 May 2020 09:16:36 +0000</pubDate>
      <link>https://dev.to/nategrey/business-driven-development-by-selenium-testing-with-gherkin-3a2c</link>
      <guid>https://dev.to/nategrey/business-driven-development-by-selenium-testing-with-gherkin-3a2c</guid>
      <description>&lt;p&gt;Cucumber and Selenium are widely used frameworks for BDD(Behaviour Driven Development) and browser automation respectively. Although on paper, it seems like a nice pair but when it comes to reality a lot of testers shy away from it. The major reason behind this is Gherkin as most testers hesitate to use it as it feels like an additional task since the test scripts are still to be written separately.&lt;/p&gt;

&lt;p&gt;But this is not true for all. Using Gherkin can actually help in testing as it serves as a good document for all the features and can be written by anyone even with almost zero coding knowledge.&lt;/p&gt;

&lt;p&gt;Clients say, &lt;em&gt;“Cucumber benefits us to understand the application code as it uses Gherkin language which is in Plain Text.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Being written in Gherkin, it acts as a bridge between various layers, PMs – Dev – Testers – Clients. Let us move towards understanding BDD with Gherkin and how it can make &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-7052020&amp;amp;utm_term=Rana" rel="noopener noreferrer"&gt;Selenium testing&lt;/a&gt; better.&lt;/p&gt;

&lt;p&gt;In this article, I’ll further explore this topic on how to do Business Driven Development by Selenium testing with Gherkin. Before i start with Gherkin, i’d like to give you a small brief about BDD(Behaviour Driven Development, not to be confused with Business Driven Development.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, What Is BDD?
&lt;/h2&gt;

&lt;p&gt;Behavior Driven Development or popularly known as BDD, is a widely used development approach in the software industry as it empowers its user to write cases in plain english language. This helps team members even with no technical know-how to understand what is going on in the project that closes the gap between business people and technical people&lt;/p&gt;

&lt;p&gt;In addition to low technicality and easier to understand approach, main advantage of BDD is that it transpires from TDD ie. Test Driven Development, which supports automated testing with multiple test data with minimum intervention in code.&lt;/p&gt;

&lt;p&gt;Cucumber – A BDD Framework Tool: BDD is implemented with the help of Cucumber framework which helps in automating the cases in a well formatted and readable form.&lt;/p&gt;

&lt;p&gt;Cucumber feature files: These files written in Gherkin language ending with .feature extension are an integral part of Cucumber and are used for application specifications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started With Gherkin For Selenium Testing
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Now that you know what BDD is let’s get started with Gherkin for Selenium Testing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gherkin is a Business Readable, Domain Specific Language which entitles its users to write effective&lt;br&gt;&lt;br&gt;
tests in a well documented way that requires least reasoning and involved logic details.&lt;/p&gt;

&lt;p&gt;Let us understand this with a Gherkin example.&lt;/p&gt;

&lt;p&gt;“Buyers should not be able to fill invalid credit card details.” Versus “On the payment page, If a buyer enters a credit card number, that is not 16 digits of length, then when they try to proceed, it should give an error message pop up stating that the entered number is not correct.”&lt;/p&gt;

&lt;p&gt;The first Gherkin example is unclear and vague in comparison to the second one. Vagueness leads to errors and makes it harder for the tester to understand the requirement and implement test cases.&lt;/p&gt;
&lt;h3&gt;
  
  
  Gherkin Syntax For Selenium Testing
&lt;/h3&gt;

&lt;p&gt;File structure in Gherkin is defined by the way different lines of code are indented in a feature file. Almost all lines in Gherkin for Selenium Testing starts with a special keyword and line endings terminate statements which are called as steps.&lt;/p&gt;

&lt;p&gt;A Gherkin feature file is a combination of features, scenarios and steps which generally looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature: Some terse yet descriptive text of what is desired  

Background:Some common prerequisite setup applicable to all situations  
    Scenario: Some determinable business situation  
         Given some precondition  
         And some other precondition  
         When some action by the actor  
         And some other action  
         And yet another action  
         Then some testable outcome is achieved  
         And something else we can check happens too  

    Scenario: A different situation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When executing the feature, the trailing portion of each step (after keywords like Given, And, When, etc) is matched to a regular expression generally called as glue code and can be written in any language. In this tutorial, JAVA will be used for the same.&lt;/p&gt;

&lt;p&gt;Let us now walkthrough the above example to understand all the keywords&lt;/p&gt;

&lt;h4&gt;
  
  
  Feature
&lt;/h4&gt;

&lt;p&gt;Feature keywords are used to donate a software feature. It usually contains a list of scenarios linked to that feature. Main elements of feature are :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The keyword – Feature.&lt;/li&gt;
&lt;li&gt;The keyword, followed by the name user wants to give to the feature.&lt;/li&gt;
&lt;li&gt;An optional description that can span multiple lines i.e. all the text between the line containing the keyword Feature, and a line that starts with Scenario or Background which is optional&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good feature name should look something like :&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In order to &lt;code&gt;meet some goal&lt;/code&gt; as a &lt;code&gt;type of user&lt;/code&gt; I want &lt;code&gt;a feature&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As a good Gherkin coding convention it is highly recommended that one feature makes up for one *.feature file which in term is named by replacing spaces with underscore and converting feature name to lowercase. Let’s take a Gherkin example,&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Feature : In order to learn Gherkin as a beginner I want to study this tutorial Feature file name : in_order_to_learn_gherkin_as_a_beginner_i_want_to_study_this_tutorial.feature&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Background
&lt;/h4&gt;

&lt;p&gt;It is usually used to add some context steps that are common to all scenarios and needs to run before each scenario in a single feature file. It is like an untitled optional scenario&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Background : Given a customer named John  
    When clicks on buy now button  
    Then he should be redirected to payment page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Scenario
&lt;/h4&gt;

&lt;p&gt;Scenario makes the core of Gherkin structure. It describes the functionality that is under test. Main aim of a scenario is to be able to make the viewer understand what is being tested and how. The scenario keyword is followed by an optional title.&lt;/p&gt;

&lt;p&gt;One or multiple scenarios makes up a feature file depending upon the feature in test and one or multiple steps makes up for a feature file.&lt;/p&gt;

&lt;p&gt;By convention a good scenario follows following pattern&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Describe an initial context using keyword Given&lt;/li&gt;
&lt;li&gt;Describe an event using keyword When&lt;/li&gt;
&lt;li&gt;Describe an expected outcome using keyword Then
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Scenario : John wants to automate Selenium with Gherkin  
     Given John wants to learn Gherkin  
     When He starts reading this tutorial  
     Then he is able to write feature file 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Steps
&lt;/h4&gt;

&lt;p&gt;Steps basically make up the part of a scenario by means of given, when, then.&lt;/p&gt;

&lt;h4&gt;
  
  
  Given
&lt;/h4&gt;

&lt;p&gt;The sole purpose of a Given statement is to give a context in order to establish a known state before the user starts interacting with the feature scenario under test.&lt;/p&gt;

&lt;h4&gt;
  
  
  When
&lt;/h4&gt;

&lt;p&gt;This is used to describe the event due to user actions in a given state.&lt;/p&gt;

&lt;h4&gt;
  
  
  Then
&lt;/h4&gt;

&lt;p&gt;The purpose of then step is to describe and analyse the outcomes. This analysis aims to add benefit to features by verifying the outcome that is or is not related to Given and When or may be to some external system.&lt;/p&gt;

&lt;h4&gt;
  
  
  But
&lt;/h4&gt;

&lt;p&gt;These keywords are used to combine several Given, When or Then statements helping to make the scenario to be more readable and presentable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Scenario : Understanding the steps  
      Given I establish a context  
      And I add another context  
      When I discuss them both  
      And I ask questions  
      Then I have no more doubts  
      But I have a better understanding
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How To Run Selenium Test Scripts Using Cucumber?
&lt;/h2&gt;

&lt;p&gt;To make a gherkin project for Selenium Testing, the easiest way is to create a new maven project in any IDE like Eclipse. Also the dependencies for Cucumber, Selenium and Junit runners to execute the feature files.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;for using Cucumber with java&lt;/em&gt;&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;dependency&amp;gt;   
   &amp;lt;groupId&amp;gt;info.cukes&amp;lt;/groupId&amp;gt;   
   &amp;lt;artifactId&amp;gt;Cucumber-java&amp;lt;/artifactId&amp;gt;   
   &amp;lt;version&amp;gt;1.0.2&amp;lt;/version&amp;gt;   
   &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;   
&amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;for Selenium&lt;/em&gt;&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;dependency&amp;gt;   
   &amp;lt;groupId&amp;gt;org.Seleniumhq.Selenium&amp;lt;/groupId&amp;gt;   
   &amp;lt;artifactId&amp;gt;Selenium-java&amp;lt;/artifactId&amp;gt;   
   &amp;lt;version&amp;gt;2.47.1&amp;lt;/version&amp;gt;   
&amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;For junit runner to run Cucumber features&lt;/em&gt;&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;dependency&amp;gt;   
   &amp;lt;groupId&amp;gt;junit&amp;lt;/groupId&amp;gt;   
   &amp;lt;artifactId&amp;gt;junit&amp;lt;/artifactId&amp;gt;   
   &amp;lt;version&amp;gt;4.10&amp;lt;/version&amp;gt;   
   &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;   
&amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why Use Gherkin With Selenium Testing?
&lt;/h2&gt;

&lt;p&gt;Selenium is a widely used tool for functional testing across top organisations as it is easy to integrate with Gherkin and makes understanding and automating of the flow both easy and possible to be done at same time.&lt;/p&gt;

&lt;p&gt;By doing so one makes it easy to maintain test cases which also serves as proper documentation for all the Stakeholders and Analysts. Selenium being easy to integrate and a widely liked automation tool adds up to the usage of Cucumber. Together they make up a framework which is very easy to set up and has low maintenance cost.&lt;/p&gt;

&lt;p&gt;Moreover, the ability to run feature files parallely is another advantage. Also, both Gherkin and Selenium can be coded in Java for writing the glue code for steps and browser automation respectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits Of Gherkin In Selenium Testing With Example
&lt;/h2&gt;

&lt;p&gt;Here I will explain the usage of Gherkin for Selenium Testing with some examples and the framework along with file structure by means of the following example.&lt;/p&gt;

&lt;p&gt;Let’s take a test scenario with development of a web application for an organisation, let’s say ’Shopping.com’, and the team is discussing a process flow of order placement by a customer.&lt;/p&gt;

&lt;p&gt;First Step, for a customer to place an order, he/she should navigate to the website and login.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Given Customer navigates to the website  
And Customer login to his account
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that customer searches for a product and click on add to cart button&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;when customer searches for laptop  
And clicks on add to cart button 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Customer reaches the cart page and is able to click place order button&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Then Customer is redirected to cart page  
And Customer is able to click the place order button.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the flow is passed on to the automation tester, he uses it to write automation cases. Further, he adds automation code steps for the discussion file by converting it to a feature file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature : Place new order  
   As a customer, I want to place an order for searched item  
      Scenario : Place an order for the required product  
            Given Customer navigates to the website  
            And Customer login to his account  
            When customer searches for laptop  
            And clicks on add to cart button  
            Then Customer is redirected to cart page  
            And Customer is able to click the place order button 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to make these steps work I’ll write step definition code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package Cucumber.stepDefinitions;  

public class PlaceOrderStepDefs {  
      @Given(“Customer navigates to the website”)  
      public void navigateToWebsite(){  
      }  

      @And(“Customer login to his account”)  
      public void customerLogin(){  
      }        

      @When(“customer searches for laptop”)  
      public void searchForLaptop(){  
      }        

      @And(“clicks on add to cart button”)  
      public void clickAddToCart(){  
      }  

      @Then(“Customer is redirected to cart page”)  
      public void redirectionToCartPage(){  
      }  

      @And(“Customer is able to click the place order button”)  
      public void clickPlaceOrderButton(){  
      }  
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the point to note here is that there would be some data related to customers that is required and might be used by other feature files and scenarios as well. So it makes sense to create a separate file for such data called a properties file.Also, steps like loading this property file, initialising the driver, closing the browser after each scenario also needs to be done and this would be common to all tests. So it makes sense to create a base steps file and inherit that to all step definition files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#  APP        
url=http://www.shopping.com/   

#  Selenium      
webdriver.chrome.driver=resources/chromedriver  

#  CUSTOMER      

customerId=12345  
customerUsername=steven  
customerPassword=password123
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class BaseTests {  
    public static WebDriver driver;  

      @BeforeClass  
      public static void initialiseDriverAndProperties() {  
            loadTestProperties();  
            driver = new ChromeDriver();  
            driver.manage().window().maximize();  
       }  

      @AfterClass  
      public static void closeBrowser() {  
            driver.quit();  
      }  

      private static void loadTestProperties(){  
            Properties properties = System.getProperties();  
            try {  
                  properties.load(  
                  new FileInputStream(new File("resources/test.properties")));  
            } catch(Exception ex) {  
                  ex.printStackTrace();  
                  System.exit(-1);  
            }  
      }  
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Having written BaseSteps.java and test.properties file now let us complete the step definition file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package Cucumber.stepDefinitions;  

public class PlaceOrderStepDefs extends BaseSteps{  
      @Given(“Customer navigates to the website”)  
      public void navigateToWebsite(){  
            driver.get(System.getProperty(“url”));  
      }  

      @And(“Customer login to his account”)  
      public void customerLogin(){
            driver.findElement(By.id(“username”)).enterData(“username”);  
            driver.findElement(By.id(“password”)).enterData(“password”);  
            driver.findElement(By.id(“login”)).click();  
      }  

      @When(“customer searches for laptop”)  
      public void searchForLaptop(){  
            driver.findElement(By.id(“searchBox”)).enterData(“Laptop”);  
            driver.findElement(By.id(“searchButton”)).click();  
      }  

      @And(“clicks on add to cart button”)  
      public void clickAddToCart(){  
            driver.findElement(By.id(“addToCart”)).click();  
      }  

      @Then(“Customer is redirected to cart page”)  
      public void redirectionToCartPage(){  
            Assert.assertTrue(driver.findElement(By.id(“cartPageHeader”)).isDisplayed());  
      }  

      @And(“Customer is able to click the place order button”)  
      public void clickPlaceOrderButton(){  
            Assert.assertTrue(driver.findElement(By.id(“placeOrderButton”)).isClickable());  
      }  
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, step would be to a runner file to run this feature.&lt;br&gt;
&lt;/p&gt;

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

@RunWith(Cucumber.class)  
@CucumberOptions(  
      plugin = {"pretty"},  
      glue = {"Cucumber.stepDefinitions"},  
      features = {"src/test/java/Cucumber/features"})  

public class CucumberTestRunner { 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So with this example it is quite evident how easy it is to use Gherkin for Selenium Testing to make automation better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Gherkin For BDD On Online Selenium Grid
&lt;/h2&gt;

&lt;p&gt;In order to execute the Selenium automation over an Online Selenium Grid, you just need to update the BaseSteps.java to have the LambdaTest account username and access token along with few code changes to let the the system know that it will a RemoteWebDriver running on LambdaTest grid url with these capabilities.&lt;/p&gt;

&lt;p&gt;Here’s what updated BaseSteps.java would look like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class BaseTests {    

public static RemoteWebDriver driver;    

      @BeforeClass    
      public static void initialiseDriverAndProperties() {    
            loadTestProperties();    
            DesiredCapabilities capabilities = new DesiredCapabilities();  

            String username = "&amp;lt;your_lambdatest_username&amp;gt;";  
            String accesskey = "&amp;lt;your_lambdatest_accesstoken&amp;gt;";  
            String lambdaTestGridURL = "@hub.lambdatest.com/wd/hub";  

            capabilities.setCapability("build", "Selenium_Gherkin_Project");  
            capabilities.setCapability("name", "Placing order for a product");  
            capabilities.setCapability("platform", "Windows 10");  
            capabilities.setCapability("browserName", "chrome");  
            capabilities.setCapability("version", "73.0");  
            capabilities.setCapability("visual",false);    
            capabilities.setCapability("network",false);    
            capabilities.setCapability("console",false);    
            capabilities.setCapability("tunnel",false);  
            try {  
                  driver = new RemoteWebDriver(new URL("http://" + username + ":" + accesskey                     + lambdaTestGridURL), capabilities);  
            } catch (MalformedURLException e) {  
                  System.out.println("Invalid grid URL");  
            }   
      }    

      private static void loadTestProperties(){    
            Properties properties = System.getProperties();    
            try {    
                  properties.load(    
                  new FileInputStream(new File("resources/test.properties")));    
            } catch(Exception ex) {    
                  ex.printStackTrace();    
            }    
      }    
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Execute the test same as earlier using the TestRunner file and you are good to go with added advantages of using Selenium grid and get more information about the execution in a more presentable form.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping A Track Of Test Results Using LambdaTest Dashboard
&lt;/h2&gt;

&lt;p&gt;After you’ve completed the tests, you can further keep track of all your automation scripts using LambdaTest dashboard. Here in the Automation tab you can see the Timelines, Analytics, and Automation Log of all the tests you’ve run and the different builds used in the tests.&lt;/p&gt;

&lt;p&gt;You can see all your tests under the Automation Log, here you can see the summary of your tests, any exceptions encountered, track commands, network and metadata. You can also create issues and share it with your team on the preferred Project Management tool.&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%2F2020%2F03%2Fautomationlogs-1-1.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%2F2020%2F03%2Fautomationlogs-1-1.png" alt="Test Under Automation Logs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Using LambdaTest Platform For Cross Browser Test
&lt;/h3&gt;

&lt;p&gt;You can even utilise LambdaTest platform to perform Cross Browser Testing over 2000+ real browsers &amp;amp; browser versions. On LambdaTest dashboard you get an overview of all the tests and activities done so far along with available integrations. You can see the number of tests run via automation by using real time browser utility, concurrent sessions, date of execution and much more.&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%2F2020%2F03%2FDashboard-1.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%2F2020%2F03%2FDashboard-1.png" alt="Cross Browser Testing Dashboard"&gt;&lt;/a&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%2F2020%2F03%2Frealtime-min.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%2F2020%2F03%2Frealtime-min.png" alt="Browser Testing Panel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By using Realtime &lt;a href="https://www.lambdatest.com?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-7052020&amp;amp;utm_term=Rana" rel="noopener noreferrer"&gt;Cross Browser Testing&lt;/a&gt; panel, you can execute tests on over 2000+ real browsers &amp;amp; browser versions by just simply selecting from the available list.&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%2F2020%2F03%2Frealtime.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%2F2020%2F03%2Frealtime.png" alt="realtime"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Visual UI Testing, users can compare screenshots on multiple combinations of OS and browser combinations.&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%2F2020%2F03%2Fbrowser-1.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%2F2020%2F03%2Fbrowser-1.png" alt="combinations of OS and browser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It also provides features to test across different UI for responsiveness depending on different screen sizes and resolutions.&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%2F2020%2F03%2FResponsiveness-Testing.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%2F2020%2F03%2FResponsiveness-Testing.png" alt="Responsiveness Testing On Different Screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can even add issues or bugs at the same time when you encounter them and track them in the Issue Tracker.&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%2F2020%2F03%2FIssuetracker.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%2F2020%2F03%2FIssuetracker.png" alt="Issuetracker"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With integration on more than 30 bug tracking, CI/CD, Project Management tools you can share the bugs with your team on the go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping It Up
&lt;/h2&gt;

&lt;p&gt;In this tutorial I explained how using BDD framework like Cucumber with Gherkin can help in better collaboration among all the stakeholders along with the basics of Gherkin language and how to use its syntax. Then I went on to develop our first Selenium test automation script using Gherkin for Selenium Testing.&lt;/p&gt;

&lt;p&gt;Now you know why you shouldn’t shy away from Gherkin for Selenium Testing. Also, how it can help all the stakeholders in your team have a strong understanding of the project. Thereby helping the project achieve its business goals faster.&lt;/p&gt;

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

</description>
      <category>bdd</category>
      <category>testing</category>
      <category>java</category>
      <category>cucumber</category>
    </item>
    <item>
      <title>Cucumber.js Tutorial with Examples For Selenium JavaScript</title>
      <dc:creator>Nate-Grey</dc:creator>
      <pubDate>Mon, 27 Apr 2020 11:18:02 +0000</pubDate>
      <link>https://dev.to/nategrey/cucumber-js-tutorial-with-examples-for-selenium-javascript-51fe</link>
      <guid>https://dev.to/nategrey/cucumber-js-tutorial-with-examples-for-selenium-javascript-51fe</guid>
      <description>&lt;p&gt;The relevance of using a BDD framework such as Cucumber.js is often questioned by our fellow automation testers. Many feel that it is simply adding more work to their table. However, using a BDD framework has its own advantages, ones that can help you take your Selenium test automation a long way. Not to sideline, these BDD frameworks help all of your stakeholders to easily interpret the logic behind your Selenium test automation script. Leveraging Cucumber.js for your Selenium JavaScript testing can help you specify an acceptance criterion that would be easy for any non-programmer to understand. It could also help you quickly evaluate the logic implied in your Selenium test automation suite without going through huge chunks of code.&lt;/p&gt;

&lt;p&gt;With a given-when-then structure, Behaviour Driven Development frameworks like Cucumber.js have made tests much simpler to understand. To put this into context, let’s take a small scenario, you have to test an ATM if it is functioning well. We’ll write the conditions that, Given the account balance, are $1000 And the card is valid And the machine contains enough money When the Account Holder requests $200 Then the Cashpoint should dispense $200 And the account balance should be $800 And the card should be returned.&lt;/p&gt;

&lt;p&gt;In this Cucumber.js tutorial, we’ll take a deep dive into a clear understanding of the setup, installation, and execution of our first automation test with Cucumber.js for Selenium JavaScript testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Cucumber.js and what makes it so popular?
&lt;/h2&gt;

&lt;p&gt;Let’s start our Cucumber.js tutorial with a small brief about the framework. Cucumber.js is a very robust and effective Selenium JavaScript testing framework that works on the Behavior Driver Development process. This test library provides easy integration with Selenium and provides us the capability to define our tests in simple language that is even understood by a layman. Cucumber.js Selenium JavaScript testing library follows a given-when-then structure that helps in representing the tests in plain language, which also makes our tests to be a point of communication and collaboration. This feature improves the readability of the test and hence helps understand each use case in a better way. It is used for unit testing by the developers but majorly used for integration and end to end tests. Moreover, it collaborates the tests and makes it so legible that there is hardly a need for documentation for the test cases and can be even digested by the business users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up Cucumber.js for Selenium Javascript Testing
&lt;/h2&gt;

&lt;p&gt;So before we carry on with our Cucumber.js Tutorial, to begin writing and executing our automated test scripts using Cucumber, we need to set up our system with the Cucumber.js framework and install all the necessary libraries and packages to begin Selenium JavaScript testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node JS and Node Package Manager (npm):&lt;/strong&gt; This is the foundation package and most important for any Selenium Javascript testing framework. It can be downloaded via the npm manager i.e. by installing node package manager from the nodejs.org official website: &lt;a href="http://www.nodejs.org/en/download/package-manager"&gt;http://www.nodejs.org/en/download/package-manager&lt;/a&gt; or using the package installer for different operating systems downloaded from the web site &lt;a href="https://nodejs.org/en/#home-downloadhead"&gt;here&lt;/a&gt; for Mac OS, Windows or Linux. We can execute the npm command in the command line and check if it is correctly installed on the system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cucumber.js Library Module:&lt;/strong&gt; The next prerequisite required for our test execution is the Cucumber.js library. We would need the Cucumber.js package as a development dependency. After the successful installation and validation of the Node JS on the system, we would use the node package manager i.e. npm that it provides to install the Cucumber.js library package in the npm repository.&lt;/p&gt;

&lt;p&gt;So, in order to install the latest version of the Cucumber.js module, we will use the npm command as shown below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install -g cucumber 
and
npm install  --save-dev cucumber
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here the parameter &lt;strong&gt;‘g’&lt;/strong&gt; indicates the global installation of the module, which means that it does not limit the use of the module to the current project and it also can be accessed with command-line tools. The command executed using the parameter &lt;strong&gt;‘–save-dev&lt;/strong&gt; ’ will place the Cucumber executable in the base directory i.e. ./node_modules/.bin directory and execute the commands in our command-line tool by using the cucumber keyword.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Java – SDK:&lt;/strong&gt; Since, all the Selenium test framework internally uses Java, next we would move ahead and install the Java Development Kit on our systems. It is advised to use JDK having version 6.0 and above and setup /configure the system environment variables for JAVA.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Selenium Web Driver:&lt;/strong&gt;. To automate the system browser, we would need to install Selenium Web Driver Library using the below npm command. In most cases, it automatically gets installed in our npm node_modules base directory as a dependency when installing other libraries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install selenium-webdriver
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Browser Driver:&lt;/strong&gt; Finally, it is required to install the browser driver. It can be any browser where we would want to execute the test scenarios and hence the corresponding driver needs to be installed. This executable needs to be added to our PATH environment variable and also placed inside the same bin folder. Here we are installing the chrome driver.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/selenium-webdriver?_ga=2.176826533.166155791.1580640441-1448696306.1580300168"&gt;Here is the link&lt;/a&gt; to the documentation where we can find and download the version that matches the version of our browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.tojavascript:void(0)"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gu_nEqrt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/04/Automation-Trial-2.jpg" alt="automation-trial-now"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Working on the Cucumber.js test framework?
&lt;/h2&gt;

&lt;p&gt;Now that we’ve set up our system for our Cucumber.js tutorial, we will move ahead with creating our project structure and create a directory named cucumber_test. Then we will create two subfolders i.e feature and step_definition which will contain respective scripts written for our features and step definition.&lt;/p&gt;

&lt;h2&gt;
  
  
  $ mkdir features
&lt;/h2&gt;

&lt;p&gt;$ mkdir step_definitions&lt;/p&gt;

&lt;p&gt;Finally, the folder will have a generated package.json file in the base directory of the package and save all of the dev dependencies for these modules. Another important thing to do with the package.json file is to add the test attribute in the scripts parameter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "scripts": {
    "test": "./node_modules/.bin/cucumber-js"
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;By adding this snippet to our package.json file we can run all your cucumber tests from the command line by just typing in “npm test” on the command line. Our final project folder structure stands as below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cucumber_test
        | - - feature
                    | - - feature_test.feature
                  | - - step_definition
                                     | - - steps_def.js
      | - - support
            | - - support.js
        | - - package.json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Below is the working procedure of a Cucumber.js project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We begin with writing a .feature files which have the scenarios and each of these scenarios with a given-when-then structure defined.&lt;/li&gt;
&lt;li&gt;Next, we write down step definition files which typically defines the functions that match with the steps in our scenarios.&lt;/li&gt;
&lt;li&gt;Further, we implement these functions as per our requirement or automate the tests in the browser with the Selenium driver.&lt;/li&gt;
&lt;li&gt;Finally, we run the tests by executing the Cucumber.js executable file present in the node_modules/.bin folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Running Our First Cucumber.js Test Script
&lt;/h2&gt;

&lt;p&gt;The next step in this Cucumber.js tutorial is to execute a sample application. We will start by creating a project directory named cucumber_test and then a subfolder name script with a test script name single_test.js inside it.&lt;/p&gt;

&lt;p&gt;Then we’ll add a scenario with the help of a .feature file. Which will be served to our application as we instruct Cucumber.js to run the feature file. Finally, the Cucumber.js framework will parse the file and call the code that matches the information in the feature file.&lt;/p&gt;

&lt;p&gt;Here for our first test scenario, we will start with a very easy browser-based application that on visiting the Selenium official homepage allows us to make a search by clicking the search button.&lt;/p&gt;

&lt;p&gt;Please make a note of the package.json file that we will be using in our upcoming demonstrations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;package.json&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The package.json file contains all the configuration related to the project and certain dependencies that are essential for the project setup. It is important to note that the definitions from this file are used for executing the script and hence this acts as our project descriptor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "Cucumber.js Javascript test with Selenium",
  "version": "1.0.0",
  "description": "CucumberJS Tutorial for Selenium JavaScript Testing",
  "main": "index.js",
  "scripts": {
    "test": "./node_modules/.bin/cucumber-js"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "author": "",
  "license": "ISC",
  "description": {
    "url": ""
  },
  "homepage": "",
  "dependencies": {
    "assert": "^1.4.1",
    "chromedriver": "^2.24.1",
    "cucumber": "^1.3.0",
    "geckodriver": "^1.1.3"
  },
  "devDependencies": {
    "selenium-webdriver": "^3.6.0"
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now, the first step of the project is to define our feature that we are going to implement i.e within this file, we will describe the behavior that we would want from our application, which is visiting the website in our case. This feature lets the browser check for the elements. Hence , we will update our feature file with the code. Below is how our feature file looks like which contains the given when and then scenarios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;feature_test.feature&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now we will have our first basic scenarios for visiting the website defined in the feature file followed by other scenarios. These scenarios will follow a given-when-then template.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Given: It sets the initial context or preconditions.&lt;/li&gt;
&lt;li&gt;When: This resembles the event that is supposed to occur in the scenario.&lt;/li&gt;
&lt;li&gt;Then: This is the expected outcome of the test scenario.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Feature: A feature to validate certain actions on visiting the Selenium Dev website&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Scenario: On visiting the homepage of selenium.dev Given I have visited the Selenium official web page on &lt;a href="http://www.selenium.dev"&gt;www.selenium.dev&lt;/a&gt; When There is a tile on the page as SeleniumHQ Browser Automation Then I should be able to click Search in the sidebar.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;steps_def.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now moving on to define the steps. Here we define the functions that match with the steps in our scenarios and the actions that it should perform whenever a scenario is triggered.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* This Cucumber.js tutorial file contains the step definition or the description of each of the behavior that is expected from the application */

'use strict';

const { Given, When, Then } = require('cucumber');

const assert = require('assert')

const webdriver = require('selenium-webdriver');

// // The step definitions are defined for each of the scenarios // //

// // The “given” condition for our test scenario // //
Given(/^I have visited the Selenium official web page on "([^"]*)"$/, function (url, next) {

this.driver.get('https://www.selenium.dev').then(next);

  });

// // The “when” condition for our test scenario // //
  When(/^There is a title on the page as "SeleniumHQ Browser Automation" "([^"]*)"$/, function (titleMatch, next) {
    this.driver.getTitle()
      .then(function(title) {
        assert.equal(title, titleMatch, next, 'Expected title to be ' + titleMatch);

// // The “then” condition for our test scenario // //
Then(/^I should be able to click Search in the sidebar $/, function (text, next) {
     this.driver.findElement({ id: 'searchText' }).click();
     this.driver.findElement({ id: 'searchText' }).sendKeys(text).then(next);
  });
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;An important thing to note here is that, if we execute the test with only written the .feature file and nothing else, the cucumber framework will throw us an error and prompt us to define the steps. It states that although we have defined the feature, the step definitions are missing, and it will further suggest us to write the code snippets that turn the phrases defined above into concrete actions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;support.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The support and hooks file is used with the step definition to initialize the variables and perform certain validations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// // This Cucumber.js tutorial support file to perform validations and initialization for our app // //


const { setWorldConstructor } = require('cucumber')

const { seleniumWebdriver } = require('selenium-webdriver');

var firefox = require('selenium-webdriver/firefox');

var chrome = require('selenium-webdriver/chrome');

class CustomWorld {
  constructor() {
    this.variable = 0
  }

function CustomWorld() {

  this.driver = new seleniumWebdriver.Builder()
                  .forBrowser('chrome')
                  .build();
}

setWorldConstructor(CustomWorld)

module.exports = function() {

  this.World = CustomWorld;

  this.setDefaultTimeout(30 * 1000);
};
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;hooks.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It releases the driver when the test execution is complete.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = function() {
  this.After(function() {
    return this.driver.quit();
  });
};
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Finally, when we execute the test, we can see in the command line that our test got executed successfully.&lt;br&gt;&lt;br&gt;
&lt;code&gt;$ npm test&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EYZCLzHE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.lambdatest.com/blog/wp-content/uploads/2020/03/test-senario.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EYZCLzHE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.lambdatest.com/blog/wp-content/uploads/2020/03/test-senario.png" alt="test-senario"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let’s have a look at another example that will perform a search query on google and verify the title of the website to assert whether the correct website is launched in the browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;feature_test2.feature&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Feature: A feature to check on visiting the Google Search website&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Scenario: Visiting the homepage of Google.com Given I have visited the Google homepage. Then I should be able to see Google in the title bar&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;steps_def2.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* This Cucumber.js Tutorial file contains the step definition or the description of each of the behavior that is expected from the application which in our case is the webpage that we are visiting for selenium javascript testing .*/

var assert = require('assert');

// // This scenario has only “given” and “then” condition defined // //

module.exports = function () {
  this.Given(/^I have visited the Google homepage$/, function() {
    return this.driver.get('http://www.google.com');
  });

  this.Then(/^I should be able to see Google in title bar$/, function() {
    this.driver.getTitle().then(function (title) {
      assert.equal(title, "Google");
      return title;
    });
  });
};
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;support2.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// This Cucumber.js tutorial support file is used to perform validations and initialization for our application // 

var seleniumWebdriver = require('selenium-webdriver');

var firefox = require('selenium-webdriver/firefox');

var chrome = require('selenium-webdriver/chrome');

function CustomWorld() {

  this.driver = new seleniumWebdriver.Builder()
                  .forBrowser('chrome')
                  .build();
}

module.exports = function() {

  this.World = CustomWorld;

  this.setDefaultTimeout(30 * 1000);
};
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;hooks2.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = function() {
  this.After(function() {
    return this.driver.quit();
  });
};
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Again, when we execute the test, we can see in the command line that our test got executed successfully.&lt;br&gt;&lt;br&gt;
&lt;code&gt;$ npm test&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3oA0LJty--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.lambdatest.com/blog/wp-content/uploads/2020/03/test-senario1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3oA0LJty--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.lambdatest.com/blog/wp-content/uploads/2020/03/test-senario1.png" alt="test-senario1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kudos! You have successfully executed your first Cucumber.js script for Selenium test automation. However, this Cucumber.js tutorial doesn’t end there! Now that you are familiar with Selenium and Cucumber.js, I want you to think about the scalability issues here.&lt;/p&gt;

&lt;p&gt;So far you have successfully executed the Cucumber.js script over your operating system. However, if you are to perform automated browser testing, how would you go about testing your web-application over hundreds of different browsers + OS combinations?&lt;/p&gt;

&lt;p&gt;You can go ahead and build a Selenium Grid to leverage parallel testing. However, as your test requirements will grow, you will need to expand your Selenium Grid which would mean spending a considerable amount of money over the hardware. Also, every month a new browser or device will be launched in the market. To test your website over them, you would have to build your own device lab.&lt;/p&gt;

&lt;p&gt;All of this could cost you money and time in maintaining an in-house Selenium infrastructure. So what can you do?&lt;/p&gt;

&lt;p&gt;You can leverage a &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-27042020&amp;amp;utm_term=Rana"&gt;Selenium Grid&lt;/a&gt; on-cloud. There are various advantages over choosing cloud-based Selenium Grid over local setup. The most pivotal advantage is that it frees you from the hassle of maintaining your in-house Selenium infrastructure. It’ll save you the effort to install and manage unnecessary virtual machines and browsers. That way, all you need to focus on is running your Selenium test automation scripts. Let us try and execute our Cucumber.js script over an online Selenium Grid on-cloud.&lt;/p&gt;
&lt;h2&gt;
  
  
  Running Cucumber.js Script Over An Online Selenium Grid
&lt;/h2&gt;

&lt;p&gt;It is time that we get to experience a cloud Selenium Grid by getting ourselves trained on executing the test script on LambdaTest, a &lt;a href="https://www.lambdatest.com/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-27042020&amp;amp;utm_term=Rana"&gt;cross browser testing&lt;/a&gt; cloud.&lt;/p&gt;

&lt;p&gt;LambdaTest allows you to test your website on 2000+ combinations of browsers &amp;amp; operating systems, hosted on the cloud. Not only enhancing your test coverage but also saving your time around the overall test execution.&lt;/p&gt;

&lt;p&gt;To run the same script on LambdaTest Selenium Grid, you only need to tweak your Selenium JavaScript testing script a little. As you would now want to specify the hub URL for the Remote WebDriver which would execute your script on our Selenium Grid. Add the username and access key token. For this, we must add the access key token and also the username details in the configuration files i.e. cred.conf.js file present within the conf directory. The username and access key token can be exported in two ways as mentioned below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;cred.conf.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exports.cred = {
    username: process.env.LT_USERNAME || 'rahulr',
    access_key: process.env.LT_ACCESS_KEY || 'AbcdefgSTAYSAFEhijklmnop'
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Alternatively, the username and access key token can be easily exported using the command as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export LT_USERNAME=irohitgoyal

export LT_ACCESS_KEY= AbcdefgSTAYSAFEhijklmnop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Next, we will look at the feature file. We will be executing our test on the Google Chrome browser. In our test case, we will open the LambdaTest website to perform certain operations on it such as launching the search engine, validating the content , etc. So, our directory structure will be pretty simple as below:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;feature_test.feature&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Feature: Google Search the website and check for certain actions Scenario: Perform certain Actions on the homepage When I visit the website of Google on “&lt;a href="https://google.com%E2%80%9D"&gt;https://google.com”&lt;/a&gt; When the homepage has the field with “Google Search” is present When the homepage has the field with “I’m Feeling Lucky” is present When I move the cursor and select the textbox to make a search on Google Then click the “Google Search” on the text box&lt;br&gt;
Then I must see title “Google” on the homepage&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, we need to think of our desired capabilities. We can leverage LambdaTest Selenium Desired Capabilities Generator feature to select the environment specification details and allows us to pick from various combinations that it offers, we can use this to select the combination we want to perform our Selenium javascript testing for this Cucumber.js tutorial.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5EqvvXBI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.lambdatest.com/blog/wp-content/uploads/2020/03/lambdatest-capability-generator.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5EqvvXBI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.lambdatest.com/blog/wp-content/uploads/2020/03/lambdatest-capability-generator.png" alt="lambdatest-capability-generator"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, in our test scenario the desired capabilities class will look something similar as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const desiredCapabilities = {
  'build': 'Cucumber-JS-Selenium-Webdriver-Test', // the build name that is to be display in the test logs
  'browserName': 'chrome', // the browser that we would use to perform test
  'version':'74.0', // the browser version that we would use.
  'platform': 'WIN10', // The type of the Operating System that we would use
  'video': true, // flag to check whether to capture the video selenium javascript testing 
.
  'network': true, // flag to check whether to capture the network logs
  'console': true, // flag to check whether to capture the console logs
  'visual': true // flag to check whether to the capture visual for selenium javascript testing 
};
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;With that set, we now look at the step definitions and the cucumber runner.js.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;step_def.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/*
This Cucumber.js tutorial file contains the step definition or the description of each of the behavior that is expected from the application which in our case is the webpage that we are visiting.
It is aligned with the feature file and reads all the instructions from it and finds the matching case to execute it for selenium javascript testing 

.
*/


'use strict';

const assert = require('cucumber-assert');
const webdriver = require('selenium-webdriver');

module.exports = function() {

  this.When(/^I visit website of Google on "([^"]*)"$/, function (url, next) {
    this.driver.get('https://google.com ').then(next);
  });

  this.When(/^the homepage has the field with "Google Search" is present
$/, function (next) {
      this.driver.findElement({ name: 'li1' })
      .click().then(next);
  });

  this.When(/^the homepage has the field with "I’m Feeling Lucky" is present $/, function (next) {
      this.driver.findElement({ name: 'li3' })
      .click().then(next);
  });

  this.When(/^I move the cursor and select the textbox to make a search on Google $/, function (text, next) {
      this.driver.findElement({ id: 'buttonText' }).click();
      this.driver.findElement({ id: 'buttonText' }).sendKeys(text).then(next);
  });

  this.Then(/^click the "Google Search" on the text box "([^"]*)"$/, function (button, next) {
    this.driver.findElement({ id: button }).click().then(next);
  });

  this.Then(/^I must see title "Google" on the homepage "([^"]*)"$/, function (titleMatch, next) {
    this.driver.getTitle()
      .then(function(title) {
        assert.equal(title, titleMatch, next, 'Expected title to be ' + titleMatch);
      });
  });
};
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;cucumber-runner.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/usr/bin/env/node

//
It resembles our runner file for parallel tests. This file is responsible to create multiple child processes, and  it is equal to the total number of test environments passed for selenium javascript testing 

.
//

let childProcess = require ('child_process') ;
let configFile  = '../conf/' + ( process.env.CONFIG_FILE  || 'single' ) + '.conf.js';
let config = require (configFile ).config;

process.argv[0] = 'node';
process.argv[1] = './node_modules/.bin/cucumber-js';

const getValidJson = function(jkInput) {
    let json = jkInput;
    json = json.replace(/\\n/g, "");
    json = json.replace('\\/g', '');
    return json;
};

let lt_browsers = null;
if(process.env.LT_BROWSERS) {
    let input = getValidJson(process.env.LT_BROWSERS);
    lt_browsers = JSON.parse(input);
}

for( let i in (lt_browsers || config.capabilities) ){
  let env = Object.create( process.env );
  env.TASK_ID = i.toString();
  let p = childProcess.spawn('/usr/bin/env', process.argv, { env: env } ); 
  p.stdout.pipe(process.stdout);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now since our test scripts are ready to be executed in the cloud grid , the final thing that we are required to do is to run the tests from the base project directory using the below command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ npm test&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command will validate the test cases and execute our test suite across all the test groups that we have defined. And, if we open the LambdaTest Selenium Grid and navigate to the automation dashboard, we can check that the user interface shows that the test ran successfully and passed with positive results.&lt;/p&gt;

&lt;p&gt;Below is the sample screenshot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GCK7DPAY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.lambdatest.com/blog/wp-content/uploads/2020/03/sample-screenshot.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GCK7DPAY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.lambdatest.com/blog/wp-content/uploads/2020/03/sample-screenshot.jpg" alt="sample-screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Don’t Forget To Leverage Parallel Testing
&lt;/h2&gt;

&lt;p&gt;Parallel testing with Selenium can help you significantly trim down your test cycles. Imagine if we have at least 50 test cases to execute and each of them runs for an average run time of 1 minute. Ideally, it would take around 50 minutes to execute the test suite. But if we execute 2 test cases in 2 parallel concurrent sessions, the total test time drops down to 25 minutes. Hence, we can see a drastic decrease in test time. To execute the parallel testing with Selenium for this Cucumber.js tutorial, execute the below command &lt;code&gt;$ npm run parallel&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;Cucumber.js provides us the capability to write tests in a way that is easily read by everyone. Making the framework very flexible and enabling us to create human-readable descriptions of user requirements as the basis for web application tests. WIth Cucumber.js we can interact with our webpage on the browser and make various assertions to verify that the changes we performed are actually reflected in our web application on every Browser-OS combination by utilizing Selenium Grid. Still, there is a lot more that can be done with Cucumber.js. Since this test framework is developed over the Selenium interface, it empowers us with limitless capabilities in terms of Selenium JavaScript testing. Let us know if you liked this Cucumber.js tutorial and if there’s any topic you want us to write on. &lt;strong&gt;Happy Testing and Stay Safe!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>java</category>
      <category>tutorial</category>
      <category>developer</category>
    </item>
    <item>
      <title>Why Selenium Automation Testing In Production Is Pivotal For Your Next Release?</title>
      <dc:creator>Nate-Grey</dc:creator>
      <pubDate>Wed, 08 Apr 2020 13:24:15 +0000</pubDate>
      <link>https://dev.to/nategrey/why-selenium-automation-testing-in-production-is-pivotal-for-your-next-release-2l2k</link>
      <guid>https://dev.to/nategrey/why-selenium-automation-testing-in-production-is-pivotal-for-your-next-release-2l2k</guid>
      <description>&lt;p&gt;Do you think that just because your web application passed in your staging environment with flying colors, it’s going to be the same for your Production environment too? You might want to rethink that!&lt;br&gt;&lt;br&gt;
Especially, if we refer to &lt;a href="https://www.lambdatest.com/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-08042020&amp;amp;utm_term=Rana"&gt;cross browser testing&lt;/a&gt;, where you need to ensure that your web-application is rendered seamlessly across a variety of different browsers, browser versions, running over different operating systems. After all, you may never know what bugs are your customers are facing till you actually test in production, right?&lt;/p&gt;

&lt;p&gt;However, it is easier said than done. As an agile tester, you get new testing requirements on a bi-monthly, weekly, or even daily basis. If you keep your focus on testing in production alone, then who is going to take care of the testing in stage environments? Which is why you are required to test in production, along with the staging environment. From experience, I know it can be an exhausting and overwhelming journey if done manually. Fortunately, we have got Selenium test automation to back us up. How?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0Mx44pMj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/02/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0Mx44pMj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/02/giphy.gif" alt="tell me how gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is exactly what I am going to talk about in today’s article. This article will help you understand why automating test in production is pivotal for your next release!&lt;/p&gt;

&lt;h2&gt;
  
  
  So, What Exactly Is Testing In Production (TiP)?
&lt;/h2&gt;

&lt;p&gt;If you are just beginning your tester’s journey, there is a good chance that you may not know the SDLC(Software Development Life Cycle) and you may wonder about what is Production? What do we test in Production?&lt;/p&gt;

&lt;p&gt;Well, every web-application is cloned over different environments. One for developers, one for testers, and one for your customers. The web-application which interacts with your customers is referred to as the Production environment while the others are called Staging environments. So whenever a new enhancement is up into a release cycle, it first is deployed in the stage environment belonging to the developers, where they could unit test their change. Once validated the changes are pushed to a staging environment belonging to testers where they could perform detailed integration &amp;amp; regression testing to validate the code changes. Once the sign off is passed from the testing team, the changes are queued for the Production environment where your customers could use the latest feature added to your web-application.&lt;/p&gt;

&lt;p&gt;Although the testing team performs a detailed round of testing in the staging environment, once the changes are pushed to the Production environment, they are supposed to perform another detailed round of testing to make sure the user experience of their customers is not hampered. This final round of testing is referred to as testing in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do we test in production?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pretty much anything &amp;amp; everything. Other than the test scripts validated over the staging environment, testing in production also includes all the test cases which couldn’t have been identified or predicted earlier than the production environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  But You Already Tested On Stage, So Why Should You Test in Production?
&lt;/h2&gt;

&lt;p&gt;You can write as many cases as you want, but it won’t be enough to replicate the live production environment. It’s not easy to reproduce customer data or predict their behavior. Not to forget, your staging environment may not be exposed to as much live-traffic as your production environment. Similarly, if your staging environment is not an exact clone of your production(which is true for most cases!!), then there is a good possibility that you may miss a cross browser incompatible CSS property while going live, or worse, a bunch of them.&lt;/p&gt;

&lt;p&gt;Which is why cross browser testing in production becomes indispensable for every release cycle. However, to test your web-application over hundreds of browsers + operating systems if not monotonous would certainly be exhausting. A lot of times, you may even end-up performing browser compatibility testing at the 11th hour due to an overnight hotfix for an outage urgency and lack of time, consequently, you may end up doing just smoke testing instead of regression. Well, if that is the case, you can pretty much expect a browser bug coming your way.&lt;/p&gt;

&lt;p&gt;Let’s take a real-time scenario to understand this better. Your DevOps team has prepared the pipeline to deploy the latest code changes into your web application. And it’s up to you to test them in multiple staging environments before it finally goes live in the production environment. While in staging you test it across all the major browsers, let’s say all the latest versions of Google Chrome, Mozilla Firefox and others rolled out across the last year. You do a quick smoke test, and everything seems to work fine. Your web application goes live and you just sit back and relax thinking that everything is done and dusted. And thus the days go by!&lt;/p&gt;

&lt;p&gt;Do you see what’s going wrong in the above case? You guessed it right! You clearly missed old versions of the browsers, now all of your users in the old version might be going nuts. They’re leaving your web application, the number of outage tickets soars high.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WNxjikcZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/02/giphy-1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WNxjikcZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2020/02/giphy-1.gif" alt="i sense much fear in you"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No need to panic, we’ve got your back! (We’ll be Yoda to your Luke Skywalker)&lt;/p&gt;

&lt;p&gt;To tackle this issue, you need to make sure you have the Selenium test automation suite ready to be executed on our online Selenium Grid with zero downtime. Using an online Selenium Grid to perform &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-08042020&amp;amp;utm_term=Rana"&gt;automated browser testing&lt;/a&gt; in production can help you clear a major hurdle of time-spent over the maintenance of your in-house Selenium Grid, individually testing functionalities of your web application across different operating systems/devices/browsers. This helps you to ensure that you validate your product’s cross browser compatibility in the production.&lt;/p&gt;

&lt;p&gt;Long story short, you can’t afford to neglect Selenium test automation in production. With that said, let us have a look at the benefits of Selenium test automation in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits Of Selenium Test Automation In Production
&lt;/h2&gt;

&lt;p&gt;By far, we know that it becomes mandatory to test your web applications in production. But do we need to automate it? What are the benefits of Selenium test automation, let us have a look.&lt;/p&gt;

&lt;h3&gt;
  
  
  Daily Monitoring
&lt;/h3&gt;

&lt;p&gt;With the convenience of Selenium test automation, it becomes fairly easy to not only test your web-application but also monitor the results of those tests on a daily basis. LambdaTest offers an intuitive dashboard to help you analyze the results of your Selenium test automation suite execution over our online Selenium Grid. You can see all the time-stamps, along with a variety of logs to help you quickly debug any issue encountered by your Selenium testing script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Find Critical Edge Cases To Ensure A Robust User Experience
&lt;/h2&gt;

&lt;p&gt;Selenium test automation can help you find bugs in production before it can affect user experience for any visitor or customer. Since it would be very difficult to replicate the real-time user case scenarios and user data, testing in production helps to identify unique test cases that wouldn’t have been identified otherwise.&lt;/p&gt;

&lt;h3&gt;
  
  
  Schedule Selenium Test Automation At Peak Hours
&lt;/h3&gt;

&lt;p&gt;Selenium test automation in the production environment can help you schedule a thorough round of automated browser testing during your web application’s peak hours. Thus helping to ensure the quality at all times.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ease Out Regression Testing Effort
&lt;/h3&gt;

&lt;p&gt;Selenium test automation can help you eliminate the hassle involved in a regression testing cycle. That way, every time a new code is committed to your production, all you would have to do is run your Selenium testing scripts and everything will be validated across different browsers automatically. That isn’t all !! Leveraging Selenium test automation would also allow you to execute Beta programs faster, so you could attain feedback instantly over the newly rolled out features and user experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Leverage Selenium Grid For A Faster Go-to-Market Launch
&lt;/h3&gt;

&lt;p&gt;Unlike Selenium WebDriver, Selenium Grid can help you execute test automation in parallel. This becomes critical for big and small companies alike. Every release cycle will add something new to your web-application which means there would be more test cases to automate. Eventually, you will hit a wall if you rely on sequential test execution through your Selenium testing scripts. By leveraging Selenium Grid, you can run as many test cases in parallel as you want which can drastically reduce your test cycle executions, leading to a faster go-to-market launch.&lt;/p&gt;

&lt;h2&gt;
  
  
  If Testing In Production Is That Cool Then Why Do We Hesitate?
&lt;/h2&gt;

&lt;p&gt;The reality is, in a lot of companies the testing team often hesitate or rather neglect testing in production. There could be multiple reasons behind that. One is that the life of an &lt;a href="https://www.toolshero.com/information-technology/scrum-agile-methodology/"&gt;agile&lt;/a&gt; tester is harsh, every week or month their test requirements are only going to get bigger. Another reason is the exertion caused by the test cycles under staging environments. After testing a humongous test suite, it becomes a frustrating experience to test the same thing over in production. Along with all the new things over your testing checklist. So testers believe a round of smoke testing is better if a major issue might come then it is going to get reported anyhow by the customers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Strategies To Perform Testing In Production
&lt;/h2&gt;

&lt;p&gt;Now, that we are done realizing the emphasis of testing in production. The next question that comes is around the implementation.!! How do I begin Selenium testing in production? What kind of strategies can I use? Let’s further explore the strategies or methods to perform testing in production.&lt;/p&gt;

&lt;h3&gt;
  
  
  Blue-Green Deployment
&lt;/h3&gt;

&lt;p&gt;In this strategy, deployment is done in two similar production environments that are blue and green which are identical to one another. At any time only one of the environments is active which serves all the production. In this case, blue gets all the production traffic and green which is a clone of blue stays idle. All the testing takes place in the idle state i.e. green, once the testing is completed in green all the traffic is routed to it and it becomes the new production.&lt;/p&gt;

&lt;h3&gt;
  
  
  Canary Testing
&lt;/h3&gt;

&lt;p&gt;In canary testing, the new features are rolled out only to a small group of end-users. When it is made sure that the web application works fine in the targeted group, the changes are then rolled over to the complete set of traffic.&lt;/p&gt;

&lt;h3&gt;
  
  
  A/B Testing
&lt;/h3&gt;

&lt;p&gt;In A/B testing you roll out two different versions of the web application to the end-users. One version can be the old one and the other can be the new rolled out features. Then you further analyze which version performs better, basis that you keep the version that performs better.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automated Rollback Strategy
&lt;/h3&gt;

&lt;p&gt;In this strategy, you return the web application to the previous stable version whenever you discover a failure, while you are still in the monitoring phase. Upon correct implementation, a rollback can help you achieve the previous stable app state but a poor implementation can cause the data loss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices For Selenium Test Automation In Production
&lt;/h2&gt;

&lt;p&gt;I know you are now pumped to hit the accelerator and can’t wait to write the Selenium test automation suite for your production environment. However, there are a few pointers that you need to note down as best practices for Selenium test automation in the Production environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Find The Right Selenium Testing Tool
&lt;/h3&gt;

&lt;p&gt;Picking the right Selenium testing tool plays a pivotal role in the successful implementation of a test strategy and thus making it either a success or a failure. The right testing tool along with an efficient DevOps process can ensure a smooth operation at every stage ranging from development to production. Bringing in all the stakeholders and explaining to them the necessity of production testing would be very crucial. A Selenium testing tool such as LambdaTest not only helps you in testing your web-application over 2000+ real browsers. It also helps to integrate with numerous third-party tools for CI/CD, project management, instant messaging, codeless automation, and more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Establish A Monitoring Process
&lt;/h3&gt;

&lt;p&gt;Just because you’ve deployed your automation strategy, doesn’t mean that you get to sit back and relax. Even after the correct implementation of your strategy and testing methods some errors are always bound to get missed. You need to continuously monitor the results of your testing in production.&lt;/p&gt;

&lt;p&gt;Keep an eye on how your web application responds to high traffic, along with the server and database performance. Effective monitoring of the application can give you deeper insight into the product and help identify and mitigate any major bugs and issues that arise from time to time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ensure An Active Alert Mechanism
&lt;/h3&gt;

&lt;p&gt;In case things go south in your production environment, make sure to have a notification or alert system configured in your Selenium test automation process. Leverage CI/CD tools such as Jenkins which can alert the right individual as soon as an issue is identified, you can find and fix the issue as soon as possible. Without this automation, the bugs and defects might go unnoticed and hamper your user experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Feature Flag
&lt;/h3&gt;

&lt;p&gt;By using feature flags, you can use if/then statement to wrap the features. This gives you more control over the feature, by isolating the effect of the feature on the system, you can turn the feature on/off independent of deployment. This separates feature rollout from code deployment.&lt;/p&gt;

&lt;p&gt;Once the new code is deployed by using a feature flag, the feature can be then tested whenever required in the live environment. This gives you more control over the feature and its impact on the code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Incorporate POM(Page Object Model)
&lt;/h3&gt;

&lt;p&gt;It is often neglected by a Page Object Model that is necessary for your Selenium test automation in Production. You need to use a Page Object Model so that all your UI element locators are stored at one place which makes it easier for the WebDriver to leverage &lt;a href="https://www.lambdatest.com/blog/locators-in-selenium-webdriver-with-examples/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-08042020&amp;amp;utm_term=Rana"&gt;Selenium locators&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Incorporate Gherkin For BDD
&lt;/h3&gt;

&lt;p&gt;Many times testers ignore language parsers such as Gherkin as they feel it is simply more work to write logic separately than the code. However, it can be extremely helpful for the non-programming stakeholders involved in the process. They can evaluate how your Selenium test automation scripts are impacting the overall system validation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Always Have An Option To Perform A Version Rollback
&lt;/h3&gt;

&lt;p&gt;Make sure you prevent any major issues with better stability and recovery testing. Ensuring that the web application can recover from uncertain events without any loss of important functionality and crucial data. In the event that any new rolled out feature affects the old feature, you need to make sure that you can roll it back efficiently without loss of data.&lt;/p&gt;

&lt;h2&gt;
  
  
  All in All
&lt;/h2&gt;

&lt;p&gt;The main agenda of testing in production is to make sure that your web applications are stable in the live environment. In order to avoid an outage, you need to automate your test scripts to make sure that your web application is tried and tested in all of the latest and legacy browsers. A Selenium grid is a great way to do it. With Selenium Grid, you can automate test scripts across all the browsers. Not only will it help you automate the repetitive test cases but it can also help us in executing them in parallel. Ultimately, trimming down the overall time-consumption over your test cycles. In case things go south, make sure you have the option to rollback to the previously deployed version of your web application. Cheers and happy testing! 🙂&lt;/p&gt;

&lt;p&gt;&lt;a href="https://accounts.lambdatest.com/register/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Rana-08042020&amp;amp;utm_term=Rana"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uyxS72yg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.lambdatest.com/blog/wp-content/uploads/2020/01/Cross-Browser-Testing-Tool-min.jpg" alt="cross_browser_testing_tool"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
