<?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: Hala Samir</title>
    <description>The latest articles on DEV Community by Hala Samir (@hala_samir).</description>
    <link>https://dev.to/hala_samir</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%2F759640%2F40c0553b-f3d1-4679-ace7-458faa60b6e3.jpg</url>
      <title>DEV Community: Hala Samir</title>
      <link>https://dev.to/hala_samir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hala_samir"/>
    <language>en</language>
    <item>
      <title>Let's check it out!</title>
      <dc:creator>Hala Samir</dc:creator>
      <pubDate>Thu, 26 Dec 2024 13:14:39 +0000</pubDate>
      <link>https://dev.to/hala_samir/lets-check-it-out-c16</link>
      <guid>https://dev.to/hala_samir/lets-check-it-out-c16</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/hala_samir" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F759640%2F40c0553b-f3d1-4679-ace7-458faa60b6e3.jpg" alt="hala_samir"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/hala_samir/automating-ui-testing-for-e-commerce-building-a-robust-framework-with-playwright-java-and-cicd-hn7" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Automating UI Testing: Building a Robust Framework with Playwright, Java, Docker, and CI/CD for&lt;/h2&gt;
      &lt;h3&gt;Hala Samir ・ Dec 26&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#playwright&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#automation&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#testing&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#cicd&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>java</category>
      <category>playwright</category>
      <category>automation</category>
      <category>testing</category>
    </item>
    <item>
      <title>Automating UI Testing: Building a Robust Framework with Playwright, Java, Docker, and CI/CD</title>
      <dc:creator>Hala Samir</dc:creator>
      <pubDate>Thu, 26 Dec 2024 11:01:59 +0000</pubDate>
      <link>https://dev.to/hala_samir/automating-ui-testing-for-e-commerce-building-a-robust-framework-with-playwright-java-and-cicd-hn7</link>
      <guid>https://dev.to/hala_samir/automating-ui-testing-for-e-commerce-building-a-robust-framework-with-playwright-java-and-cicd-hn7</guid>
      <description>&lt;p&gt;E-commerce applications demand reliable UI testing frameworks to ensure seamless functionality, improve user experience, and handle dynamic data scenarios. In this blog post, I’ll walk you through the journey of creating a robust, modular, and scalable UI testing framework for the Demoblaze e-commerce app using Playwright with Java. Along the way, I’ll share best practices for test automation, leveraging libraries like Faker for realistic data, and integrating CI/CD pipelines with GitHub Actions and Slack notifications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Playwright for UI Testing?
&lt;/h2&gt;

&lt;p&gt;Playwright, a modern, powerful end-to-end testing library, provides several advantages:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multi-browser Support:&lt;/strong&gt; Automates tests on Chromium, Firefox, and WebKit.&lt;br&gt;
&lt;strong&gt;Headless/Headed Mode:&lt;/strong&gt; Ensures flexibility for CI pipelines or local debugging.&lt;br&gt;
&lt;strong&gt;Rich Features:&lt;/strong&gt; Automatic waiting, screenshot capabilities, and network interception.&lt;br&gt;
&lt;strong&gt;Cross-Language Support:&lt;/strong&gt; Available in JavaScript, Python, Java, and .NET.&lt;/p&gt;

&lt;p&gt;For this project, I chose Playwright with Java due to its compatibility with Java’s robust ecosystem and its seamless integration with test frameworks like TestNG.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️The Framework Design:
&lt;/h2&gt;

&lt;p&gt;A clean, scalable automation framework is critical for long-term success. My design incorporates:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1️. Page Object Model (POM)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The POM design pattern organizes the code base into modular components, making it easy to update locators and reuse functionality across tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Data-Driven Testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tests used the Faker library to dynamically generate realistic data such as names, emails, and passwords for different scenarios. And also used a properties file to set the test configuration like the browser type and setting the headless/headed mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Test Reporting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The framework integrates ExtentReports, which generates rich HTML reports with screenshots, and status summaries for easy debugging and tracking.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧰Tech Stack Overview
&lt;/h2&gt;

