<?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: Unmesh Gundecha</title>
    <description>The latest articles on DEV Community by Unmesh Gundecha (@upgundecha).</description>
    <link>https://dev.to/upgundecha</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%2F31105%2F81862d5e-b7b8-4ccb-9cbb-4ccf5f750eca.jpg</url>
      <title>DEV Community: Unmesh Gundecha</title>
      <link>https://dev.to/upgundecha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/upgundecha"/>
    <language>en</language>
    <item>
      <title>AWS services for SREs</title>
      <dc:creator>Unmesh Gundecha</dc:creator>
      <pubDate>Thu, 27 Oct 2022 04:44:26 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-services-for-sres-19bn</link>
      <guid>https://dev.to/aws-builders/aws-services-for-sres-19bn</guid>
      <description>&lt;p&gt;SREs using the AWS platform have access to a wide range of tools for creating, running, and managing systems &amp;amp; services in the cloud. This blog post examines some of AWS's essential services and features that SREs can utilize.&lt;/p&gt;

&lt;h4&gt;
  
  
  Amazon CloudWatch
&lt;/h4&gt;

&lt;p&gt;Monitoring and observability is a crucial tenets of System Reliability Engineering (SRE). The AWS CloudWatch is a monitoring service available in the AWS platform to SREs for effective monitoring of systems and services. It enables SREs to watch and understand the state of their systems. Monitoring is based on gathering predefined sets of metrics or logs. Observability enables SREs to debug their system actively. AWS CloudWatch is the most popular and essential monitoring solution in AWS.&lt;/p&gt;

&lt;p&gt;SREs can monitor and manage on-premises, hybrid, and AWS application or resource with the Amazon CloudWatch. CloudWatch offers data and valuable insights. Instead of keeping track of them separately, SREs can gather and access all of operational and performance data from a single platform in the form of logs and metrics (server, network, or database). Applications, infrastructure, and services can all be monitored with CloudWatch, and SREs can leverage alarms, logs, and events data to automate actions and speed up mean time to resolution (MTTR).&lt;/p&gt;

&lt;p&gt;You can find more about AWS CloudWatch &lt;a href="https://aws.amazon.com/cloudwatch/"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  AWS Systems Manager
&lt;/h4&gt;

&lt;p&gt;Driving Toil out of the system is another key tenet of SREs. The term &lt;strong&gt;Toil&lt;/strong&gt; refers to tedious, repetitive tasks associated with running a production environment. Site Reliability Engineering (SRE) teams strive to minimize or even eliminate Toil to maximize the time spent on engineering and innovation.&lt;/p&gt;

&lt;p&gt;AWS Systems Manager enables SREs to automate processes across AWS resources and centralizes operational data from several AWS services. SREs can arrange resources into logical categories, such as apps, various application stack layers, or development and production environments. The resource group's current API activity, resource configuration changes, related notifications, operational alerts, software inventory, and patch compliance status may all be viewed in Systems Manager by selecting the resource group. &lt;/p&gt;

&lt;p&gt;You can find more about AWS Systems Manager &lt;a href="https://aws.amazon.com/systems-manager/"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  AWS Systems Manager Incident Manager
&lt;/h4&gt;

&lt;p&gt;Performance problems and unplanned outages can happen to systems, online applications, servers, devices, etc., at some point. For SREs, it is anticipated such failures will occur, and they cannot be avoided as a fact. Moreover, these unexpected failures can result in significant revenue losses, a loss of customer confidence, and, depending on the industry sector, possible fines. Therefore, SREs use incident management as one of the fundamental techniques to reduce the disturbance brought on by unforeseen problems.&lt;/p&gt;

&lt;p&gt;The AWS Systems Manager Incident Manager service enables incident management for SREs.&lt;/p&gt;

&lt;p&gt;Critical application availability and performance issues can be resolved more quickly with the Incident Manager from AWS Systems Manager. Automatic reaction plans that coordinate the appropriate on-call engineers and information aids SREs in incident preparation. For example, when a significant issue is discovered by an Amazon Eventbridge event or an alarm from Amazon CloudWatch, it can automatically respond with Incident Manager. In addition to executing AWS Systems Manager Automation runbooks, Incident Manager links selected chat channels using AWS Chatbot and activate pre-configured response plans to engage responders via SMS and phone calls. By recommending post-event action items like automating a runbook step or adding a new alert, Issue Manager, which was developed at Amazon based on decades of experience in incident response and analysis, aids SREs in increasing service reliability.&lt;/p&gt;

&lt;p&gt;You can find more about AWS Systems Manager &lt;a href="https://aws.amazon.com/systems-manager/features/incident-manager/"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Amazon Managed Service for Prometheus
&lt;/h4&gt;

