<?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: milagros</title>
    <description>The latest articles on DEV Community by milagros (@milagrosbrz).</description>
    <link>https://dev.to/milagrosbrz</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%2F283943%2F66a9063b-161d-4e55-9518-f0107c875597.jpeg</url>
      <title>DEV Community: milagros</title>
      <link>https://dev.to/milagrosbrz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/milagrosbrz"/>
    <language>en</language>
    <item>
      <title>Selector Strategies for Automated Browser Testing</title>
      <dc:creator>milagros</dc:creator>
      <pubDate>Sun, 27 Dec 2020 16:57:02 +0000</pubDate>
      <link>https://dev.to/milagrosbrz/selector-strategies-for-automated-browser-testing-4cp8</link>
      <guid>https://dev.to/milagrosbrz/selector-strategies-for-automated-browser-testing-4cp8</guid>
      <description>&lt;p&gt;In test automation, we have differents forms of selecting a WebElement in Selenium. A selector is a pattern used to locate a WebElement on a given webpage so we can interact with it. Examples of elements are buttons, text fields and input fields. Examples of actions are clicking on a given element or completing a password text field.&lt;/p&gt;

&lt;p&gt;One of the challenges of automated testing, specially with end to end testing, is to mitigate the effect of changes in an ever changing application. E2E tests interact with the application through the UI.&lt;/p&gt;

&lt;p&gt;Selectors strategies were born when people started thinking not only on delivering high quality code, but also delivering faster automation solutions. &lt;/p&gt;

&lt;p&gt;The following image is a simplified version of the 'Agile Test Automation Pyramid', first proposed by Mike Cohn in his book 'Succeeding With Agile':&lt;/p&gt;

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

&lt;p&gt;It is useful to know which selectors are faster under certain situations so we can make smarter decisions. They can impact on reliability, usability, performance and maintainability. That’s why it’s so important that we choose our selectors wisely.&lt;/p&gt;

&lt;p&gt;You could check &lt;a href="https://www.geeksforgeeks.org/locator-strategies-selenium-python/"&gt;here&lt;/a&gt; the differents ways of locating an element &lt;/p&gt;

&lt;p&gt;Some common strategies are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ID&lt;/li&gt;
&lt;li&gt;Name&lt;/li&gt;
&lt;li&gt;Class&lt;/li&gt;
&lt;li&gt;CSS Selectors&lt;/li&gt;
&lt;li&gt;Xpath&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  ID/name/class
&lt;/h4&gt;

&lt;p&gt;When using these, you can target specific elements instead of relying on page structure. If I am to choose one, I would prefer using the ID, as it is one of the safest and efficient ways to locate an element on a web page. But most elements don't have the ID attribute. This would require a combined work between developers and QA team members: work with developers and decide on the locators’ strategy together.&lt;/p&gt;

&lt;p&gt;When ID is not present, the next best option is the name. You should check whether the name is unique or not.&lt;/p&gt;

&lt;h5&gt;
  
  
  PROS:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;Very simple to use.&lt;/li&gt;
&lt;li&gt;They don't rely on the structure of the page and will work even if it changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  CSS Selectors
&lt;/h4&gt;

&lt;p&gt;If the above-mentioned options are not available, the next best solution is CSS selector: is a string pattern used to identify elements based on combination of HTML tags, Ids, classes and attributes. CSS selectors have the same implementation across all browsers.&lt;/p&gt;

&lt;h5&gt;
  
  
  PROS:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;Much faster than XPath&lt;/li&gt;
&lt;li&gt;Widely used&lt;/li&gt;
&lt;li&gt;Provides a good balance between structure and attributes&lt;/li&gt;
&lt;li&gt;Allows for selection of elements by their surrounding context&lt;/li&gt;
&lt;/ol&gt;

&lt;h5&gt;
  
  
  CONS:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;They tend to be more complex and require a steeper learning curve&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Xpath
&lt;/h4&gt;

&lt;p&gt;Allows to navigate through the HTML structure of a page. XPath allows the navigation through the XML structure of any document; it can be used both on HTML and XML. Provides an option to dynamically search for an element within a Web Page, giving the user flexibility. &lt;/p&gt;

&lt;p&gt;There are two types of Xpath:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Absolute Xpath: It uses a Complete path from the Root Element to the desired element.&lt;/li&gt;
&lt;li&gt;Relative Xpath: This can simply be started by referencing the element that you want and go from there.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  CONS:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;Is not recommended for cross-browser testing because it relies on browser’s XPath implementation which is not always complete &lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Helpful questions to ask yourself:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Are you running cross-browser testing?&lt;/li&gt;
&lt;li&gt;Does your application have dynamic elements? &lt;/li&gt;
&lt;li&gt;How does the element that you want to select looks like? &lt;/li&gt;
&lt;li&gt;Does the locator strategy only match the desired element or elements?&lt;/li&gt;
&lt;li&gt;Is the locator depending on information that is likely to change?&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>qa</category>
      <category>selenium</category>
      <category>automation</category>
    </item>
    <item>
      <title>Frontend Basics</title>
      <dc:creator>milagros</dc:creator>
      <pubDate>Wed, 18 Nov 2020 01:47:28 +0000</pubDate>
      <link>https://dev.to/milagrosbrz/frontend-basics-24oe</link>
      <guid>https://dev.to/milagrosbrz/frontend-basics-24oe</guid>
      <description>&lt;p&gt;Basics matter.&lt;/p&gt;

&lt;p&gt;HTML, CSS and JavaScript are the most fundamental building squares of web coding. For someone who has never coded before and doesn`t have a &lt;br&gt;
technological backgroud, creating a page from scratch can seem really intimidating. It is important that you understand these basics in order to grow on the Frontend path.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;HTML&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;It provides the basic structure of sites and it was first created by Tim Berners-Lee in 1989. It stands for Hyper Text Markup Language. If you think about it, an HTML file is just a text file. It is when you put that file into a browser when the magic happens.&lt;/p&gt;

&lt;p&gt;It can be assisted by CSS and scripting languages such as JavaScript. HTML and CSS are actually not technically programming languages; they're just page structure and style information. &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;CSS&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;CSS is the language we use to style an HTML document: you can control the appearance of the documents defined with HTML. CSS is the best way to separate content and presentation. It describes how HTML elements should be displayed. Combined with Javascript, its current applications can be huge.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;JavaScript&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;JavaScript enables interactive web pages and is an essential part of web applications: "it is the programming language of the Web".&lt;br&gt;
To give you an idea, Javascript is behind anything that moves, refreshes, or changes on your screen without the need for you to manually reload the page. &lt;/p&gt;

&lt;h4&gt;
  
  
  Never forget:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;HTML is the structure of your page: headers, text and images.&lt;/li&gt;
&lt;li&gt;CSS is the presentation of the structure: customized fonts, background colors, etc.&lt;/li&gt;
&lt;li&gt;Once you have created your structure and your aesthetic, JavaScript makes your site or project dynamic.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Quality Assurance Roadmap</title>
      <dc:creator>milagros</dc:creator>
      <pubDate>Tue, 13 Oct 2020 01:18:37 +0000</pubDate>
      <link>https://dev.to/milagrosbrz/quality-assurance-roadmap-4gn8</link>
      <guid>https://dev.to/milagrosbrz/quality-assurance-roadmap-4gn8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mDNWVHhY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8d0ly8t81sejq8tan3c9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mDNWVHhY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8d0ly8t81sejq8tan3c9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From: &lt;a href="https://github.com/fityanos/Quality-Assurance-Road-Map"&gt;https://github.com/fityanos/Quality-Assurance-Road-Map&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