&lt;p&gt;The project leverages a modern and efficient technology stack for seamless test automation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Playwright:&lt;/em&gt;&lt;/strong&gt; A robust browser automation library offering cross-browser testing capabilities. It's used to perform end-to-end UI testing across multiple platforms.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Java (Version 17):&lt;/em&gt;&lt;/strong&gt; The programming language chosen for its maturity, stability, and compatibility with test frameworks like TestNG.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;TestNG:&lt;/strong&gt;&lt;/em&gt; A powerful testing framework to execute and organize test cases efficiently, especially for data-driven testing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Maven:&lt;/em&gt;&lt;/strong&gt; A build and dependency management tool to streamline the project setup and integration of required libraries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Faker Library:&lt;/em&gt;&lt;/strong&gt; Used for dynamic and realistic test data generation, including names, emails, and other random values.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;ExtentReports:&lt;/em&gt;&lt;/strong&gt; Provides detailed and visually appealing HTML reports for tracking and analyzing test execution results.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This stack ensures the framework is scalable, modular, and easy to maintain while allowing for integration with CI/CD workflows and containerization using Docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  🐳Docker Integration
&lt;/h2&gt;

&lt;p&gt;One of the standout features of this project is the seamless integration with Docker, enabling the entire test framework to run in a containerized environment. To ensure environment consistency across machines, the framework is containerized using Docker.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Docker is Used
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The project includes a &lt;code&gt;Dockerfile&lt;/code&gt;and &lt;code&gt;docker-compose.yml&lt;/code&gt; configuration for containerized test execution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Docker container runs Playwright, Java 17, Maven, and all necessary dependencies to execute the test suite.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Containers ensure cross-platform compatibility and scalability, allowing tests to run reliably on any machine.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Docker Compose File&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The&lt;code&gt;docker-compose.yml&lt;/code&gt; simplifies container orchestration. Here’s a snippet:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmhfrfkwtuedrkqzi2yuq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmhfrfkwtuedrkqzi2yuq.png" alt="dockerComposeFile" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running in Docker&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Build and execute the container:&lt;/em&gt;&lt;br&gt;
&lt;code&gt;docker-compose up --build&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Key Benefits of Docker in This Project
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Isolation:&lt;/em&gt;&lt;/strong&gt; Each test run occurs in a clean environment, avoiding conflicts with local dependencies.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Reproducibility:&lt;/em&gt;&lt;/strong&gt; The Docker image defines a single source of truth for the environment, guaranteeing consistent results.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;CI/CD Integration:&lt;/em&gt;&lt;/strong&gt; Docker facilitates running the tests as part of a CI/CD workflow, ensuring seamless automation during code pushes or pull requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔄Continuous Integration (CI) with GitHub Actions
&lt;/h2&gt;

&lt;p&gt;I’ve integrated GitHub Actions to automatically execute tests on every code push or pull request for main branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Actions Workflow:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzl13axib2o1rwgpc1x6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzl13axib2o1rwgpc1x6.png" alt="workflowFile" width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Here’s how the GitHub Actions look:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1jrnqzbby556aairhel4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1jrnqzbby556aairhel4.png" alt="GitHubActionRun" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔔Slack Notifications for Test Results
&lt;/h2&gt;

&lt;p&gt;Using the slack GitHub Action, the framework sends test results to a Slack channel, ensuring real-time updates for the team.&lt;/p&gt;

&lt;p&gt;Status: ✅ Success or ❌ Failure&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Here’s how the notification looks:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fio2f9e5vp6niwfggqr64.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fio2f9e5vp6niwfggqr64.png" alt="slackNotification" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  📈Results and Advantages
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Scalable and Modular:&lt;/strong&gt;&lt;/em&gt; With POM and TestNG, adding new test cases is straightforward.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Dynamic Data Generation:&lt;/strong&gt;&lt;/em&gt; Faker ensures diverse test scenarios with minimal effort.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Seamless CI/CD:&lt;/strong&gt;&lt;/em&gt; Automated workflows streamline the testing process, saving time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Real-Time Collaboration:&lt;/strong&gt;&lt;/em&gt; Slack notifications keep the entire team updated.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎯Key Takeaways
&lt;/h2&gt;