&lt;p&gt;Prometheus is a popular monitoring tool for microservices, distributed systems, and container workloads.&lt;/p&gt;

&lt;p&gt;Amazon offers managed service for Prometheus for monitoring and alerting, offering information and valuable insights for container environments that are widely used. SREs can gather and access performance and operational data from container workloads running on AWS and on-premises using Amazon Managed Service for Prometheus. The well-known open-source Prometheus project from the Cloud Native Computing Foundation (CNCF) is entirely compatible with Amazon Managed Service for Prometheus. As Prometheus is an AWS-managed service, it makes it easier to deploy and set up Prometheus. In addition, it automates many routine operations and maintenance for SREs.&lt;/p&gt;

&lt;p&gt;Amazon Managed Service for Prometheus automatically adapts when the container workloads scale up and down to provide cost-effective performance metrics and reliable query response times. &lt;/p&gt;

&lt;p&gt;You can find more about AWS Managed Prometheus &lt;a href="https://aws.amazon.com/prometheus/"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Amazon Managed Service for Grafana
&lt;/h4&gt;

&lt;p&gt;SREs need operational dashboards that connect them with monitoring and observability tools to visualize system performance, key metrics, and alerts.&lt;/p&gt;

&lt;p&gt;Based on open-source Grafana, Amazon Managed Grafana is a highly scalable, highly available, and fully managed service that offers interactive data visualization of operational and monitoring data. SREs can view, analyze, and set alarms on crucial metrics, logs, and traces gathered from various data sources in the observability system, including AWS, third-party ISVs, and other resources across environments and applications using Amazon Managed Grafana. By automating scalability compute and database infrastructure as usage demands increase, with automated version upgrades and security patching, Amazon Managed Grafana offloads the operational management of Grafana.&lt;/p&gt;

&lt;p&gt;You can find more about AWS Managed Grafana &lt;a href="https://aws.amazon.com/grafana/"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  AWS Fault Injection Simulator
&lt;/h4&gt;

&lt;p&gt;SREs aim to minimize downtime and ensure that systems operate as planned. One of the critical objectives of SRE teams is to ensure that systems can maintain their Service-Level Objectives (SLOs), which are the particular metrics SRE teams target to achieve the business SLAs, and Service-Level Agreements (SLAs), the system uptime provided to consumers.&lt;/p&gt;

&lt;p&gt;SRE teams get important system dependability insights by introducing actual failures within the confines of a chaos engineering experiment. These insights wouldn't be possible through solely theoretical modeling. SREs can apply the real post-incident procedure to real system outputs to acquire a more realistic perspective of the system's condition and capabilities rather than dealing with hidden infrastructure flaws that can lead to incidents—or, worse still, running into them during incident.&lt;/p&gt;

&lt;p&gt;AWS Fault Injection Simulator (FIS) is a fully managed service for running chaos engineering experiments to improve an application's performance, observability, and resiliency. FIS simplifies setting up and running controlled experiments across various AWS services so SREs can build confidence in their application behavior.&lt;/p&gt;

&lt;p&gt;SREs can use AWS FIS for defining and running Chaos Engineering experiments to build resilient systems and services.&lt;/p&gt;

&lt;p&gt;You can find more about AWS Fault Injection Simulator &lt;a href="https://aws.amazon.com/fis/"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sre</category>
      <category>cloudwatch</category>
      <category>sam</category>
      <category>fis</category>
    </item>
    <item>
      <title>How They SRE</title>
      <dc:creator>Unmesh Gundecha</dc:creator>
      <pubDate>Wed, 17 Feb 2021 14:07:37 +0000</pubDate>
      <link>https://dev.to/upgundecha/how-they-sre-37de</link>
      <guid>https://dev.to/upgundecha/how-they-sre-37de</guid>
      <description>&lt;p&gt;I’m curating engineering blog posts, videos, and other cool resources on Site Reliability Engineering and DevOps in a GitHub repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/upgundecha/howtheysre"&gt;https://github.com/upgundecha/howtheysre&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sre</category>
      <category>sitereliabilityengineering</category>
      <category>devops</category>
      <category>chaosengineering</category>
    </item>
    <item>
      <title>More Selenium4 Goodies</title>
      <dc:creator>Unmesh Gundecha</dc:creator>
      <pubDate>Mon, 14 Oct 2019 14:00:04 +0000</pubDate>
      <link>https://dev.to/upgundecha/more-selenium4-goodies-1lke</link>
      <guid>https://dev.to/upgundecha/more-selenium4-goodies-1lke</guid>
      <description>&lt;p&gt;After my previous post on &lt;a href="https://dev.to/upgundecha/selenium4-relative-locators-ml3"&gt;Selenium 4 Relative Locators&lt;/a&gt;, I further explored Selenium4 features and found a few more goodies in WebElement and WebDriver interfaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Element Screenshots
