<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pablo Peña on Medium]]></title>
        <description><![CDATA[Stories by Pablo Peña on Medium]]></description>
        <link>https://medium.com/@pablo442?source=rss-b0c968ba8752------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*o-voquRvSUmw6AurW_y05Q.jpeg</url>
            <title>Stories by Pablo Peña on Medium</title>
            <link>https://medium.com/@pablo442?source=rss-b0c968ba8752------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 09:41:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pablo442/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Performance Testing with K6: Load, Stress, and Spike Tests Explained Through a Real Project]]></title>
            <link>https://medium.com/@pablo442/performance-testing-with-k6-load-stress-and-spike-tests-explained-through-a-real-project-5259b57e9b51?source=rss-b0c968ba8752------2</link>
            <guid isPermaLink="false">https://medium.com/p/5259b57e9b51</guid>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[performance-testing]]></category>
            <dc:creator><![CDATA[Pablo Peña]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 18:47:18 GMT</pubDate>
            <atom:updated>2026-07-31T18:47:18.687Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sCuHd05uusZMPaEY" /><figcaption>Photo by <a href="https://unsplash.com/@sooprun?utm_source=medium&amp;utm_medium=referral">Alex Suprun</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the test automation world, functional testing usually gets most of the spotlight, but there is another side of quality assurance that is just as important: performance testing. Knowing that your application works correctly is only half the story, you also need to know how it behaves when real users (and real traffic) hit it.</p><p>This time I wanted to share a small <a href="https://github.com/pablop442/performance-testing">project</a> I put together using K6 and Docker to analyze how a public endpoint behaves under different traffic conditions. My goal was to validate SLA compliance, understand the max capacity of the system, and simulate real world traffic scenarios, all while getting more comfortable with performance testing as a discipline.</p><h4>So what is K6?</h4><p>K6 is an open source load testing tool built for testing the reliability and performance of your systems. Tests are written in JavaScript, which makes it approachable if you are coming from a test automation background, and it integrates nicely with Docker, CI/CD pipelines, and even has its own web dashboard to visualize results in real time.</p><p>For this project I used the public endpoint https://jsonplaceholder.typicode.com/posts as the target, since it allowed me to run realistic scenarios without touching a production system.</p><p>Let’s go through the three types of tests I built.</p><ol><li><strong>Load Testing</strong></li></ol><p>Load testing is meant to answer a simple question: how does my system behave under expected, everyday traffic?</p><p>For this scenario I ramped up virtual users gradually, held a steady load, and then ramped back down:</p><ul><li>30s ramping up to 50 users</li><li>120s holding at 50 users</li><li>30s ramping down to 0</li></ul><p>The thresholds I set were fairly strict, since this represents normal conditions: 95% of requests needed to complete under 500ms, 99% under 1000ms, the error rate had to stay below 1%, and checks needed a 99% pass rate. I also tracked response time as a custom trend metric, which is a great way to get more granular insights beyond the default metrics K6 gives you out of the box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*TkENdC2xeuU9UzoOmHHWeg.png" /><figcaption>Load Test options</figcaption></figure><p>2. <strong>Stress Testing</strong></p><p>While load testing tells you how the system behaves under expected traffic, stress testing tells you where it breaks. The idea here is to push the system beyond normal conditions, step by step, until you find its limit.</p><p>For this test I ramped up in 100 user increments every minute, going from 100 all the way up to 1000 concurrent users, held that peak for 2 minutes, and then ramped back down. As expected, the thresholds here are more relaxed than the load test, allowing up to a 20% error rate and a slower 95th percentile response time, since the point is to observe degradation, not to demand perfect performance.</p><p>This is the kind of test that helps you find your system’s breaking point before your users do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*M58icyDmi1Vj2v1TaQsSZw.png" /><figcaption>Stress test options</figcaption></figure><p>3. <strong>Spike Testing</strong></p><p>Spike testing simulates something a bit different: sudden, unexpected bursts of traffic. Think of a flash sale, a viral social media post, or a marketing email that just went out to your entire user base.</p><p>For this scenario the stages looked like this:</p><ul><li>30s ramping to 50 users (baseline)</li><li>10s spiking sharply to 500 users</li><li>1m holding at that spike</li><li>10s dropping back down to 50 users</li><li>1m holding at the lower baseline</li><li>10s ramping down to 0</li></ul><p>What I find most interesting about spike tests is not just whether the system survives the spike, but how well it recovers afterward. That’s why I kept a baseline period both before and after the spike, so I can compare behavior pre and post spike, not just during it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*hlQzOHdk5R7W63seyImRmg.png" /><figcaption>Spike test options</figcaption></figure><h4>Bringing it all together</h4><p>To make execution simple, I wrapped everything in a shell script that spins up K6 inside a Docker container:</p><pre>./execute-tests.sh &lt;test-name&gt;</pre><p>And if you want to watch the results live using K6’s integrated web dashboard, you can add a flag:</p><pre>./execute-tests.sh &lt;test-name&gt; --dashboard</pre><p>This launches the dashboard at http://localhost:5665, which is a nice way to visualize metrics as the test runs instead of waiting for the summary at the end.</p><h4>Some takeaways</h4><p>Building this project reinforced a few things for me:</p><ul><li>Performance testing is a different mindset than functional testing. You are not just checking if something works,<strong> you are checking how well it works under pressure</strong>, and defining what “acceptable” actually means through thresholds.</li><li>Thresholds are where the real value is. Anyone can send a bunch of requests to an endpoint, <strong>but defining clear pass/fail criteria (response times, error rates, check rates) is what turns a script into an actual test</strong> that can gate a release or catch a regression.</li><li><strong>Different test types answer different questions</strong>. Load tests validate SLAs under normal conditions, stress tests find your breaking point, and spike tests validate resilience and recovery. You need all three to get a full picture of your system’s performance.</li><li>Docker makes this incredibly portable. Since everything runs in a container, there is no need to install K6 locally or worry about environment differences, <strong>anyone on the team can clone the repo and run the same tests with the same results</strong>.</li></ul><h4>Conclusion</h4><p>Performance testing is a discipline that, in my experience, doesn’t get as much attention as it deserves in many QA strategies. Tools like K6 make it approachable enough that <strong>you don’t need a dedicated performance engineer to start getting valuable insights</strong> into how your application behaves under different traffic conditions.</p><p>This <a href="https://github.com/pablop442/performance-testing">project</a> is just a starting point, there is a lot more that can be added, like testing multiple endpoints, integrating these tests into a CI/CD pipeline, or setting up alerts based on threshold failures. But hopefully this gives you a practical example of how to get started with load, stress, and spike testing using K6.</p><p>As always, I’d love to hear your thoughts, feedback, or your own experiences with performance testing tools in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5259b57e9b51" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to generate screenshots on test failure with Allure report]]></title>
            <link>https://medium.com/@pablo442/how-to-generate-screenshots-on-test-failure-with-allure-report-20efa206de86?source=rss-b0c968ba8752------2</link>
            <guid isPermaLink="false">https://medium.com/p/20efa206de86</guid>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[allure]]></category>
            <category><![CDATA[junit-5]]></category>
            <dc:creator><![CDATA[Pablo Peña]]></dc:creator>
            <pubDate>Thu, 29 Jan 2026 17:31:55 GMT</pubDate>
            <atom:updated>2026-01-29T17:31:55.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6bpQtJWrj00Tpy4K" /><figcaption>Photo by <a href="https://unsplash.com/@jakobowens1?utm_source=medium&amp;utm_medium=referral">Jakob Owens</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the latest test automation project I have been working, I integrated Allure report to visualize my test executions, although Allure provides a visually friendly interface with pretty graphs and stats, it does not include by default screenshots of the failed tests. This can be very frustrating when debugging.</p><p>To tackle this, I developed a solution based on Allure docs and various community workarounds. This solution worked perfectly in my project and I think it could help anyone looking to improve their test reporting.</p><h4>The Strategy</h4><p>To capture a screenshot exactly when the test fails I used a JUnit5 Extension (my project uses JUnit5). This allows us to “record” the test lifecycle and trigger the code only if an execution exception occurs.</p><p>I used the AfterTestExecution interface because I needed to capture the screenshot after the test failed, but <em>before</em> the @AfterEach teardown begins, to ensure Appium driver is still active and the session alive</p><pre>public class ScreenshotExtension implements AfterTestExecutionCallback {<br>    @Override<br>    public void afterTestExecution(ExtensionContext context) {<br>        // Only run if an Execution exception occurs<br>        context.getExecutionException().ifPresent(throwable -&gt; {<br>            AppiumDriver driver = DriverFactory.getDriver();<br>            <br>            if (driver != null &amp;&amp; driver.getSessionId() != null) {<br>                try {<br>                    // 1. Capture and attach the Screenshot<br>                    byte[] screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);<br>                    Allure.addAttachment(&quot;Failed Test Screenshot&quot;, new ByteArrayInputStream(screenshot));<br>                    <br>                    // 2. BONUS! Capture and attach the XML Page Source<br>                    Allure.addAttachment(&quot;Page source XML tree&quot;, &quot;text/xml&quot;, driver.getPageSource(), &quot;.xml&quot;);<br>                    <br>                    System.out.println(&quot;Test FAILED! Capturing screenshot...&quot;);<br>                } catch (Exception e) {<br>                    System.err.println(&quot;Capture failed: &quot; + e.getMessage());<br>                }<br>            }<br>        });<br>    }<br>}</pre><h4>Integrating the Extension to my tests</h4><p>In JUnit 5, there are two ways to use extensions: <em>@ExtendWith</em> (declarative) and <em>@RegisterExtension</em> (programmatic).</p><p>I decided to use <em>@RegisterExtension</em> inside the Hooks class, because of the ability to interact with the extension instance directly if needed and the flexibility provided in the order of execution.</p><p><strong>The main logic (JUnit takes care of all):</strong> When JUnit5 accesses the Hooks class, it identifies the <em>@RegisterExtension</em> annotation. It then hooks that class into the test lifecycle. Because we are using AfterTestExecutionCallback, JUnit5 knows to call our screenshot logic the moment a test finishes its execution.</p><pre>public class Hooks {<br><br>    @RegisterExtension<br>    ScreenshotExtension screenshotExtension = new ScreenshotExtension();<br><br>    @BeforeEach<br>    void setUp(){<br>        // Driver initialization logic...<br>    }<br><br>    @AfterEach<br>    void tearDown() {<br>        // Teardown logic...<br>    }<br>}</pre><h4>Needed POM update</h4><p>Last but not least, you need to ensure your pom.xml has the <strong>aspectjweaver</strong> and your Allure dependencies and plugins are configured correctly reporting agents configured correctly.</p><h4>The Challenge/Conclusion</h4><p>This is a short but very effective solution to make your debugging tasks easier. It took me some time to come to this solution mainly because I faced the challenge that the driver closed just before the extension code was executed, so the screenshot was never captured. But after some tries, I came with this &quot;perfect&quot; combination provided by JUnit5.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20efa206de86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I developed Data-Driven API Automation Framework with RestAssured and Java]]></title>
            <link>https://medium.com/@pablo442/how-i-developed-data-driven-api-automation-framework-with-restassured-and-java-e4589d853d8d?source=rss-b0c968ba8752------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4589d853d8d</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[restassured]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Pablo Peña]]></dc:creator>
            <pubDate>Tue, 23 Dec 2025 14:36:57 GMT</pubDate>
            <atom:updated>2025-12-23T14:36:57.297Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vwHhPaWWZp_wTSAW" /><figcaption>Photo by <a href="https://unsplash.com/@timmossholder?utm_source=medium&amp;utm_medium=referral">Tim Mossholder</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the Quality Assurance world, API testing is a fundamental piece to ensure software quality in its entirety. Today, there are multiple tools to test API such as <em>Postman</em>, <em>Insomnia</em>, <em>Bruno</em>, etc. But when you work on a big project, scaling to hundreds of tests requires a robust, code-based solution.</p><p>Recently I had the opportunity to automate with Java in my day to day job. This was a new experience for me, so I decided to go deeper and build my own project with <strong>Java </strong>and<strong> RestAssured</strong>. Here I intend to share my experience and show you the possibilities this type of framework can offer.</p><h3>RestAssured &amp; API Testing</h3><p><strong>RestAssured</strong> is a Java-based DSL (Domain Specific Language) that allows us to validate HTTP responses, headers and status codes. It uses the well-known “Given-When-Then” syntax and integrates it with Java.</p><h3>Data-Driven Testing (DDT)</h3><p>With API testing comes a big amount of data like URLs, payloads, responses, headers, etc. If we fail to organize and centralize this data, we can run into a lot of troubles when maintenance needs to be done (e.g. an URL changes), because we could be facing updating dozens of files.</p><p>By implementing DDT we aim to decouple the test logic (Java Code) from the test data. We have a couple of options to handle the data, for this project I chose gathering the data in YAML files. I had little to no experience with YAML, so I thought it would be a good idea to learn now.</p><p>Some of the advantages of using a DDT approach include:</p><ul><li><strong>Scalability:</strong> Add a new test case by adding 10 lines to a YAML file, not a new Java class.</li><li><strong>Readability:</strong> Manual testers or POs can read the YAML to understand what is being covered.</li><li><strong>Efficiency:</strong> One single Java runner can execute 1,000 unique scenarios.</li></ul><h3>Framework Architecture</h3><h4>Step 1: Defining the Data Model (The POJO)</h4><p>After many refactors I came with a solution to build an Automation Engine that uses a POJO (Plain Old Java Objects) data model. We define a <strong><em>TestCase</em></strong> class that is the heart of the framework, here we include all the desired fields that our test will need like <strong><em>endpointKey</em></strong>, <strong><em>httpMethod</em></strong>, <strong><em>requestBodyFile</em></strong>, <strong><em>pathParams</em></strong>, and <strong><em>tags</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*2Bl4nVg5p2ZNCg5a9FEQwA.png" /><figcaption>TestCase class</figcaption></figure><p>We also provide getters and setters that will help us access our test’s values and dynamize our YAML if needed. Later we will see how we use <strong>Jackson</strong> to map our YAML file to a Java object.</p><h4>Step 2: The YAML Test Suite</h4><p>The YAML file acts as our source of content. It organizes all tests into logical groups and defines the specific state (Preconditions) required for each. We can add as many test cases to this file, and it can be easily read and updated by manual testers or even POs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*s4gt2hkYVXxUMGhSHu9VGg.png" /><figcaption>YAML tests file</figcaption></figure><h4>Step 3: The Generic ApiHandler</h4><p>We created an <strong><em>ApiHandler</em></strong> class to execute the RestAssured request based on the <strong><em>TestCase</em></strong> object information. We handle the multiple scenarios that can be present in an API request, like Path Parameters, Request Body and Query Parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*8RAbwbKQruWhKDtMin9CDQ.png" /><figcaption>ApiHandler class</figcaption></figure><h4>Step 4: The Validator class</h4><p>When testing APIs, many validations need to be done to make sure the actual result matches the expected. In this class we iterate through the Validation object and use <strong><em>Matcher</em></strong> to compare the responses. This validator allows us to use multiple operators such as “greater than”, “less than”, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*m8YMT5lQNUIy3sV6DPhoHQ.png" /><figcaption>ValidationUtils class</figcaption></figure><h4>Step 5: The Hooks Manager (State Handling)</h4><p>CRUD operations often require dependencies (e.g., you can’t DELETE a product that doesn’t exist). We implemented a <strong><em>HooksManager</em></strong> that triggers based on the precondition field in the YAML. It creates data on-the-fly and injects IDs into the testCase object at runtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*JNhAEm9SWRHRZOjQDhuZ1g.png" /><figcaption>HooksManager class</figcaption></figure><h4>Step 6: The Data-Driven Test Runner</h4><p>The Test Runner is where all the magic happens. Here we use JUnit 5’s <strong><em>@ParameterizedTest</em></strong> and <strong><em>@MethodSource</em></strong>, to write <strong>only one Test</strong> that will use as many tests as we write into our YAML.</p><p>We use Jackson to map our YAML and create a stream of tests that will be used by the test and finally executed and validated. If a precondition is passed in the YAML, this is the place where it is executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*8ctycYiIR2rn1sfnesZLHg.png" /><figcaption>Test Runner</figcaption></figure><h3>Reporting &amp; CI/CD Integration</h3><h4>Allure Reporting</h4><p>We integrated <a href="https://allurereport.org/docs/features-overview/">Allure Report</a> to provide more than just “Pass/Fail” logs.</p><ul><li><strong>Dynamic Naming:</strong> The report displays the actual test names from the YAML.</li><li><strong>Clean Grouping:</strong> We overrode the default suite labels so tests are grouped by functional area rather than Java class names.</li><li><strong>Local View:</strong> Use allure serve target/allure-results to visualize the raw JSON data generated by the framework.</li></ul><h4>GitHub Actions (CI/CD)</h4><p>The framework is fully automated via a .github/workflows/api-tests.yml pipeline.</p><ul><li><strong>JDK 23 Environment:</strong> Optimized for the latest Java features.</li><li><strong>Maven Integration:</strong> The pipeline accepts inputs to choose which test profile (Smoke, Sanity, Regression) to run.</li><li><strong>Automated Deployment:</strong> On every push, GitHub Actions runs the tests, generates the Allure report, and deploys it to <strong>GitHub Pages</strong> for the entire team to see.</li></ul><h3>Conclusion</h3><p>Being my first experience with Java and RestAssured I iterated a few times on this framework. It started with a quite simple structure of tests divided into API areas, then I added some utils files, like a <strong><em>DataUtils</em></strong> and <strong><em>FileUtils</em></strong> that allowed me to handle and convert data.</p><p>After some iterations, a DDT model was implemented, making it scalable and easy to maintain. Now no new code needs to be added in case a new test is written, the framework just consumes data and processes it to run the tests.</p><p>Apart from being a completely new tech stack for me, some of the <strong>challenges</strong> included: integrating Allure report with a custom timestamp, creating custom tags to filter the tests executions and creating a custom script to run the tests and launch the report. I will be writing some interesting posts regarding these challenges and how I solved them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4589d853d8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Discovering the Power of Chrome DevTools]]></title>
            <link>https://medium.com/@pablo442/discovering-the-power-of-chrome-devtools-2eaa183e6d74?source=rss-b0c968ba8752------2</link>
            <guid isPermaLink="false">https://medium.com/p/2eaa183e6d74</guid>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[qa]]></category>
            <dc:creator><![CDATA[Pablo Peña]]></dc:creator>
            <pubDate>Thu, 07 Aug 2025 17:35:21 GMT</pubDate>
            <atom:updated>2025-08-07T17:35:21.149Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7wWKj1j8NVAA4rgU" /><figcaption>Photo by <a href="https://unsplash.com/@barnimages?utm_source=medium&amp;utm_medium=referral">Barn Images</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the world of web development and quality assurance, knowing the right tools is crucial. One such indispensable tool that every QA engineer should know is Chrome DevTools. This is the reason why I decided to summarize some of the functionalities that I use in my day to day and some other that I recently discover and I find very useful to bring your QA skills to a higher level.</p><p>Let’s start from the begining saying that Chrome DevTools, is a set of web developer and debugging tools built directly into the Google Chrome browser. It provides a wide range of features that enable developers and QA engineers to inspect, debug, and optimize web applications.</p><h3>Getting started with Chrome DevTools</h3><p>Basically DevTools is a work panel that you can access using one of the following methods:</p><ul><li><strong>Right-click and inspect:</strong> Simply right-click on any element of a webpage and select “Inspect” from the context menu.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tH342Nol_6MFecmLqvb5OA.png" /><figcaption>Right click and inspect</figcaption></figure><ul><li><strong>Keyboard shortcut:</strong> Use the keyboard shortcut Ctrl + Shift + I (Windows/Linux) or Cmd + Option + I (Mac) to open DevTools.</li><li><strong>Menu navigation:</strong> Click the three vertical dots (⋮) in the upper-right corner of Chrome, go to “More tools,” and then select “Developer tools.”</li></ul><p>Once DevTools is open, you’ll see the panel that can be docked to the side or bottom of your browser window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rVDna4lMV7CuVKHPSE8gg.png" /><figcaption>Choose where to dock the panel</figcaption></figure><h3>What are the most common features?</h3><h4>Inspecting web elements</h4><p>When you first open the DevTools panel the Elements tab will be selected by default, here you can access the complete HTML structure of that web page, and the CSS styles. This is particularly useful for QA engineers to identify and troubleshoot layout issues, confirm the correctness of page structure, and verify that styles are applied correctly.</p><p>I want to point out three cool functionalities that I commonly use. First the posibility to select a specific element from the page and accessing all it’s HTML + CSS information without having to go through the entire document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sfT5dpPw60D2zUv-WHvvdg.png" /><figcaption>Click this button and select the element you want</figcaption></figure><p>The second functionality allows you to check the responsivness of the webpage by selecting the dimensions you can verify if the web elements are breaking. You can even check in given devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-m0GVz0jycGVESY1IcN-eg.png" /><figcaption>Testing the responsivness is super easy</figcaption></figure><p>And last but not least functionality is the ability to copy elements CSS selectors or XPath for automated tests. This is one that I consider a must know for every QA automation engineer that need to select an element from a web page.</p><p>Simply right click the desired element and extend the copy menu to display all the options to copy the element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0yj1RQKUpQroO8RA-L3J5g.png" /><figcaption>Copy element menu options</figcaption></figure><h4>Network Analysis</h4><p>This is the tool that I particulary use the most, the Network tab gives you accesss to tons of information about network requests made by a webpage, basically shows you what the frontend is receiving from the backend. You can use this feature to monitor the loading of resources, identify slow-performing assets, and detect any failed requests.</p><p>This is much useful to properly identify bugs and determine the origin of it. Also it can provide better understanding of why the issue is happening so that you can expand the details when reporting the bug. Let’s see an example:</p><p>For this example I’ve moved my panel to the right of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TXi2F2uiRX0xdo1FU7jBFw.png" /><figcaption>Accessing network data</figcaption></figure><p>Check that this webpage is returning an error and in the network tab we can check what is this error about. In this case we get a 404 Not Found error. You can even exand it and access headers data, the response message, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*B9RdlwyPd_w3U4GofFEHcw.png" /><figcaption>Access more data of the failed request</figcaption></figure><p><strong><em>Pro tip 1:</em></strong> When reporting the issue the most valuable information will be the request data so that debug can be done. I recommend copying this information as cURL. With DevTools you can do by right clicking on the error call like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*QaFQDPgFNmIx1pkrdDRbXA.png" /><figcaption>Copy cURL</figcaption></figure><p><strong><em>Pro tip 2:</em></strong> You can use the filters to clean your request stack. Most of the times you will have many actions being performed and you just need some of them, this is when filters become useful. In the same example, let’s say we only need the error call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*c5euBcIFnavFzr-YcJh-Ww.png" /><figcaption>DevTools filters</figcaption></figure><h4>Console for Debugging</h4><p>The Console tab is a versatile tool for debugging JavaScript code. Through this tab you can access the console and all what’s being log to it. QA engineers can use it to log messages, examine JavaScript errors, and interact with the page’s JavaScript environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w9jwMMmHgfnsvvWrQzOo0Q.png" /><figcaption>JS console is very useful for debugging</figcaption></figure><h4>Application Panel</h4><p>The Application panel allows you to inspect and manipulate web application data, such as cookies, local storage, and session storage. This can be valuable for testing scenarios involving data storage and retrieval.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gN1MGVzFASDGN44Q_Ep5lA.png" /><figcaption>Access cookies from Application tab</figcaption></figure><h3>Lesser known functionalities</h3><p>I’ve saved the best for the last :). Some of these functionalities I use every day others are a nice to know because they can be very useful when needed.</p><h4>Lighthouse Integration</h4><p>Lighthouse is an open-source tool for auditing web pages. It’s integrated into DevTools and can generate detailed reports on a webpage’s performance, accessibility, best practices, and more.</p><p>Typically after you click the generate report button, it will take some seconds to load, but after it finishes you will see a complete report with information presented in a very comprehensive way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*Z0P4efBYkM7gturxGI-ZHA.png" /><figcaption>This is just the begining of a six page report!</figcaption></figure><h4>Overrides for Geolocation and Sensors</h4><p>As a QA engineer you will need to test an application in different locations. DevTools allows you to simulate different geolocation coordinates and sensor inputs (such as accelerometer and gyroscope) to test location-based and sensor-dependent features of a web application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sjeAhjCwWYVRvv8pEVMGxQ.png" /><figcaption>Sensors function</figcaption></figure><h4>Throttling Network Speed</h4><p>The Network conditions panel in DevTools enables you to simulate different network conditions, such as 3G or offline mode. This is incredibly useful for testing how a web application behaves under adverse network conditions, helping you identify potential issues and optimize performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-m8KqE3P64i2gtyLMXH8Q.png" /><figcaption>Select the speed you want to test in</figcaption></figure><h4>Screen recording</h4><p>This is an experimental feature that I personally never used, but I recently discovered it’s potential. It allows you to record a session saving valuable data that will be helpful to identify potential issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VOXi893YcbWm_4ThP1bMGQ.png" /><figcaption>Recorder feature</figcaption></figure><h3>To sum it up</h3><p>As I mentioned at the beginning of this article, I wanted to sum up some of the functionalities that Chrome DevTools includes and that I use in my day to day testing. Probably some of them are pretty basic and known, but others I discovered through my experience and since then I’ve never stop using them.</p><p>The lesser known functionalities I shared are just the tip of the iceberg, there are much more and they can be very useful depending on the product you test or the kind of tests you do. The idea is to get to know them, use them and enhance your web testing capabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2eaa183e6d74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Website Health Monitor with AWS]]></title>
            <link>https://medium.com/@pablo442/creating-a-website-health-monitor-with-aws-4f7813dc70d1?source=rss-b0c968ba8752------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f7813dc70d1</guid>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Pablo Peña]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 17:47:06 GMT</pubDate>
            <atom:updated>2025-07-03T17:47:06.930Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AyDfNxxx2AqZxVDe" /><figcaption>Photo by <a href="https://unsplash.com/@ilevyv?utm_source=medium&amp;utm_medium=referral">Iván Levyv</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Understanding basic concepts of Cloud computing and the way it works is a very important addition to your QA skills. Since many applications are Cloud based, familiarizing yourself with a Cloud provider’s services (AWS for example), will give you a complete vision of software applications, thus allowing you to step up your test strategy and improve your QA skills.</p><p>Recently I started exploring the world of cloud computing, specially focusing on AWS Cloud, and I decided to prepare for the exam to obtain the AWS Cloud Practitioner Certification.</p><p>After I finished preparing the theoretical part of the exam I wanted to put my knowledge to practice and apply it to build a useful QA tool. After some research, I decided to build a very simple but effective website health check monitor.</p><p>This is a tool that can be created entirely within <strong>AWS free tier</strong> and it will help you understand the many possibilities that AWS offers and also take advange to automate QA flows. The schema is simple: create a CloudWatch rule using EventBrige that will trigger a Lambda function that will execute some code to send an email alert via Amazon SNS (Simple Notification Service). Something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*70f0EET9YhgdMtKYWb6UFw.png" /><figcaption>Health Check Monitor Diagram</figcaption></figure><p>The main objective of the following tool is to check every 5 minutes the status of a given URL and send an email if there is an error or the webpage is down. So in the following lines I will give you a quick overview on how you can create this project in just a few minutes with some lines of Python and staying within the AWS free tier.</p><h4>1. Create the SNS topic</h4><ul><li>Go to SNS console and create a new topic (e.g. website-health-monitor)</li><li>Choose type ‘<em>Standard</em>’.</li><li>Add the desired email to receive alerts.</li><li>Remember to check your inbox to <strong>confirm the subscription</strong>.</li></ul><h4>2. Create the Lambda Function</h4><ul><li>Go to the Lambda console and create a new function.</li><li>Add a name (e.g. WebsiteHealthCheck).</li><li>Select runtime: Python 3.13 (you could select any programming language available, but for this tutorial purpose I went with Python).</li><li>Make sure to create a IAM role with basic permissions including <strong>publish SNS</strong> permission.</li><li>Having reached this point you will need to <strong>add some code</strong>. You can check the code in my repo to include it in the function.</li></ul><blockquote><a href="https://github.com/pablop442/aws-lambda-website-status-monitor">Go to Health Monitor GitHub Repository</a></blockquote><ul><li>In the<em> Lambda Configuration</em> add the desired environment variables (URL and ARN of the SNS topic).</li><li>Finally test and deploy the function.</li></ul><p>Keep in mind that this is just a demo code, you can add as many health checks as you want, even making some API calls to check backend health.</p><h4>3. Create the CloudWatch rule using EventBridge</h4><ul><li>Go to EventBridge console and create a rule.</li><li>Add a name to the rule (e.g. WebsiteMonitorEvery5Min)</li><li>For the <em>Schedule Pattern</em> select the option to run at a regular rate, and set it to 5 minutes.</li></ul><h4>4. Test the flow</h4><ul><li>Temporarily set the target URL to a failing domain to test the alert</li><li>In 5 minutes you should be receiving the email with the alert.</li></ul><p>These steps will give you a very simple but reliable automated health check to any website that you can use as part of your QA repertoire. And as I mentioned, by using Lambda in this schema you will be able to upgrade the code to increase your test coverage.</p><p><strong>Final note:</strong> Keep in mind that all these services are included within the AWS free tier, but I highly recommend setting a spending alert via <em>Budgets</em> service, this way you will prevent incurring in undesired costs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f7813dc70d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Styling your Robot Framework project: Style guide highlights]]></title>
            <link>https://medium.com/@pablo442/styling-your-robot-framework-project-style-guide-highlights-e707c0d18ad2?source=rss-b0c968ba8752------2</link>
            <guid isPermaLink="false">https://medium.com/p/e707c0d18ad2</guid>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[robot-framework]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[linter]]></category>
            <dc:creator><![CDATA[Pablo Peña]]></dc:creator>
            <pubDate>Fri, 23 May 2025 10:09:43 GMT</pubDate>
            <atom:updated>2025-05-23T10:09:43.559Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FFZ3HIvAxjVvvJpN" /><figcaption>Photo by <a href="https://unsplash.com/@clickmanic?utm_source=medium&amp;utm_medium=referral">Ramakant Sharda</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Since I first started working with Robot Framework, I noticed there wasn’t a single universally enforced style to format my project’s files. Team members had different opinions about the format of the Keywords, variable casing, spacing between elements, file and directory structure, among other styling conventions.</p><p>After doing some research I found this situation is not uncommon in the Robot Framework community, due to this framwork’s flexibility. However, following consistent conventions will improve the readability and maintainability of the code. It will also help to achieve a more effective collaboration between co-workers.</p><p>The <a href="https://docs.robotframework.org/docs/style_guide">Robot Framework Style Guide</a> provides a series of recommendations that will help you obtain the benefits of having properly formatted and standardized code. Below I will try to summarize some of the main rules.</p><h4>File Structure and Naming:</h4><p>It is known that test suites should be created in <em>.robot</em> files and all resources for these test suites should be included in <em>. resource</em> files. The suggested convention is to use lower case with underscores for all the files names (e.g. <em>shopping_cart_tests.robot</em>, <em>common_keywords.resource</em>)</p><p>As for the Directories, it is recommended to include inside your main project directory the following:</p><pre>---tests/ # include all test suites<br>---resources/ # include shared keywords+variables<br>---libraries/ # include custom libraries (Python)<br>---variables/ # include variable files (e.g. global variables, environment variables)</pre><h4>General Document Formatting:</h4><ul><li>Separation between any keywords, variables and constructs should be 4 spaces. This also applies to indentation, depending on the level of indentation the depth will always be 4 spaces.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*pUmzCtnENHiLTSI7qm5LAA.png" /><figcaption>Image from Robot Framework Style Guide docs</figcaption></figure><ul><li>It is suggested that line length should be 120 characters, to continue the line below “…” can be used.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*QL_ALpmRGRohplqP797rzQ.png" /><figcaption>Image from Robot Framework Style Guide docs</figcaption></figure><ul><li>Vertical separation between sections should be 2 empty lines.</li></ul><h4>Naming Conventions:</h4><ul><li>Test cases and Keywords should use <strong>Title Case</strong>.</li><li>Global Variables should use uppercase snake case -&gt; <strong>${GLOBAL_VARIABLE}</strong></li><li>Local Variables should use lower snake case -&gt; <strong>${local_variable}</strong></li><li>Keyword arguments should also use lower snake case -&gt; <strong>${keyword_argument}</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*cp-Dbaocn2NOMmndQ7AbXg.png" /><figcaption>Image from Robot Framework Style Guide docs</figcaption></figure><h4><strong>Other Recommendations:</strong></h4><ul><li>‘<strong>Documentation</strong>’ section should be included when possible right after the Keyword or Test declaration. This will improve collaboration between team members.</li><li>Use ‘<strong>Tags</strong>’ to execute your tests depending on the strategy you want to follow (e.g. regression, smoke, etc.). ‘Tags’ section should be right after ‘Documentation’.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*nU3ZLF5JuHEupr21tL6B0w.png" /><figcaption>Image from Robot Framework Style Guide docs</figcaption></figure><ul><li>Avoid using <strong>comments</strong> if possible. Your code should be readable and the ‘Documentation’ section should also help readability. If you use comments, they should be aligned with the block they belong and a space should be between the <strong>#</strong> and the actual comment.</li></ul><h4>Final Thoughts:</h4><p>As mentioned, this article intended to be a summary of the Robot Framework Style Guide, there is still a lot of valuable information inside the guide. I strongly encourage you to review if you want to keep your project well organized and standardized, thus increasing your automated tests effectiveness and team productivity.</p><h4>Bonus!</h4><p><strong>Using Styling Tools: Robocop</strong></p><p>For linting and enforcing some conventions you can use <a href="https://robocop.readthedocs.io/en/stable/">Robocop</a>. This is a tool that analyzes and formats your code by parsing your files using the Robot Framework parsing API to ensure code quality and solve any format issues.</p><p>This is an interesting alternative to provide your code with some basic quality standards and speed up format checking of your tests and keywords. Keep in mind that Robocop is run in the CLI and can even provide shell autocompletion.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e707c0d18ad2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Cypress project from scratch using TypeScript + Cucumber]]></title>
            <link>https://medium.com/@pablo442/creating-a-cypress-project-from-scratch-using-typescript-cucumber-4ff99fc65555?source=rss-b0c968ba8752------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ff99fc65555</guid>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[cucumber]]></category>
            <category><![CDATA[cypress]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Pablo Peña]]></dc:creator>
            <pubDate>Wed, 26 Mar 2025 13:55:49 GMT</pubDate>
            <atom:updated>2025-03-26T13:55:49.335Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TEoZaVUmOQYSy2sJ" /><figcaption>Photo by <a href="https://unsplash.com/@payam__tahery?utm_source=medium&amp;utm_medium=referral">Payam Tahery</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Recently I have been working on a Cypress end to end test automation project that I set up some time ago using TypeScript and Cucumber. First of all let me explain why I chose this exact combination of tools.</p><p>I went with Cypress since it runs directly in the browser making it very fast and reliable, it is also very easy to install and configure as we will see and it provides a nice interactive runner that allows you to inspect elements and debug your test cases.</p><p>Cypress also has TypeScript support, personally I prefer to use TypeScript instead of JavaScript because of the type checking that helps reduce errors. And finally I used Cucumber to apply Behavior Driven Development (BDD) in my automated test strategy, by simply reading the .features files anyone could review the test cases, this is wonderful.</p><p>So these three tools can be easily integrated to cover any application with a complete test battery that will increase you application’s quality. Let’s see how you can do it.</p><h4>Prerequisites</h4><p>Before starting, ensure you have the following installed:</p><ol><li>Node.js</li><li>npm</li></ol><h4>Step 1: Initialize a new Project</h4><pre>mkdir project-name<br>cd project-name</pre><p>Initialize a Node.js project</p><pre>npm init -y</pre><h4>Step 2: Install Cypress and all needed dependencies</h4><p>Install Cypress</p><pre>npm install cypress –save –dev</pre><p>To write the automated tests code using TypeScript you need to install it as welL as the Cypress types</p><pre>npm install typescript @types/node @types/cypress –save –dev</pre><p>In order to user Cucumber, you need to install the preprocessor for Cypress, this will allow you to add .features files and link them to your tests</p><pre>npm install @badeball/cypress-cucumber-preprocessor --save-dev</pre><h4>Step 3: Configure TypeScript</h4><p>Including Cypress into a tsconfig.json file is needed to use TypeScript functionalities. Add this file in the root of your project:</p><pre>{<br>  &quot;compilerOptions&quot;: {<br>    &quot;target&quot;: &quot;es6&quot;,<br>    &quot;lib&quot;: [&quot;es6&quot;, &quot;dom&quot;],<br>    &quot;types&quot;: [&quot;cypress&quot;, &quot;node&quot;],<br>    &quot;moduleResolution&quot;: &quot;node&quot;,<br>    &quot;esModuleInterop&quot;: true,<br>    &quot;strict&quot;: true<br>  },<br>  &quot;include&quot;: [&quot;cypress/**/*.ts&quot;]<br>}</pre><h4>Step 4: Configure Cypress</h4><p>When Cypress is installed, a Cypress configuration file (cypress.config.js) should be created by default, if it is not, create one. The content of this file should look like this:</p><pre>const { defineConfig } = require(&#39;cypress&#39;);<br>const createBundler = require(&#39;@bahmutov/cypress-esbuild-preprocessor&#39;);<br>const addCucumberPreprocessorPlugin = require(&#39;@badeball/cypress-cucumber-preprocessor&#39;).addCucumberPreprocessorPlugin;<br>const createEsbuildPlugin = require(&#39;@badeball/cypress-cucumber-preprocessor/esbuild&#39;);<br>module.exports = defineConfig({<br>  e2e: {<br>    setupNodeEvents(on, config) {<br>      const bundler = createBundler({<br>        plugins: [createEsbuildPlugin(config)],<br>      });<br>      on(&#39;file:preprocessor&#39;, bundler);<br>      addCucumberPreprocessorPlugin(on, config);<br>      return config;<br>    },<br>    specPattern: &#39;cypress/integration/**/*.feature&#39;,<br>    baseUrl: &#39;https://parabank.parasoft.com/parabank&#39;,<br>  },<br>});</pre><h4>Step 5: Create the folder structure for your project</h4><p>In my case I decided to use Page Object Model (POM) automation strategy to organize the locators and tests, so I used a ‘pageObject’ folder to save all the locators and pages, and ‘BDD’ to add all the feature files and step definitions.</p><p>Finally I added a support folder to add custom comands, types, etc.</p><pre>mkdir -p cypress/integration/BDD<br>mkdir -p cypress/integration/pageObject<br>mkdir -p cypress/support</pre><h4>Step 6: Start creating tests</h4><p>In order to write your first test you will need to create at least 3 files:</p><ul><li><strong>Feature file</strong>: Here the Cucumber test scenarios will be defined.</li></ul><pre>// filepath: cypress/integration/BDD/Account.feature<br><br>Feature: As a user I want to properly use my account services<br><br>    Scenario: As a user I want to successfully open a new account<br>        Given I am logged into ParaBank<br>        When I open a new Savings account<br>        Then I see a new account created in my accounts overview page<br>        And I see a new account details with correct balance<br><br>    Scenario: As a user I want to transfer funds from one account to another<br>        Given I am logged into ParaBank<br>        When I transfer funds from my Checking account to my Savings account<br>        Then I see the funds transferred successfully</pre><ul><li><strong>Step Definition</strong>: In these files is where the “action” happens. Your code will be written here in TypeScript and directly linked to your .feature files.</li></ul><pre>// filepath: cypress/integration/BDD/Account/transferFunds.ts<br><br>import { Given, When, Then } from &quot;@badeball/cypress-cucumber-preprocessor&quot;;<br>import HomePage from &quot;../../pageObject/HomePage&quot;;<br>import ProfileMainPage from &quot;../../pageObject/ProfileMainPage&quot;;<br>import TransferFundsPage from &quot;../../pageObject/TransferFundsPage&quot;;<br><br>const homePage = new HomePage();<br>const profileMainPage = new ProfileMainPage();<br>const transferFundsPage = new TransferFundsPage();<br>const amountToTransfer: string = &#39;1.00&#39;;<br><br>Given(&#39;I am logged into ParaBank&#39;, function () {<br>    cy.visit(Cypress.env(&quot;url&quot;) + &quot;/index.htm&quot;);<br>    cy.fixture(&#39;users.json&#39;).as(&#39;users&#39;).then((users) =&gt; {<br>        const userName = users.correct_user.user_name;<br>        const password = users.correct_user.password;<br>        homePage.getUserNameInput().type(userName);<br>        homePage.getPasswordInput().type(password);<br>        homePage.getLoginButton().click();<br>        profileMainPage.getWelcomeMessage().should(&#39;contain.text&#39;, `Welcome`);<br>    });<br>});<br>When(&#39;I transfer funds from my Checking account to my Savings account&#39;, function () {<br>    homePage.getTransferFundsLink().click();<br>    transferFundsPage.getAmountInput().type(amountToTransfer);<br>    transferFundsPage.getFromAccountSelect().select(&#39;12345&#39;);<br>    transferFundsPage.getToAccountSelect().select(&#39;54321&#39;);<br>    transferFundsPage.getTransferButton().click();<br>});<br>Then(&#39;I see the funds transferred successfully&#39;, function () {<br>    transferFundsPage.getTransferCompletedMessage().should(&#39;contain.text&#39;, &#39;Transfer Complete!&#39;);<br>    transferFundsPage.getTransferedAmountText().should(&#39;contain.text&#39;, `$${amountToTransfer}`);<br>});</pre><ul><li><strong>Page Object Files</strong>: All the locators will be stored in these files, as the name suggest there should be one file per page.</li></ul><pre>// filepath: cypress/integration/pageObject/HomePage.ts<br>class HomePage {<br>    getUserNameInput() {<br>        return cy.get(&#39;#username&#39;);<br>    }<br>    getPasswordInput() {<br>        return cy.get(&#39;#password&#39;);<br>    }<br>    getLoginButton() {<br>        return cy.get(&#39;button[type=&quot;submit&quot;]&#39;);<br>    }<br>    getTransferFundsLink() {<br>        return cy.get(&#39;a[href*=&quot;transfer.htm&quot;]&#39;);<br>    }<br>}<br>export default HomePage;</pre><p>Storing data could be done in the pre created Fixtures folder, here you can create .json files to store the test data and the use it in the code.</p><h4>Step 7: Run your tests</h4><p>Open Cypress to manage and track your execution</p><pre>npx cypress open</pre><p>These are some of the basic steps I followed to start automating my tests with Cypress, TypeScript and Cucumber. There are many additional steps that can be done to improve your project (for example including json data files into the Fixtures directory) but I won’t cover all of them in this article to keep it short.</p><p>This particular project will combine a fast and reliable test automation framework like Cypress with a secure programming language like TypeScript, and a very efficient methodology like BDD using Cucumber.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ff99fc65555" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Document Handling with Robot Framework]]></title>
            <link>https://medium.com/@pablo442/automating-document-handling-with-robot-framework-7bc7f8959050?source=rss-b0c968ba8752------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bc7f8959050</guid>
            <category><![CDATA[docx]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[xlsx]]></category>
            <category><![CDATA[robot-framework]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[Pablo Peña]]></dc:creator>
            <pubDate>Thu, 22 Aug 2024 12:15:36 GMT</pubDate>
            <atom:updated>2024-08-22T12:15:36.664Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JZlh4PndR7ViPYP8" /><figcaption>Photo by <a href="https://unsplash.com/@ageing_better?utm_source=medium&amp;utm_medium=referral">Centre for Ageing Better</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Recently I had the opportunity to create some test cases to access certain files and verify its contents to validate the correctness of them. Although Robot Framework has a bunch of built in functions, it doesn’t provide a specific one to handle documents, so I had to install a couple of libraries that helped me with my tests.</p><p>Today I want to show you how this kind of tests can be easily written and executed with the help of these libraries and a very simple Python function, so I will go over each solution and the steps to implement them in any Robot Framework project.</p><p>First of all, I needed to access three file types: .docx, .xlsx and .pdf, so I installed “<a href="https://python-docx.readthedocs.io/en/latest/">python-docx</a>” for the Word files and “<a href="https://rpaframework.org/">RPA Framework</a>” (Robotic Process Automation) for the Excel and PDF files. Both libraries are widely used by the community and have detailed documentation.</p><p>To install them you can go to your project’s directory, and using pip run the following commands:</p><pre>pip install python-docx</pre><pre>pip install rpaframework</pre><p>Let’s see how the docx files can be handled, in this case <em>python-docx</em> is a Python library to create and update docx files, so in order to use it you would need to have some basic Python knowledge to create a simple Python function.</p><p>Ideally this function will have to access the Word document located in a provided path, and check line by line to determine if the document’s text matched a provided text list. If all the text matches, the function will return true. Also the function will return the extracted text from the document for debugging purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*9OLIARxrRFqjpON2iXbfFw.png" /><figcaption>Python function to create a custom KW</figcaption></figure><p>This function is later used as a custom keyword in a Robot Framework file. As you can see, the Keyword receives an expected text list that should be present in the file located at the provided path, it checks the equality and logs the complete text of the document in the generated report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*ubIWI42K00pHPzY3PS5JCg.png" /><figcaption>Part of the custom KW implemented from the Python file</figcaption></figure><p>Now let’s move to the xlsx files and see how they can be accessed to check the content. So the <em>RPA Framework</em> is a series of open source libraries that can be used both with Python and Robot Framework, this means that in our case, we only need to import it in our resource file and access all of the library’s keywords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*M1ZSuLuIxRGuFV5_fmCHnQ.png" /><figcaption>Part of read and compare Excel file content KW</figcaption></figure><p>We need to provide a file path, to open it and access its content. This can be achieved by using the “<strong>Open Workbook</strong>” and “<strong>Read Worksheet</strong>” keywords. Keep in mind that the latter returns a list of dictionaries that represents the table so something like this:</p><pre>[{A: content of first row of the first column, B: content of the second row of the second column}, {A: content of the first row of the second column, B: content of the second row of the second column}]</pre><p>In my test case I only needed the values of the first column so I used the <strong>Evaluate</strong> built in keyword to filter those using Python code. After it, my keyword logs the content of the file and compares the final actual list with an expected text list that can be passed as an argument to the keyword.</p><p>Finally for the PDF files I needed to use another approach because the objective of this test case was to compare two entire files and not just specific text within the file (like the docx and xlsx cases). So using RPA.PDF library’s keywords I created a custom keyword that compared two given files.</p><p>To achieve it, the first thing to do is to get the complete text from the pdf file with the “<strong>Get Text From Pdf</strong>” keyword, keep in mind that this will return binary so you will have to convert it to string in case you want to manipulate the text or even for debugging purposes. In my case I needed to ignore some text that was always different (think of a timestamp for example), and for it I created a keyword that found a text using regex and replaced it with an empty string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*33C7zfJHc-jHnUMrulRpoQ.png" /><figcaption>Compare PDF files solution with RPA.PDF library</figcaption></figure><p>With these tools you can add a lot of value to your automated tests in case external files need to be accessed and their content verified. Remember that these are the libraries and methods that worked for this particular project, but I invite you to check the documentation and explore the many possibilities these libraries provide to handle files and upgrade your test automation suite.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bc7f8959050" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extending Jira API automation with Newman]]></title>
            <link>https://medium.com/@pablo442/extending-jira-api-automation-with-newman-f3bfab77c67d?source=rss-b0c968ba8752------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3bfab77c67d</guid>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[newman]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Pablo Peña]]></dc:creator>
            <pubDate>Fri, 21 Jun 2024 11:25:27 GMT</pubDate>
            <atom:updated>2024-06-21T11:26:35.330Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zmcmPus8LyCYMaVj" /><figcaption>Photo by <a href="https://unsplash.com/@jplenio?utm_source=medium&amp;utm_medium=referral">Johannes Plenio</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the <a href="https://medium.com/@pablo442/automating-jira-api-testing-with-postman-7abed4e086c4">last article</a>, we automated some basic requests from the Jira API to showcase how to get started with automated API testing using Postman and JavaScript. We mentioned that once the tests are written we could further automate the testing process and integrate your tests into Continuous Integration/Continuous Deployment (CI/CD) pipelines. This is when Newman comes into action.</p><h4>What is Newman?</h4><p><a href="https://learning.postman.com/docs/collections/using-newman-cli/installing-running-newman/#using-newman-with-cicd">Newman</a> is a tool built on Node.js that allows you to run your Postman collections directly from the command line. With Newman you can execute your API automated tests with scripts and using tools like Jenkins for CI/CD pipeline integration.</p><p>Its usage is quite simple and with it you will be able to run your API tests in different environments and get detailed reports of the test runs, so it can come in handy to complete your API test automation cycle. Now let’s see how we can integrate it to our Jira API tests!</p><h4>Setting up Newman</h4><p><strong><em>Installation</em></strong></p><p>As we mentioned before, Newman is built on Node.js so make sure you have Node on your machine. After it just run the following command:</p><pre>npm install -g newman</pre><p><strong><em>Running the collections</em></strong></p><p>For this we will need to go to our Postman collection, in this case the Jira API, and click on the three dots button just beside the collection’s name, then click on “Export”. This will generate a JSON file that you need to save in a path that you will later use to execute your tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*Xs56OEXuJxVvgkZub_YB0w.png" /><figcaption>Postman exporting collection</figcaption></figure><p>It’s very possible that your collection uses some environment variables that you have stored in a Postman environment, so you will need to download them the same way we downloaded the collection, clicking the three dots button beside the environment’s name. This too will create a JSON file that needs to be saved in the location we used for the collection.</p><p>Now that we have our two JSON files stored, we can try running the tests from our command line using the following command:</p><pre>newman run path/to/jira_api_tests.json -e path/to/environment.json</pre><p>When we execute our previously created tests we get a report just like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*Ioar_ryM_g6DTr6vbzRxQQ.png" /><figcaption>API automated test report with Newman</figcaption></figure><p>As you can see, the report breaks down each request that is present in our Jira API collection, it contains all of our test assertions and a summary table of the executed actions. This is quite useful especially when a test is failing because it also contains all details of the failing request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*krwJdCuYY4kz8Oaqq3y_Wg.png" /><figcaption>Failing API automated test report with Newman</figcaption></figure><p>In the last image we see a report with a failing test. The report specifies which request is failing and more specifically which test is failing and why.</p><h4>Other useful command line tags</h4><p>There are multiple <a href="https://learning.postman.com/docs/collections/using-newman-cli/newman-options/">flags</a> that come in handy depending your testing needs, the data flag is one of the options that I find quite useful:</p><pre>newman run path/to/jira_api_tests.json -d path/to/data_file.csv</pre><p>When your tests require different data for each iteration you can use specific CSV or JSON files to supply this test data. This way you can run the same test with different data in multiple iterations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*JdtMkERIKFvt9AlQsv7JbA.png" /><figcaption>Newman Docs</figcaption></figure><h4>Final thoughts</h4><p>As we mentioned at the beginning, Newman is a simple tool to execute your API automated tests from the command line, this has multiple advantages like integrating your tests into your CI/CD pipeline, creating scripts to execute your tests or running your collections using Docker.</p><p>With this brief articule we aim to provide a general overview of this tool and its potential benefits to your API automation hoping that this would help you take your testing to the next level, providing an extra layer of quality to your software.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3bfab77c67d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Jira API Testing with Postman]]></title>
            <link>https://medium.com/@pablo442/automating-jira-api-testing-with-postman-7abed4e086c4?source=rss-b0c968ba8752------2</link>
            <guid isPermaLink="false">https://medium.com/p/7abed4e086c4</guid>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Pablo Peña]]></dc:creator>
            <pubDate>Tue, 23 Apr 2024 10:54:27 GMT</pubDate>
            <atom:updated>2024-04-23T10:54:27.681Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lQMYqbATF8RS0ll_" /><figcaption>Photo by <a href="https://unsplash.com/@lindsayhenwood?utm_source=medium&amp;utm_medium=referral">Lindsay Henwood</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Some time ago I wrote an <a href="https://www.linkedin.com/pulse/getting-started-automated-api-testing-using-postman-pablo-pe%25C3%25B1a-mar%25C3%25ADn/?trackingId=Ip3VGXyrSrilfMuUUZ2blQ%3D%3D">article</a> on how to get started with automated API testing using Postman and JavaScript as the selected tool to write your tests and execute them when a request is done.</p><p>This time I wanted to show how to create a basic automated test set for some of the main requests that can be done with <a href="https://developer.atlassian.com/cloud/jira/platform/rest/v2">Jira API</a>. This test set’s main purpose is to verify that all the requests are done successfully and that errors are properly handled, this can be achieved by writing the tests using Postman.</p><p>The Jira API is quite extensive as it covers all the functionalities of a very complex application. So we will be focusing on testing the basic functionalities of Jira issues. We will try to provide test coverage for most of the scenarios related to these API requests.</p><h4>POST Create issue</h4><p>One of the most important functionalities of this API is creating an issue, so we should make sure the request is successful with the proper code, in this case 201. For this we have prepared a test case that will pass as long as the request’s body is correct and thus the response is 201, this would be the happy path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*BFlO_RhPmLkR0ue5pWFUFQ.png" /><figcaption>POST Crate issue successful test scenario</figcaption></figure><p>Continuing with the successful scenario, we need to verify that the response body matches with what the API documentation specifies as mandatory fields. According to the docs, the successful response should be a JSON format and have at least three properties: id, key, self.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*535Cxrh-LgjHSgEcAhQtXA.png" /><figcaption>Jira API documentation — POST Create issue</figcaption></figure><p>To check if the response body is of type JSON and has these properties, we can write the following test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*svEkBP5xDXstRQrGTtircg.png" /><figcaption>POST Create issue correct response body</figcaption></figure><p>This way we ensure that as long as the correct body is included in the request, the response will meet the requirements. But if for some reason the response is missing a property, our test will fail.</p><p>Once we cover the success scenarios we need to check how the API handles errors. These errors can occur for several reasons, for example invalid input on the request body, invalid credentials, invalid url, among other causes.</p><p>For these cases we have to check the documentation to see the different error codes, as well as the error responses. Knowing this we can create a test to confirm that when the response code is different from 201, the response will have the correct format and properties:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*K6BvcEYNPuNJBvnnp_ZtLg.png" /><figcaption>POST Create issue — Handle errors</figcaption></figure><h4>GET Issue</h4><p>Now that we have successfully created an issue and tested the correct behavior of the POST request, we would like to confirm that this issue is properly retrieved when a GET request is done.</p><p>So as with the POST request (and I would say for almost all requests) we should check that the response’s status is correct, in this case should be a 200. And also that the response’s body has the correct structure.</p><p>But since we are getting a created issue, we can verify that the issue we are passing in the request’s path is the same we actually get in the response. For this we propose the following test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*tvGHz439yYT9I6iwyO-18w.png" /><figcaption>GET Issue — Test issue key</figcaption></figure><p>As you can see, we get the value of the path variable <em>issueIdOrKey</em> and we check if it is the same we get in the response. This way we can prevent any error that can break the application.</p><p>We can add as many verifications as we need, this can vary depending on the complexity of the issue you are creating, for example if your issue has labels, custom fields, fix versions, etc. Let’s say your issue has some labels, in this case we will need to verify that the response contains a labels array and that this array has values in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kw7___xZY4IkZBOvEcoIrA.png" /><figcaption>GET Issue — Test labels array</figcaption></figure><p>Note that the assertions can be chained to improve readability of the code, making it easier to increase your test coverage with cleaner code.</p><h4>PUT Edit issue</h4><p>For this request we can consider most of the tests we have seen for the POST and GET request. We can always refer to the documentation to spot specific scenarios that need additional testing.</p><p>According to Jira API docs we can get two different success responses depending on the parameters we pass in the request url.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3WE993-Pcmhw8dF1DLm6A.png" /><figcaption>PUT Edit issue — Responses</figcaption></figure><p>So if the returnIssue parameter is set to true we will get a 200, but if it’s set to false we get a 204, both successful responses but we need to consider these two scenarios when testing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*jmi68lPEIh1Evj_odaY0DQ.png" /><figcaption>PUT Edit issue — Test both success responses</figcaption></figure><p>So we have adapted the test to validate the successful response to the API documentation requirement, by checking the path variable and adjusting the validation accordingly.</p><h4>DEL Delete issue</h4><p>The last request we will cover in this article is deleting an issue. When we use the API to delete an issue, we should ensure that the response code indicates a successful deletion, typically a 204 response.</p><p>We can also add a second assertion that sends a subsequent GET request to fetch the deleted issue and checks if the response status code is 404, indicating that the issue is no longer found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*SaQ2eZcJhverYsR6JA9EZQ.png" /><figcaption>DEL Delete issue — Verifying issue is deleted</figcaption></figure><p>Keep in mind that according to the documentation the 404 response should have an error message, so this can be added to our tests just like we did when handling errors on the POST request.</p><h4>Final thoughts</h4><p>We have tried to keep the API requests and the test coverage simple to not make this article too long. As mentioned at the beginning Jira API is very complex and extensive, and the objective was to demonstrate how to automate the tests for certain simple API requests.</p><p>The test coverage can be extended to other requests or within the same requests we have covered. Considering we limited our examples to basic requests and fields, sky’s the limit :)</p><p>You can also automate your testing cycle in many ways that we have not covered, for example you can integrate your collections to CI/CD or set a time to recurrently run your tests. This can be done on Postman or other tools like Rest Assured.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7abed4e086c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>