&lt;p&gt;Building an automation framework for e-commerce requires careful consideration of modularity, scalability, and integration with modern tools. Using Playwright with Java, combined with data-driven testing and CI/CD workflows, ensures a robust and future-proof solution.&lt;/p&gt;

&lt;p&gt;Feel free to explore the &lt;a href="https://github.com/hala-samir/Playwright-Demoblaze" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt; and raise any questions or suggestions!&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>automation</category>
      <category>testing</category>
      <category>cicd</category>
    </item>
    <item>
      <title>First API Test Using REST Assured.</title>
      <dc:creator>Hala Samir</dc:creator>
      <pubDate>Wed, 24 Aug 2022 10:25:00 +0000</pubDate>
      <link>https://dev.to/hala_samir/first-api-testing-using-rest-assured-51ma</link>
      <guid>https://dev.to/hala_samir/first-api-testing-using-rest-assured-51ma</guid>
      <description>&lt;h2&gt;
  
  
  What is REST Assured?
&lt;/h2&gt;

&lt;p&gt;REST Assured is  a Java library that provides a Java DSL for simplifying testing of REST based services built on top of HTTP Builder.&lt;br&gt;
It supports POST, GET, PUT, DELETE, OPTIONS, PATCH and HEAD requests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages of REST Assured:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;REST Assured  is an Open source.&lt;/li&gt;
&lt;li&gt;It provides easy parsing and validation of response in JSON and XML.&lt;/li&gt;
&lt;li&gt;REST Assured enables assertion for status code and response time,Headers, cookies, Content-Type, etc.&lt;/li&gt;
&lt;li&gt;It can be integrated with TestNG, J Unit,  Maven and CI/CD.&lt;/li&gt;
&lt;li&gt;REST Assured can be integrated with Selenium to create End-to-End test scenarios.&lt;/li&gt;
&lt;li&gt;REST Assured supports multi-part form data.&lt;/li&gt;
&lt;li&gt;REST Assured supports Spring Mock MVC, Spring Web Test Client, Scala and Kotlin.&lt;/li&gt;
&lt;li&gt;It can be used with Cucumber for Behavior Driven Development (BDD).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages of REST Assured:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;REST Assured does not support testing of SOAP APIs explicitly.&lt;/li&gt;
&lt;li&gt;It requires good Java programming knowledge&lt;/li&gt;
&lt;li&gt;No inbuilt reporting. Serenity BDD is a good option here.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Let's Get Started:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What you need to start?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Install Java.&lt;/li&gt;
&lt;li&gt;Install Maven&lt;/li&gt;
&lt;li&gt;Install IDE like VScode, Eclipse or Intellij.&lt;/li&gt;
&lt;li&gt;Create Java Maven project.&lt;/li&gt;
&lt;li&gt;Add REST-assured Maven dependency in pom.xml file.
&lt;a href="https://mvnrepository.com/artifact/io.rest-assured/rest-assured/5.1.1"&gt;https://mvnrepository.com/artifact/io.rest-assured/rest-assured/5.1.1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Add TestNG dependency in pom.xml.&lt;/li&gt;
&lt;li&gt;We will use this API &lt;a href="https://restful-booker.herokuapp.com/apidoc"&gt;https://restful-booker.herokuapp.com/apidoc&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;We will start with a simple request gets all bookings using a non BDD style.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--chpcyf1a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ndg1mqjusz3gf2tff2s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--chpcyf1a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ndg1mqjusz3gf2tff2s.png" alt="Image description" width="880" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add a new class under test directory.&lt;/li&gt;
&lt;li&gt;REST-assured has method called baseUri(), the base URI that's used by REST assured when making requests if a non-fully qualified URI is used in the request&lt;/li&gt;
&lt;li&gt;REST-assured has a static overloaded method named get() which returns a reference of Response interface.
-The return type of REST-assured http methods is of type Response. This response contains all details returned by hitting request i.e. response body, response headers, status code, status lines, cookies etc.
ValidatableResponse is an interface. Response interface has a method named “then()” which returns ValidatableResponse, It can be used to validate a status code using statusCode() method.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Iuj-0KuJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zp5l72m19h8wektsqgt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Iuj-0KuJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zp5l72m19h8wektsqgt.png" alt="Image description" width="880" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To view the response body in console, you can user .body() method for the response to view it. For Pretty-print method user for body() method to return the response as string.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cnxa3v14--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjlmxhv2ro4nhh4cu2y0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cnxa3v14--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjlmxhv2ro4nhh4cu2y0.png" alt="Image description" width="880" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this is the displayed response:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Fk0BsMu2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tcwl21oixedizsqoc9rw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Fk0BsMu2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tcwl21oixedizsqoc9rw.png" alt="Image description" width="619" height="546"&gt;&lt;/a&gt;&lt;br&gt;
And to log all the response details, you can user log().all() to view all the response details not only the response body.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ymgUj5tg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ztn9s3pygv40nbnf93t2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ymgUj5tg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ztn9s3pygv40nbnf93t2.png" alt="Image description" width="880" height="378"&gt;&lt;/a&gt;&lt;br&gt;
The result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--61u8_U5z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4m76wgst1lpnei6y6mnr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--61u8_U5z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4m76wgst1lpnei6y6mnr.png" alt="Image description" width="744" height="689"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>java</category>
      <category>testing</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Exploratory Testing</title>
      <dc:creator>Hala Samir</dc:creator>
      <pubDate>Thu, 20 Jan 2022 13:34:29 +0000</pubDate>
      <link>https://dev.to/hala_samir/exploratory-testing-40fl</link>
      <guid>https://dev.to/hala_samir/exploratory-testing-40fl</guid>
      <description>&lt;h3&gt;
  
  
  What is Exploratory Testing?