&lt;/h2&gt;

&lt;p&gt;Yes, now we can capture screenshot of an individual element or group of elements. This is a very useful feature.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;WebElement&lt;/code&gt; interface now supports &lt;code&gt;getScreenShotAs()&lt;/code&gt; method by implementing the &lt;code&gt;TakesScreenshot&lt;/code&gt; interface to capture a screenshot of the element.&lt;/p&gt;

&lt;p&gt;This method accepts the &lt;code&gt;OutputType&lt;/code&gt; argument and screenshots can be captured as FILE, BYTES or BASE64 string.&lt;/p&gt;

&lt;p&gt;Let's try to capture screenshot of a link and the search box displayed on Google Search Home page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6BLrDdYN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tyuitbu18eni8gzplxpu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6BLrDdYN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tyuitbu18eni8gzplxpu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="c1"&gt;// find the Images link on Google Search home page&lt;/span&gt;
&lt;span class="nc"&gt;WebElement&lt;/span&gt; &lt;span class="n"&gt;imagesLink&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;By&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;linkText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Images"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

&lt;span class="c1"&gt;// take a screenshot of the link element&lt;/span&gt;
&lt;span class="nc"&gt;File&lt;/span&gt; &lt;span class="n"&gt;linkScr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;imagesLink&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getScreenshotAs&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;FILE&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;FileUtils&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;copyFile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;linkScr&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"./target/linkScr.png"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We can also capture a group of elements by taking a screenshot of the parent element. Here is a complete example capturing the Images link and the search box:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Test&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;elementScreenShot&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="c1"&gt;// find the Images link on Google Search home page&lt;/span&gt;
    &lt;span class="nc"&gt;WebElement&lt;/span&gt; &lt;span class="n"&gt;imagesLink&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;By&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;linkText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Images"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

    &lt;span class="c1"&gt;// take a screenshot of the link element&lt;/span&gt;
    &lt;span class="nc"&gt;File&lt;/span&gt; &lt;span class="n"&gt;linkScr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;imagesLink&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getScreenshotAs&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;FILE&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="nc"&gt;FileUtils&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;copyFile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;linkScr&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"./target/linkScr.png"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

    &lt;span class="c1"&gt;// find the Search box which is a &amp;lt;form&amp;gt; element&lt;/span&gt;
    &lt;span class="nc"&gt;WebElement&lt;/span&gt; &lt;span class="n"&gt;searchBox&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;By&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"tsf"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

    &lt;span class="c1"&gt;// take a screenshot of the Search box&lt;/span&gt;
    &lt;span class="nc"&gt;File&lt;/span&gt; &lt;span class="n"&gt;searchBoxScr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;By&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"tsf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
            &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getScreenshotAs&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;FILE&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="nc"&gt;FileUtils&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;copyFile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;searchBoxScr&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"./target/searchBox.png"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  The new &lt;code&gt;getRect()&lt;/code&gt; method
&lt;/h2&gt;

&lt;p&gt;The new &lt;code&gt;getRect()&lt;/code&gt; method is introduced in &lt;code&gt;WebDriver&lt;/code&gt; interface which is essentially a combination of previous &lt;code&gt;getSize()&lt;/code&gt; and &lt;code&gt;getLocation()&lt;/code&gt; methods. Here's a difference between previous methods and new the &lt;code&gt;getRect()&lt;/code&gt; method which returns a &lt;code&gt;Rectangle&lt;/code&gt; object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Test&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;elementRectTest&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="c1"&gt;// find the Images link on Google Search home page&lt;/span&gt;
    &lt;span class="nc"&gt;WebElement&lt;/span&gt; &lt;span class="n"&gt;imagesLink&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;By&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;linkText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Images"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

    &lt;span class="c1"&gt;// previous getSize() and getLocation() methods&lt;/span&gt;
    &lt;span class="nc"&gt;Dimension&lt;/span&gt; &lt;span class="n"&gt;elementSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;imagesLink&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getSize&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Element height is "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;elementSize&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getHeight&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Element width is "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;elementSize&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getWidth&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;

    &lt;span class="nc"&gt;Point&lt;/span&gt; &lt;span class="n"&gt;elementLocation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;imagesLink&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getLocation&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Element X Pos "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;elementLocation&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getX&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Element Y Pos "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;elementLocation&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getY&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;


    &lt;span class="c1"&gt;// new getRect() method&lt;/span&gt;
    &lt;span class="nc"&gt;Rectangle&lt;/span&gt; &lt;span class="n"&gt;elementRect&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;imagesLink&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getRect&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Element height is "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;elementRect&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getHeight&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Element width is "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;elementRect&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getWidth&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Element X Pos "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;elementRect&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getX&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Element Y Pos "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;  &lt;span class="n"&gt;elementRect&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getY&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;