&lt;/h3&gt;

&lt;p&gt;Software exploratory testing is a kind of testing idea or testing thinking style based on experience that is not limited by any testing technique. It is widely used in Agile models and can be applied to any phase of testing activities.&lt;br&gt;
In Exploratory Testing, testers interact with the system in whatever way they want and use the information the system provides to react and generally explore the system’s functionality without restraint. Exploratory testing allows the full power of the human brain to be brought to bear on finding bugs and verifying functionality without preconceived restrictions.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Are The Exploratory Testing Goals?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Understanding how an application works, what its interface looks like, and what functionality it implements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Forcing the software to show its capabilities. The idea is to make the software work hard and ask it hard questions that put it through its paces. This may or may not find bugs, but it will provide feedback on whether the software performs the function for which it was designed and that it satisfies its requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finding bugs and exploring the edges of the application&lt;br&gt;
and hitting potential soft spots is a specialty of exploratory testing plus identifying untested and historically buggy functionality.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is Session-Based Test Management (SBTM)?
&lt;/h3&gt;

&lt;p&gt;A session Based Test Management was invented by James and Jonathan Bach in 2000 is well-known guidance that can be used in the exploratory testing method. SBTM is a formalized approach that uses the concept of charters and the sessions for performing the Exploratory Testing.&lt;br&gt;
SBTM has four elements:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Charter:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A one- to three-sentence mission for a testing session. The charter is designed to be open-ended and inclusive, encouraging the tester to explore the application and affording opportunities for variation. Charters are not aimed to be comprehensive descriptions of what should be done, but the total set of charters for the entire project should include everything that is reasonably testable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Time Box:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some period between 45 minutes and 2 ¼ hours, where a short session is one hour (+/- 15 minutes), a long session is two, and a normal session is 90 minutes. The intention here is to make the session short enough for accurate reporting, changes in plans (such as a session being impossible due to a broken build, or a session changing its charter because of a new priority), but long enough to perform appropriate setup, to get some good testing in, and to make debriefing efficient.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Reviewable Result:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It takes the form of a session sheet, a page of text that follows a formal structure. This structure includes charter, coverage areas (not code coverage; typically product areas, product elements, quality criteria, or test techniques); start time, tester name(s); time breakdown; data files; test notes; bugs (where a “bug” is a problem that the tester reasonably believe represents a threat to the value of the product); issues (where an “issue” is a problem that threatens the value of the testing process—missing information, unavailable tools, expertise that might be required, questions that the tester might develop through the course of the session)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Debriefing:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;In the debrief, the session sheet is checked to make sure that it’s readable and understandable; the testers discuss the bugs and issues that were found; the testers make sure that the protocol is being followed, and collaboration happen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uSw1Qji6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4pmcjxnmd9horhnlwfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uSw1Qji6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4pmcjxnmd9horhnlwfw.png" alt="Image description" width="643" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What Are The Exploratory Testing Drawbacks?
&lt;/h3&gt;

&lt;p&gt;The disadvantage of exploratory testing is that testers risk wasting a great deal of time wandering around an application looking for things to test and trying to find bugs. The lack of preparation, structure, and guidance can lead to many unproductive hours and retesting the same functionality repetitively, especially when multiple testers or test teams are involved. This is where guidance comes into play.&lt;/p&gt;

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

&lt;p&gt;Exploratory testing is a testing thinking style based on experience and is widely used in Agile models. Testers interact with the system to be able to explore its functionalities.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>agile</category>
      <category>codequality</category>
      <category>qc</category>
    </item>
    <item>
      <title>Capybara For Web Testing.</title>
      <dc:creator>Hala Samir</dc:creator>
      <pubDate>Sun, 12 Dec 2021 14:38:37 +0000</pubDate>
      <link>https://dev.to/hala_samir/capybara-for-web-testing-3lg2</link>
      <guid>https://dev.to/hala_samir/capybara-for-web-testing-3lg2</guid>
      <description>&lt;h2&gt;
  
  
  What is Capybara?
&lt;/h2&gt;

&lt;p&gt;Capybara is a Ruby library (also referred to as a gem) helps you test web applications by simulating how a real user would interact with your app.It has an intuitive API which mimics the language an actual user would use.&lt;br&gt;
It switches the back-end your tests run against from fast headless mode to an actual browser with no changes to your tests.It has Powerful synchronization features mean you never have to manually wait for asynchronous processes to complete.&lt;/p&gt;

&lt;p&gt;Capybara doesn't interact directly with the web application, it is just a layer between you and the web driver. So, you can use any of the other drivers that Capybara supports.&lt;/p&gt;
&lt;h2&gt;
  
  
  Capybara's drivers:
&lt;/h2&gt;

&lt;p&gt;Capybara supports Selenium 3.5+ (Webdriver). In order to use Selenium, you'll need to install the selenium-webdriver gem, and add it to your Gemfile if you're using bundler.&lt;/p&gt;

&lt;p&gt;Capybara Webkit is built around a cool library called QtWebkit, which is a headless browser acting as a server that listens for commands using a lightweight socket layer. So when you boot up your test suite, that server also starts in a background process. Our Ruby driver implements the Capybara API and communicates with that server.&lt;/p&gt;

&lt;p&gt;Webkit is open source, powers Safari, Chrome, and other browsers. It’s fast and standards-compliant.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to install Capybara?
&lt;/h2&gt;

&lt;p&gt;Capybara requires Ruby 2.6.0 or later. To install, add this line to your Gemfile and run bundle install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gem 'capybara'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the application that you are testing is a Rails app, add this line to your test helper file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require 'capybara/rails'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the application that you are testing is a Rack app, but not Rails, set Capybara.app to your Rack app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Capybara.app = MyRackApp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you need to test JavaScript, or if your app interacts with (or is located at) a remote URL, you will need to use a different driver. If using Rails 5.0+, but not using the Rails system tests from 5.1, you'll probably also want to swap the "server" used to launch your app to Puma in order to match Rails defaults.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Capybara.server = :puma # Until your setup is working
Capybara.server = :puma, { Silent: true } # To clean up your test output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Using Capybara with RSpec:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Load RSpec 3.5+ support by adding the following line (typically to your spec_helper.rb file):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require 'capybara/rspec'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The spec_helper file:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The spec_helper file contains the  require block pulls the ruby gems from the Bundler application.&lt;br&gt;
It also includes the Capybara DSL library we'll use to have Capybara interact with our test site, and Capybara RSpec, which sets up our test framework like drivers, max wait time or the base app URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The run command for a single file is:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bundle exec rspec spec/features/test_file_name_spec.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Write a first test case by Capybara:
&lt;/h2&gt;