&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  New additions in WebDriver
&lt;/h2&gt;

&lt;p&gt;In addition, to &lt;code&gt;maximize()&lt;/code&gt; method, the browser window can now be made fullscreen by using the new &lt;code&gt;fullscreen()&lt;/code&gt; method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;manage&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;window&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;fullscreen&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;A new &lt;code&gt;parentFrame()&lt;/code&gt; method is added for navigating between frames.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;switchTo&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;parentFrame&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I'm not really sure if this is completely new feature (or maybe I'm too lazy to go through the changes) but we can now create a new empty tab or new browser window by using the &lt;code&gt;newWindow()&lt;/code&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;switchTo&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;newWindow&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;WindowType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;TAB&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;switchTo&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;newWindow&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;WindowType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;WINDOW&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That's it for now. I'll deep dive into new Selenium Grid features in an upcoming post.&lt;/p&gt;

&lt;h3&gt;
  
  
  Closing note
&lt;/h3&gt;

&lt;p&gt;These features are in alpha release and subject to change in future. Please use with caution. You can find the complete code example from this post in my GitHub repo &lt;a href="https://github.com/upgundecha/selenium4"&gt;https://github.com/upgundecha/selenium4&lt;/a&gt;&lt;/p&gt;

</description>
      <category>selenium</category>
      <category>webdriver</category>
      <category>testautomation</category>
      <category>selenium4</category>
    </item>
    <item>
      <title>Gherkin Dialects</title>
      <dc:creator>Unmesh Gundecha</dc:creator>
      <pubDate>Sat, 12 Oct 2019 01:47:07 +0000</pubDate>
      <link>https://dev.to/upgundecha/gherkin-dialects-505b</link>
      <guid>https://dev.to/upgundecha/gherkin-dialects-505b</guid>
      <description>&lt;p&gt;One of the core principles of Behaviour Driven Development (BDD) is having meaningful conversations to describe the behaviour of the software with concrete examples.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;…having conversations are more important than capturing conversations is more important than automating conversations. – &lt;a href="https://lizkeogh.com/2014/01/22/using-bdd-with-legacy-systems/"&gt;Liz Keogh&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;BDD practitioners have a choice to select a language that is commonly used and understood by the team to describe the behaviour of the software.&lt;/p&gt;

&lt;p&gt;Gherkin, the ubiquitous language used by BDD practitioners to describe the behaviour of software, has been translated to over 70 languages.&lt;/p&gt;

&lt;p&gt;In order to allow Gherkin to be written in a number of languages, the keywords such as Feature, Background, Scenario, Scenario Outline, Given, When, Then, And, But, Examples have been translated into multiple languages.  Find more about the languages supported by Gherkin and keywords translated in these languages at &lt;a href="https://cucumber.io/docs/gherkin/reference/#overview"&gt;https://cucumber.io/docs/gherkin/reference/#overview&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some of these keywords have more than one translation to improve readability and flow.&lt;/p&gt;

&lt;p&gt;Let’s take a personal loan calculator application. The feature and scenario are described in the English language as below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rdUVngUz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ql54ai5coowodg8qirqh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rdUVngUz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ql54ai5coowodg8qirqh.png" alt="Feature in English"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let’s translate the behaviour of a personal loan calculator in Hindi (one of my native languages):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q_Yat_Sb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/stxnlh5wwth3q5at7nwm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q_Yat_Sb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/stxnlh5wwth3q5at7nwm.png" alt="Feature In Hindi"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Automating conversations with Cucumber
&lt;/h2&gt;

&lt;p&gt;Cucumber framework, the widely used tool by BDD practitioners supports Gherkin dialects.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;# language:&lt;/code&gt; header on the first line of a feature file tells Cucumber what spoken language to use while generating step definitions. &lt;/p&gt;

&lt;p&gt;To automate this feature and scenario, Cucumber will generate step definitions in the selected language. In this example, it uses Hindi as shown in below code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--txUwECdd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/1okcs5td32wqb6ruiaz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--txUwECdd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/1okcs5td32wqb6ruiaz3.png" alt="Cucumber-JVM Step definitions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this case, both Cucumber and Java support internationalization and example is automated with Selenium WebDriver, navigating to the Hindi version of the personal loan calculator and checking the behaviour of the software.&lt;/p&gt;