&lt;p&gt;Enter the scenario name and the add the steps between do and end.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scenario 'the scenario name' do
  #---add the test steps here.
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Visit a new page:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To navigate to a special URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;visit intended_page_path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Perform on a page elements:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To select any element you can any selector like id, name, or element label&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To click button use:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;click_link('link_id')
click_link('link_text')
click_button('Save')
click_on('link_text') # clicks on either links or buttons
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To fill text field:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fill_in('First Name', with: 'name_value')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To select from a drop down list use:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;select('Option', from: 'Select_box')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To check/uncheck a checkbox use:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;check('checkbox')
uncheck('checkbox')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To select a radio button use:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;choose('radio_button')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To attach a file it is preferred to add a file in the project path in a separate folder(module/package), attach_file can only accept id and name.:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;attach_file('Image', '/path/to/image.jpg')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Scoping&lt;/strong&gt;&lt;br&gt;
Capybara facilitates interacting with forms or clicking links and buttons, within a specific area of the page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;within(:xpath, ".//li[@id='employee']") do
  fill_in 'Name', with: 'Jimmy'
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Scripting&lt;/strong&gt;&lt;br&gt;
Capybara enables executing JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;page.execute_script("$('body').empty()")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Querying&lt;/strong&gt;&lt;br&gt;
Capybara has a rich set of options for querying the page for the existence of certain elements like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;page.has_selector?(:xpath, './/xpath_of_element')
page.has_xpath?('.//xpath_of_element')
page.has_css?('css_selector')
page.has_content?('text')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Also RSpec's matchers can be used:&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;expect(page).to have_selector(:xpath, './/table/tr')
expect(page).to have_xpath('.//table/tr')
expect(page).to have_css('table tr.foo')
expect(page).to have_content('foo')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Capybara is a common choice for end-to-end, acceptance, or integration testing in Rails applications.&lt;/p&gt;

&lt;p&gt;It enables simulating  a user actions on a web page and make assertions based on the content and environment of the page.&lt;/p&gt;

</description>
      <category>capybara</category>
      <category>rails</category>
      <category>webdev</category>
      <category>testdev</category>
    </item>
    <item>
      <title>Value of Test Automation</title>
      <dc:creator>Hala Samir</dc:creator>
      <pubDate>Sun, 05 Dec 2021 14:48:42 +0000</pubDate>
      <link>https://dev.to/hala_samir/value-of-test-automation-96n</link>
      <guid>https://dev.to/hala_samir/value-of-test-automation-96n</guid>
      <description>&lt;p&gt;As I am currently reading Complete Guide to Test Automation: Techniques, Practices, and Patterns for Building and Maintaining Effective Software Projects book, I decided to summarize the value of the test automation chapter and I really recommend reading this book.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test Automation Need
&lt;/h2&gt;

&lt;p&gt;The most common answer is to reduce the time it takes to test the software before release. Reaching the goal of reducing the manual test cycles usually takes a pretty long time to achieve.&lt;br&gt;
The transition from the traditional Waterfall approach to the Agile approach contributed a lot to the need for test automation. The quickly responding to customers’ feedback become much more valuable than sticking to the original plan.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Software Complexity Cost&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every new version of a software, new features are added. As new features are added, the software becomes more complex, and when the software becomes more complex, it becomes harder and harder to add new features to it without breaking anything. Some of this added complexity is unavoidable. But most of the time, most of the complexity in a software exists because features were added quickly without proper design; lack of communication inside the team; or due to a lack of knowledge, either about the underlying technology or about the business needs&lt;/p&gt;

&lt;h2&gt;
  
  
  Two factors helps to keep a constant complexity cost:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Make the cost of running the ever-growing regression test suite negligible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keeping the code very easy to maintain.&lt;br&gt;
The first factor can be achieved if most of the tests are automated. However, the second factor is mainly affected by the accidental complexity, and it is much more challenging to control.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W35kisv7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/907jug37nnc40hqk96tj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W35kisv7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/907jug37nnc40hqk96tj.png" alt="Image description" width="880" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, in most cases in the real world, due to the accidental complexity, the complexity rises more steeply than linearly as we add more and more features.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--axrtvk6H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4stc8zinpjd4ldqq2kkg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--axrtvk6H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4stc8zinpjd4ldqq2kkg.png" alt="Image description" width="880" height="687"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So it seems that it is not feasible to keep developing new features with a steady cost over time, because accidental complexity is unavoidable. The solution for keeping accidental complexity under control is called refactoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refactoring
&lt;/h2&gt;

&lt;p&gt;Refactoring is the process of enhancing and improving the code structure without changing its behavior. In other words, it allows us to get rid of accidental complexity.&lt;br&gt;
But even with automatic refactoring tools, the developer can make a mistake, and introduce new bugs in the process, breaking existing functionality. Therefore, refactoring requires comprehensive regression testing. So, refactoring helps keep the accidental complexity under control.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lgsbqig_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odyjkaezogwkbkhlyapf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lgsbqig_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odyjkaezogwkbkhlyapf.png" alt="Image description" width="697" height="555"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test automation is also related to the architecture of the product, the business processes, the organizational structure, and even the culture besides quality and productivity.&lt;br&gt;
All of these aspects have an effect on the test automation. But you can also leverage the reflection of these effects in the test automation to change and improve any of these aspects back.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y94Sro32--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hl2ow224hrzxnj5rm3th.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y94Sro32--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hl2ow224hrzxnj5rm3th.png" alt="Image description" width="601" height="668"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;The value of test automation can not be denied for continuous integration and while using agile methodology, the regression testing and continuous refactoring can guard for the team productivity. It is important to keep an eye on the software complexity cost to be far as much as you can from the high maintainability cost.&lt;/p&gt;

</description>
      <category>automationtesting</category>
      <category>refactoring</category>
      <category>agile</category>
      <category>continousdelivery</category>
    </item>
    <item>
      <title>Flaky Tests And Their Causes.</title>
      <dc:creator>Hala Samir</dc:creator>
      <pubDate>Mon, 29 Nov 2021 19:07:19 +0000</pubDate>
      <link>https://dev.to/hala_samir/flaky-tests-25h</link>
      <guid>https://dev.to/hala_samir/flaky-tests-25h</guid>
      <description>&lt;p&gt;&lt;strong&gt;Flaky Tests meaning:&lt;/strong&gt;&lt;br&gt;