&lt;p&gt;Along with Java, the Gherkin dialect (i18N) support is available in supporting programming languages such as Ruby, Python, Go, DotNet, etc.&lt;/p&gt;

&lt;p&gt;The working example is available in GitHub Repo &lt;a href="https://github.com/upgundecha/cucumber-gherkin-hindi"&gt;https://github.com/upgundecha/cucumber-gherkin-hindi&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cucumber</category>
      <category>bdd</category>
      <category>softwaredevelopment</category>
      <category>selenium</category>
    </item>
    <item>
      <title>Selenium4 Relative Locators</title>
      <dc:creator>Unmesh Gundecha</dc:creator>
      <pubDate>Wed, 02 Oct 2019 14:21:41 +0000</pubDate>
      <link>https://dev.to/upgundecha/selenium4-relative-locators-ml3</link>
      <guid>https://dev.to/upgundecha/selenium4-relative-locators-ml3</guid>
      <description>&lt;p&gt;Selenium 4 alpha-3 is released yesterday with much-awaited friendly locators, now called as relative locators feature. These new locator methods will find elements based on their location relative to other elements, visually!  You can find the desired element or elements by passing &lt;code&gt;withTagName&lt;/code&gt; method along with &lt;code&gt;near&lt;/code&gt;, &lt;code&gt;above&lt;/code&gt;, &lt;code&gt;below&lt;/code&gt;, &lt;code&gt;toRight&lt;/code&gt; and &lt;code&gt;toLeft&lt;/code&gt; methods. These methods take the relative &lt;code&gt;WebElement&lt;/code&gt; or &lt;code&gt;By&lt;/code&gt; locator as an argument.  The overloaded &lt;code&gt;near&lt;/code&gt; method takes the pixel distance as an additional argument. I did a trial run of this cool new feature on a sample app:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wk1wRuJn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/j1xke22tkzt2ji1pd4u4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wk1wRuJn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/j1xke22tkzt2ji1pd4u4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the sample application, to find the input field which is right of the label Hight in Centimeters, we'll first locate the label using the &lt;code&gt;By.cssSelector&lt;/code&gt; method. Next, we will use the located element to find the input field. For this we will call the &lt;code&gt;withTagName&lt;/code&gt; method along with &lt;code&gt;rightOf&lt;/code&gt; method passing the label WebElement as shown in below snippet:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QVC2QGJy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/i2m2py01uxecbyks7wc2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QVC2QGJy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/i2m2py01uxecbyks7wc2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;WebElement&lt;/span&gt; &lt;span class="n"&gt;heightLabel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;By&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;cssSelector&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"label[for='heightCMS']"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

&lt;span class="nc"&gt;WebElement&lt;/span&gt; &lt;span class="n"&gt;heightInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;withTagName&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"input"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toRightOf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;heightLLabel&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

&lt;span class="n"&gt;heightInput&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sendKeys&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"181"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;We can also combine the relative locator methods to narrow down the search as shown in below code to find the input field to enter weight. The weight field is below hight input and right of weight label:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;WebElement&lt;/span&gt; &lt;span class="n"&gt;weightInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;   &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;withTagName&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"input"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;below&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;heightInput&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;toRightOf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;weightLabel&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The new locator methods will be very handy to find elements based on their relative location on the screen. &lt;/p&gt;

&lt;p&gt;Selenium uses JavaScript method &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect"&gt;getBoundingClientRect&lt;/a&gt; to find the elements using Relative Locators.&lt;/p&gt;

&lt;p&gt;You can find the example test in my GitHub repo &lt;a href="https://github.com/upgundecha/selenium4"&gt;https://github.com/upgundecha/selenium4&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to know more about these new locators and sample usage, find more details in &lt;a href="https://github.com/SeleniumHQ/selenium/blob/master/java/client/test/org/openqa/selenium/support/locators/RelativeLocatorTest.java"&gt;Selenium test base&lt;/a&gt; (tests are living documentation).&lt;/p&gt;

&lt;h3&gt;
  
  
  Closing note
&lt;/h3&gt;

&lt;p&gt;The relative locators should be used wisely when other methods won't work. The features in alpha releases may change in future releases. Also, these methods may not work well on overlapping elements.&lt;/p&gt;

&lt;p&gt;This is not an entirely new concept. There are other tools in both commercial and open-source space offering similar features to locate element based on visual cues.&lt;/p&gt;

</description>
      <category>selenium</category>
      <category>webdriver</category>
      <category>hacktoberfest</category>
    </item>
  </channel>
</rss>