A flaky test is an unstable test which sometimes passes and sometimes fails without a touchable reason. Flaky tests cause time-wasting and delay till discovering the real reason for the failure. So, it slows down team productivity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There are common reasons for flaky tests:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You should have a solid structure for your test framework. Using a repeated code can cause flaky tests. So, try to use a clean code and DRY principles for example page object design pattern or factory design pattern may eliminate flakiness.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using hardcoded data may cause, as if you want to run your tests on different environments, you will have to change the hardcoded data like file paths or IP addresses.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Caching a previous test state and starting a new test with cached data may cause flakiness, so it is preferred to clean the cache for every test run. Setup the required data before each test and clean up the environment state after each test.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The flakiness may be occurred by an external reason which is not related to the test itself. Network connection, database connection, browser version and memory leaks are candidate reasons for failure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Losing a response from a 3rd party may lead to failure so that stubbing the 3rd party response can prevent these types of failures.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using ineffective element selectors like XPATH or element coordinates can lead to test failure. Those selectors can be easily changed while updating the page design. It is recommended to use more solid selectors like id or name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using many of sleep command stops the test till this period ends. Replacing the sleep command by an implicit wait till the target element appears saves the test time and reduces flakiness.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Time may be a cause. Is your test failing only during runs around midnight, at the beginning of the year, at the beginning of the month, or during the full moon? If you find a pattern of failures like this, it might be due to time or date issues.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Environment may be a cause so, you should also try to understand if it happens in a particular environment, i.e. does it only fail on staging, on a specific OS, etc... anything you can find in common about the failures may be useful in understanding if this is specific to where you run your tests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The test that dependents on an AJAX request the page triggers, and the test runs before the request is loaded. This cause is very common and may be very difficult to identify. However, because of its frequency, testing tools generally have ways to deal with it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Dealing with flaky tests:&lt;/strong&gt;&lt;br&gt;
Document the flaky tests and Set flaky tests in a quarantined area. After running tests, check the recorded data. Check logs, memory dumps,  the system's current state, or even screenshots in UI tests to investigate what caused the failure. &lt;br&gt;
Create tickets to tasks for these tests and pick them up one by one from a  quarantined area. And start investigating into the test by checking the previous reasons for failure. Exclude the quarantined area tests from a deployment pipeline as we can not depend on them till the investigation is done and tests become stable.&lt;br&gt;
When Google faced flaky tests, they analyzed the data from flaky test executions,seeing promising correlations with features that should enable identifying a flaky result accurately without re-running the test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
In this article, we discussed flaky tests and how to mitigate flaky tests. Eliminating flakiness from your tests is not impossible, but it needs effort and time to investigate and mitigate it.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>automation</category>
      <category>programming</category>
      <category>flakytests</category>
    </item>
    <item>
      <title>What, Why and How Code Refactoring.</title>
      <dc:creator>Hala Samir</dc:creator>
      <pubDate>Tue, 23 Nov 2021 20:21:55 +0000</pubDate>
      <link>https://dev.to/hala_samir/what-why-and-how-code-refactoring-5fdk</link>
      <guid>https://dev.to/hala_samir/what-why-and-how-code-refactoring-5fdk</guid>
      <description>&lt;p&gt;Code refactoring is a common terminology in the software engineering field.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is code refactoring?
&lt;/h3&gt;

&lt;p&gt;Code refactoring is the process of enhancing and improving the code structure without changing its behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is code refactoring needed?
&lt;/h3&gt;

&lt;p&gt;Code refactoring is facilitating the code to be more understandable and making it extendable and maintainable. It is a gradual and continuous process. So, if there is a new feature that should be added or a change should be done in the code, it will be easier and more comfortable to extend, amend the existing code moreover it will save time, effort, and for sure money.&lt;/p&gt;

&lt;h3&gt;
  
  
  How can a code be refactored?
&lt;/h3&gt;

&lt;p&gt;One of the refactoring techniques is following the pyramid of refactoring. The pyramid lower levels support the higher levels.&lt;br&gt;
The first block of the pyramid is "&lt;em&gt;Flow&lt;/em&gt;" which means putting the statements and variables are related to each other in a small concept together.&lt;br&gt;
The next block in the pyramid is "&lt;em&gt;Methods&lt;/em&gt;". It means extracting those variables and statements to be inserted into smaller methods.&lt;br&gt;
After that a "&lt;em&gt;Classes&lt;/em&gt;" block, in this step those small methods can be collected in a class, and after adding the related methods in the related classes, patterns can be used.&lt;br&gt;
In the "&lt;em&gt;Patterns&lt;/em&gt;" step using design patterns that fulfill the need can be chosen for creating classes plus applying the object orient programming concepts to provide the best and optimized interaction between classes.&lt;br&gt;
At the top of the pyramid, there is the "&lt;em&gt;Architecture&lt;/em&gt;" as we have obtained classes that follow patterns in addition there are packages, modules, and domains, and the architecture is stable now. &lt;/p&gt;

&lt;p&gt;A refactoring pyramid is a twin to test pyramid. The test pyramid covers the whole software testing levels like unit tests, component tests, integration tests, system tests, and UI tests.&lt;br&gt;
While the test levels exist while code refactoring, tests guarantee unchanged code behavior and no code functionality broken.&lt;/p&gt;

&lt;p&gt;After discussing code refactoring, now we can say that Code refactoring is very essential and crucial so do not hesitate to invest time in refactoring the written code to touch its value in the short and long run.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>computerscience</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
