<?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 Senanur KORKMAZ on Medium]]></title>
        <description><![CDATA[Stories by Senanur KORKMAZ on Medium]]></description>
        <link>https://medium.com/@senanurkorkmaz?source=rss-c4a93b9229cd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kD7hPEkPpgXF02FgESPQyA.jpeg</url>
            <title>Stories by Senanur KORKMAZ on Medium</title>
            <link>https://medium.com/@senanurkorkmaz?source=rss-c4a93b9229cd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 22:55:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@senanurkorkmaz/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[Mobilewright: Playwright for Mobile Test Automation]]></title>
            <link>https://senanurkorkmaz.medium.com/mobilewright-playwright-for-mobile-test-automation-f553c25d60e4?source=rss-c4a93b9229cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f553c25d60e4</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[mobilewright]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[playwright-automation]]></category>
            <dc:creator><![CDATA[Senanur KORKMAZ]]></dc:creator>
            <pubDate>Mon, 06 Jul 2026 06:01:01 GMT</pubDate>
            <atom:updated>2026-07-06T06:01:01.336Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P02ea0riQxGE82hurDlvkA.png" /></figure><p>When I first started working with Playwright, what impressed me the most was its developer experience. The API felt clean, writing tests was simple, and maintaining automation projects became much easier.</p><p>Since I also work on mobile test automation, I always wanted to have a similar experience for mobile applications.</p><p>That is where <strong>Mobilewright</strong> caught my attention.</p><p><strong>Mobilewright</strong> brings the Playwright experience to mobile automation. Its familiar syntax and simple structure make it easier to build readable and maintainable tests for mobile applications.</p><h3>Project Overview</h3><p>For this tutorial, I built a simple native iOS application with SwiftUI that simulates a basic shopping experience. We’ll use this app to build and organize our Mobilewright test automation project. You can find the repository here: <a href="https://github.com/senakorkmaz/mobilewright"><strong>GitHub Repository</strong></a></p><p>The repository structure is straightforward:</p><pre>mobilewright/<br>├── app/<br>├── tests/<br>├── pages/<br>├── mobilewright.config.ts<br>├── package.json<br>└── tsconfig.json</pre><p>Keeping the project organized from the beginning makes it much easier to scale as more tests and features are added.</p><p>Now that everything is ready, let’s configure Mobilewright and run our first test.</p><h3>Project Setup</h3><p>First, clone the repository:</p><pre>git clone https://github.com/senakorkmaz/mobilewright.git<br>cd mobilewright</pre><p>Then install the dependencies:</p><pre>npm install</pre><p>The demo iOS app is already included in the app/ folder as a zipped simulator build.</p><p>To run the tests:</p><pre>npx mobilewright test</pre><p>After the run is completed, open the HTML report:</p><pre>npx playwright show-report</pre><p>There is also an intentional failing test case in the project, so we can see how <strong>Mobilewright reports</strong> failures.</p><h3>Mobilewright Configuration</h3><p>The main configuration is defined in mobilewright.config.ts.</p><pre>export default defineConfig({<br>  testDir: &#39;./tests&#39;,<br>  use: {<br>    platform: &#39;ios&#39;,<br>    deviceName: &#39;iPhone 15&#39;,<br>    app: &#39;./app/SwiftAutomationDemo.zip&#39;,<br>  },<br>});</pre><p>Here, we define the test directory, the iOS simulator, and the demo app that will be installed before running the tests.</p><p>In this project, I use an iOS app, but Mobilewright can also be configured for <strong>Android</strong> by changing the platform and app settings.</p><h3>Test Scenarios</h3><p>One of the best parts of <strong>Mobilewright</strong> is how familiar the test structure feels if you have already used <strong>Playwright</strong>.</p><p>In this project, the login screen is represented with a simple page object:</p><pre>import type { Locator, Screen } from &#39;@mobilewright/core&#39;;<br>import { expect } from &#39;@mobilewright/test&#39;;<br><br>export class LoginPage {<br>  readonly screen: Screen;<br>  readonly title: Locator;<br>  readonly emailField: Locator;<br>  readonly passwordField: Locator;<br>  readonly submitButton: Locator;<br>  readonly hintLabel: Locator;<br><br>  constructor(screen: Screen) {<br>    this.screen = screen;<br>    this.title = screen.getByTestId(&#39;login.title&#39;);<br>    this.emailField = screen.getByTestId(&#39;login.emailField&#39;);<br>    this.passwordField = screen.getByTestId(&#39;login.passwordField&#39;);<br>    this.submitButton = screen.getByTestId(&#39;login.submitButton&#39;);<br>    this.hintLabel = screen.getByTestId(&#39;login.hintLabel&#39;);<br>  }<br><br>  async expectLoaded() {<br>    await expect(this.title).toHaveText(&#39;Swift Automation Demo&#39;);<br>    await expect(this.emailField).toBeVisible();<br>    await expect(this.passwordField).toBeVisible();<br>    await expect(this.submitButton).toBeEnabled();<br>  }<br><br>  async login(email: string, password: string) {<br>    await this.emailField.fill(email);<br>    await this.passwordField.fill(password);<br>    await this.submitButton.tap();<br>  }<br>}</pre><p>Then the test can focus only on the user journey:</p><pre>test(&#39;valid user can sign in and see the product catalog&#39;, async () =&gt; {<br>    await loginPage.expectLoaded();<br>    await loginPage.login(validUser.email, validUser.password);<br>    await homePage.expectLoaded();<br>  });</pre><p>This is exactly the kind of simplicity I was looking for in mobile automation: readable tests, clear selectors, and the Playwright experience for mobile applications.</p><h3>Reporting</h3><p>After running the tests, <strong>Mobilewright</strong> generates a <strong>Playwright-style</strong> HTML report.</p><p>You can open it with:</p><pre>npx playwright show-report</pre><p>The report makes it easy to review test results, execution status, errors, and failed steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l2pXR-njvE1iz0sBWKSuSw.png" /><figcaption>Test Report</figcaption></figure><p>I also added an intentional failing test case to the project to see how failures are displayed in the report. This is useful for understanding how debugging works when a mobile test fails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WeHyAy8lLNSuf0HtfSEyVA.png" /><figcaption>Failed Case</figcaption></figure><p>To make failure analysis easier, I also enabled video recording for failed scenarios:</p><pre>test.use({ video: &#39;retain-on-failure&#39; });</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZsIThlv9F8OuGZGENz_bzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dnfX87p2l7EtKniX0ERWEQ.png" /><figcaption>Screenshots and videos</figcaption></figure><h3>Conclusion</h3><p><strong>Mobilewright</strong> made mobile test automation feel simpler and more familiar for me. You can extend this structure with more scenarios, CI integration, and Android support.</p><p>To discover which approach is best for you, try different methods. You can enhance your mobile automation projects by exploring the repository on GitHub. If you have any questions, I am always happy to help! 💞</p><p><a href="https://github.com/senakorkmaz/mobilewright">GitHub Repository</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f553c25d60e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WebSocket Load Test With JMeter]]></title>
            <link>https://senanurkorkmaz.medium.com/websocket-load-test-with-jmeter-b8bc2613ef70?source=rss-c4a93b9229cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8bc2613ef70</guid>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[apache-jmeter]]></category>
            <dc:creator><![CDATA[Senanur KORKMAZ]]></dc:creator>
            <pubDate>Tue, 07 Oct 2025 21:30:32 GMT</pubDate>
            <atom:updated>2025-10-07T21:30:32.791Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eVcbdVygPHWmrz14Gb6ghQ.png" /></figure><p>In this guide, we’ll walk through how to perform <strong>WebSocket load testing using JMeter</strong> with a custom sample project. You’ll learn how to configure JMeter’s WebSocket plugin, set up a test plan, and interpret performance metrics to ensure your real-time applications can scale effectively.</p><p>If you’re new to JMeter or need a refresher on its basics, check out my previous blog post: <em>“</em><a href="https://medium.com/insiderengineering/boost-your-apps-performance-jmeter-guide-7a126e86c562"><em>Boost Your App’s Performance: JMeter Guide</em></a><em>”</em>.</p><h3>Understanding WebSockets</h3><p>Modern web applications often require <strong>real-time communication</strong> — think of live chat apps, multiplayer games, or live dashboards.<br> While traditional HTTP relies on a <strong>request/response</strong> model, <strong>WebSockets</strong> enable a <strong>persistent, bi-directional connection</strong> between the client and the server.</p><p>This means that instead of repeatedly sending new HTTP requests, both sides can <strong>send and receive messages instantly over a single open connection</strong>.<br> As a result, WebSockets significantly reduce latency and overhead for high-frequency interactions.</p><h3>Why Test WebSocket Performance?</h3><p>Because WebSockets maintain an open connection, their performance bottlenecks are often different from standard HTTP APIs. Some common challenges include:</p><ul><li><strong>Connection Handling:</strong> Can the server manage thousands of concurrent clients?</li><li><strong>Message Throughput:</strong> How many messages per second can be processed reliably?</li><li><strong>Latency Under Load:</strong> Does the response time stay low as traffic scales?</li><li><strong>Stability:</strong> Does the server keep connections alive without unexpected drops?</li></ul><p>Load testing WebSocket endpoints helps ensure that your <strong>real-time features remain stable and responsive</strong> even under heavy user traffic.</p><h3>Setting Up JMeter for WebSocket Testing</h3><p>By default, <strong>Apache JMeter</strong> doesn’t include native support for WebSocket protocols.<br> To test WebSocket endpoints, we need to add the <strong>JMeter WebSocket Sampler plugin</strong>.</p><h3>- Install the WebSocket Plugin</h3><ol><li>Open JMeter and go to <strong>“Options → Plugins Manager”</strong>.</li><li>In the <strong>Available Plugins</strong> tab, search for <strong>“WebSocket Sampler”</strong>.</li><li>Select <strong>“WebSocket Sampler by Peter Doornbosch”</strong> (or similar) and click <strong>Install</strong>.</li><li>Restart JMeter after the installation completes.</li></ol><blockquote><em>💡 If you don’t see the Plugins Manager, download the JMeter Plugins Manager JAR and place it inside JMeter’s </em><em>lib/ext directory.</em></blockquote><h3>- Clone the Sample Project</h3><p>We’ll use a simple WebSocket server as our test target.<br> You can clone the demo project I created here:<br> 👉 <a href="https://github.com/senakorkmaz/Websocket-Load-Test"><strong>WebSocket-Load-Test on GitHub</strong></a></p><pre>git clone https://github.com/senakorkmaz/Websocket-Load-Test.git<br>cd Websocket-Load-Test</pre><p>Follow the project’s README to start the WebSocket server locally.<br> Once it’s running (e.g., on ws://localhost:8080), we’ll point JMeter to this endpoint.</p><h3>Configuring the Test Plan</h3><p>We’ll now configure the JMeter Test Plan using the provided <strong>websocket-test.jmx</strong> file.</p><h3>- Thread Group Configuration</h3><p>Open the websocket-test.jmx file in JMeter and select <strong>Thread Group</strong>.<br> Here’s how the load profile is defined:</p><ul><li><strong>Number of Threads (Users):</strong> 100<br> Simulates 100 concurrent WebSocket clients.</li><li><strong>Ramp-Up Period (seconds):</strong> 1<br> All 100 users start within 1 second.</li><li><strong>Loop Count:</strong> 1<br> Each user sends the message only once.</li></ul><p>💡 With this setup, JMeter creates <strong>100 WebSocket connections almost instantly</strong>, which is great for stress-testing the server’s connection handling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gerpfwXwv14pjFJQHtoR5w.png" /><figcaption>Thread Group</figcaption></figure><h3>-WebSocket Sampler Configuration</h3><p>Open the .jmx file and select <strong>WebSocket Sampler</strong> under the Thread Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9twPJsLkQO9_I5IXqOp9wg.png" /><figcaption>WebSocket Sampler</figcaption></figure><p>Here’s how it’s configured in the provided project:</p><ul><li><strong>Server:</strong> localhost<br> The WebSocket server is running locally.</li><li><strong>Port:</strong> 8080<br> The server listens on port 8080.</li><li><strong>Protocol:</strong> ws<br> Uses the standard unencrypted WebSocket protocol.</li><li><strong>Path:</strong> /<br> Root WebSocket endpoint of the server.</li><li><strong>Implementation:</strong> RFC6455 (v13)<br> Specifies the WebSocket protocol version.</li><li><strong>Message Payload:</strong><br> The sampler sends a JSON payload on each connection:</li></ul><pre>{<br>  &quot;type&quot;: &quot;test&quot;,<br>  &quot;message&quot;: &quot;Load test message ${__threadNum}&quot;,<br>  &quot;timestamp&quot;: &quot;${__time(yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39;Z&#39;)}&quot;<br>}</pre><ul><li>${__threadNum} dynamically inserts the current thread (user) number.</li><li>${__time(...)} adds a timestamp to each message.</li><li><strong>Connection Timeout:</strong> 100 ms<br> If the connection cannot be established within 100 ms, it’s marked as failed.</li><li><strong>Response Timeout:</strong> 100 ms<br> The sampler waits up to 100 ms for a server response before timing out.</li><li><strong>Message Backlog:</strong> 3<br> Specifies how many messages can be queued before being sent.</li></ul><p>This configuration is designed for <strong>high-speed load testing</strong>, quickly opening connections and sending messages to stress-test the server.</p><h3>Start the WebSocket Server</h3><p>Before starting the test in JMeter, make sure the WebSocket server is running.<br> If you’re using the sample project from GitHub, run:</p><pre>cd Websocket-Load-Test<br>npm install<br>npm start</pre><p>By default, the server will start on:<br> ws://localhost:8080/</p><h3>- Execute the Test in JMeter</h3><ol><li>Open your configured websocket-test.jmx file in JMeter.</li><li>Click the green <strong>Start</strong> button in the toolbar (▶️) or press <strong>Ctrl + R</strong>.</li><li>JMeter will begin creating the defined number of WebSocket connections (e.g., 100 users within 1 second).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F77GAH7cdDZNgJsg7p6CVQ.png" /><figcaption>Running performance test</figcaption></figure><h3>Monitor the Results</h3><p>The provided project includes two listeners:</p><p><strong>View Results Tree</strong><br> Shows each WebSocket request and response in detail.<br> Useful for debugging and verifying that the server responds as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gBJ_XcFfRWGm27ra-Q2ghA.png" /><figcaption>Successe response</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*128_P-6ZG64ZeGXUSB292Q.png" /><figcaption>Error response</figcaption></figure><p><strong>Summary Report</strong><br> Displays performance metrics in a simple table, including:</p><ul><li><strong>Samples:</strong> Total number of requests sent.</li><li><strong>Average:</strong> Average response time (ms).</li><li><strong>Min / Max:</strong> Minimum and maximum response times.</li><li><strong>Error %:</strong> Percentage of failed requests.</li><li><strong>Throughput:</strong> Number of requests processed per second.</li><li><strong>KB/sec:</strong> Amount of data sent/received per second.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5J8ZnH4zgiogI09QoLYO2w.png" /></figure><h3>Interpreting the Metrics</h3><p>Focus on these key indicators from the <strong>Summary Report</strong>:</p><ul><li><strong>Average Response Time:</strong> Indicates how quickly the server responds to each WebSocket message.</li><li><strong>Throughput:</strong> Shows how many messages per second were successfully processed — higher is better.</li><li><strong>Error %:</strong> A high percentage means the server failed to handle some requests under load.</li><li><strong>Min / Max Times:</strong> Helps identify spikes in latency that might affect user experience.</li></ul><p>If you observe increasing response times or higher error percentages as the load increases, it’s a sign that your server may need scaling or optimization.</p><p>💡 <strong>Pro Tip:</strong><br> You can gradually increase the <strong>Number of Threads</strong> and <strong>Loop Count</strong> in the Thread Group to simulate heavier traffic and find your server’s breaking point.</p><h3>Conclusion</h3><p>In this post, we explored how to run a <strong>WebSocket load test in JMeter </strong>from installing the plugin to analyzing the performance results.<br> Using JMeter with the WebSocket plugin allows you to see how your <strong>real-time applications handle concurrent connections and message throughput</strong> under stress.</p><p>You can check out the full setup and source code here:<br> 👉 <a href="https://github.com/senakorkmaz/Websocket-Load-Test"><strong>WebSocket-Load-Test on GitHub</strong></a></p><p>If you’d like to dive deeper into <strong>JMeter fundamentals and performance testing</strong>, don’t miss my previous article: <em>“</em><a href="https://medium.com/insiderengineering/boost-your-apps-performance-jmeter-guide-7a126e86c562"><em>Boost Your App’s Performance: JMeter Guide.</em></a><em>”</em></p><p>I hope this walkthrough gave you some inspiration to experiment with your own WebSocket tests.<br> Feel free to share your results or ask questions. I’d love to hear how your setup performs! 💬✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8bc2613ef70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boost Your App’s Performance: JMeter Guide]]></title>
            <link>https://medium.com/insiderengineering/boost-your-apps-performance-jmeter-guide-7a126e86c562?source=rss-c4a93b9229cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a126e86c562</guid>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[stress-testing]]></category>
            <category><![CDATA[load-testing]]></category>
            <dc:creator><![CDATA[Senanur KORKMAZ]]></dc:creator>
            <pubDate>Mon, 04 Aug 2025 07:02:41 GMT</pubDate>
            <atom:updated>2025-09-17T11:19:41.334Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CHSorbJ6AVwgXPtFAFog4g.jpeg" /></figure><p>In this article, I will cover the basic types of testing such as <strong>performance testing</strong>, <strong>load testing</strong>, and <strong>stress testing</strong>. You’ll also learn how to evaluate performance and create load tests using <strong>JMeter</strong> step by step to prepare your systems for future challenges!</p><p>In the software world, user satisfaction and system performance are becoming increasingly important. Today, the success of an application is measured not only by its functionality but also by how well it performs under heavy user load. This is where load testing plays a critical role.</p><p>Websites and applications often experience significant user influx, especially during campaigns or special events. In such cases, it is essential for systems to maintain speed and stability to ensure positive user experiences and business continuity. Performance testing is key to understanding how systems will handle high volumes and identifying potential issues in advance.</p><h4><strong>What is load test ?</strong></h4><p>Load testing is a software testing technique used to examine the behavior of the system when exposed to both normal and <strong>extreme load conditions</strong>. These tests help to find out at <strong>what level the system is causing problems</strong> and the maximum amount of load it can withstand by increasing the load amount at certain rates.</p><p>During load testing, it is important to analyze<strong> hardware limitations</strong> such as <strong>response time</strong> for each process, performance of system components under various loads, memory congestion and network congestion. These analyzes are performed to determine whether fine-tuning is needed or hardware and software changes are required to improve the performance of the system.</p><blockquote><strong>Example:</strong> An <strong>e-commerce</strong> platform simulates a scenario where thousands of users shop simultaneously during a holiday campaign. Thanks to the load test, it is noticed that the system works smoothly for up to <strong>10,000</strong> users at the same time, but when this number is exceeded, order processing times are longer. Infrastructure improvements can be planned based on these results.</blockquote><h4><strong>What is stress test ?</strong></h4><p>Stress testing is a type of performance testing performed to examine the <strong>behavior of the system under extreme loads</strong> and to <strong>observe how it recovers </strong>from failure. During this test, the load on the system is gradually increased to reach maximum capacity and then the system is deliberately brought into a fault state.</p><p>The aim is to analyze the <strong>breaking points</strong>, identify the risks at this point, and <strong>minimize the risks</strong> by making fine adjustments if necessary. This process is critical to evaluate the system’s resilience and ability to recover from failure.</p><blockquote><strong>Example:</strong> A bank’s online transaction system receives a flood of transfer requests on the first day of the year. During stress testing, <strong>50,000</strong> transaction requests are simulated simultaneously, creating a situation where the system stops responding. At the end of the test, the time it takes for the system to restart after a failure and whether there is any <strong>data loss are checked</strong>.</blockquote><h4>What is performance test ?</h4><p>Performance testing is done to measure the performance of the system under a certain load and to check whether it reaches the specified performance targets. This test aims to <strong>detect bottlenecks</strong> of the system under heavy load and solve these bottlenecks with code, database, network or hardware improvements.</p><p>A successful performance test; It should cover possible problems in all components such as database, network, software and hardware. Thus, the overall performance of the system can be optimized.</p><blockquote><strong>Example:</strong> A news site simulates a scenario where <strong>5,000</strong> people are watching a live event at the same time with a performance test. As a result of the test, it is determined that the <strong>freezes in the video stream are caused by server insufficiency</strong>. User experience is improved by increasing server capacity.</blockquote><h4>What is JMeter ?</h4><p>JMeter is an Apache project that was initially developed to test web applications and later can perform different testing functions. It can be used to test static files such as HTML, images, CSS, and JS in web applications, as well as <strong>SOAP</strong> and<strong> REST-based</strong> web services. By <strong>simulating real users’ requests</strong> to web applications, JMeter runs the same scenario as multiple users and creates the desired load on the system. Since it is written 100% in Java, it can run on Windows, Linux or Mac operating systems without any problems. Although this blog will be explained with examples on the Mac operating system, JMeter steps can be applied similarly on every platform.</p><h4>How to perform load testing with JMeter?</h4><p>To install JMeter, first make sure you have Java installed on your computer, you can download and install Java from <a href="https://www.oracle.com/java/technologies/downloads/?er=221886"><em>here</em></a>. Then, download the latest version from the <a href="https://jmeter.apache.org/download_jmeter.cgi"><em>Apache JMeter Download Page</em> </a>and extract the ZIP or TAR file to a suitable directory. To start JMeter, Windows users can open the application by running the <strong>“jmeter.bat”</strong> file, and Mac and Linux users can run the<strong> “./bin/jmeter “</strong> command from the terminal.</p><p><strong>Step1: Add a Thread Group<br></strong>To add a Thread Group, right-click on your <strong>Test Plan</strong> in the left panel in the JMeter interface and select <strong>“Add &gt; Threads (Users) &gt; Thread Group”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-XfEn-R6txfSsw88TP3zfg.png" /></figure><p>In the Thread Group, you can specify the number of users <strong>(Threads)</strong>, the number of loops each user will run <strong>(Loops)</strong>, and the Ramp-Up Time as the users’ start time. <strong>Ramp-Up </strong>Time determines how long to equally space out all users; for example, if 10 seconds is specified for 20 users, each user is started every 0.5 second.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uuMHGzsXuLWIybMPOh-3RQ.png" /></figure><p><strong>Step2: Add an HTTP Request Defaults<br></strong>In this step, we set <a href="https://jsonplaceholder.typicode.com/">https://jsonplaceholder.typicode.com/</a> as the default for all our HTTP requests. This way, we don’t have to type the same server address over and over again for each request.</p><ol><li>Right click on the <strong>Test Plan</strong> and “<strong>Add &gt; Config Element &gt; HTTP Request Defaults”</strong>.</li><li>Set HTTP Request Defaults as follows:<br>-&gt;In Server Name or IP, type <strong>jsonplaceholder.typicode.com</strong> (this is the server address of the API).<br>-&gt;<strong> </strong>In the Protocol field, type <strong>https</strong> (this indicates that the API uses the HTTPS protocol).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rrzrAeYAnkKB6ZvBgAiMaA.png" /></figure><p><strong>Step 3: Add HTTP Request</strong></p><ol><li>Right click on the Thread Group, add the <strong>“Add &gt; Sampler &gt; HTTP Request”</strong> option.</li><li>Set HTTP Request settings as follows:<br>-&gt; Method:<strong> GET</strong><br>-&gt; Path: <strong>/posts/1</strong> (This makes an API request calling a specific post).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gxxq_-DL1xbwOTwzlSo2OQ.png" /></figure><p><strong>Step 4: Monitor Results by Adding a Listener</strong></p><ol><li>Right click on the <strong>Thread Group</strong>, add the option <strong>“Add &gt; Listener &gt; View Results Tree”.</strong></li><li>You can also add other Listeners such as <strong>“Summary Report”</strong> or <strong>“Aggregate Report”</strong> to analyze load test reports.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ogx1yUBjFmK0MGbgYNFvLw.png" /></figure><p><strong>Step 5: Running the Test</strong></p><ol><li>Start the test by clicking the <strong>Run</strong> button in the top menu.</li><li>You can see the responses to the requests and errors in the <strong>“View Results Tree”</strong> tab.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLZ_aJqTSnL0XTA-Bc4bfw.png" /><figcaption><strong>Sampler result</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fTuwefWOOCwZE20VmKzVmA.png" /><figcaption><strong>Request body</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rj22g_v9xTW06I5CUz-cJA.png" /><figcaption><strong>Response data</strong></figcaption></figure><h4><strong>Conclusion</strong></h4><p>Performance tests are critical to detect potential problems in advance by analyzing a system’s behavior under load. In this article, we discussed basic concepts such as load testing, stress testing, and creating a load test scenario with JMeter. You can increase the performance of your system by creating effective test scenarios in your own projects with what you have learned.</p><p>But that’s not all… our QA team is growing! If you love solving tricky problems, collaborating with awesome teammates, and building software that truly makes an impact, you’ll fit right in. At <a href="https://www.linkedin.com/preload/#">Insider.</a>, we experiment, learn, and push boundaries — together. ✨</p><p>Curious? Motivated? Just love talking tech? Reach out to <a href="https://www.linkedin.com/preload/#">Irmak Kestane</a> or <a href="https://www.linkedin.com/preload/#">Aslı Canatan</a> — or check out our open positions 💬</p><p>Senior Software QA Engineer: <a href="https://lnkd.in/ePYr-23J">https://lnkd.in/ePYr-23J</a><br>Software QA Engineer: <a href="https://lnkd.in/eWhPzEru">https://lnkd.in/eWhPzEru</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a126e86c562" width="1" height="1" alt=""><hr><p><a href="https://medium.com/insiderengineering/boost-your-apps-performance-jmeter-guide-7a126e86c562">Boost Your App’s Performance: JMeter Guide</a> was originally published in <a href="https://medium.com/insiderengineering">Insider One Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate Your Postman Collections with Newman: A Complete Guide]]></title>
            <link>https://senanurkorkmaz.medium.com/automate-your-postman-collections-with-newman-a-complete-guide-b3131effa776?source=rss-c4a93b9229cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3131effa776</guid>
            <category><![CDATA[newman]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[api-test-automation]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Senanur KORKMAZ]]></dc:creator>
            <pubDate>Sun, 01 Jun 2025 23:09:03 GMT</pubDate>
            <atom:updated>2025-06-01T23:09:03.973Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nfAoyHWjXWTn1hbmGNEtBQ.png" /></figure><p>If you’re using Postman to manually test your APIs, you’re only halfway there. Manual testing is great for debugging or initial exploration, but once your API grows, you’ll need a scalable, repeatable, and automated way to verify its functionality. That’s where <strong>Newman</strong>, Postman’s command-line companion, comes in.</p><p>In this guide, I will show you how to automate your Postman collections using Newman, organize your tests effectively, and run them as part of your CI/CD workflow using <strong>GitHub Actions</strong>. We’ll walk through a real example with a collection that tests authentication, user profiles, and goal tracking APIs.</p><h3>Why Automate API Testing?</h3><p>APIs are the backbone of most modern applications. Whether it’s a microservice, a mobile app backend, or a web frontend, APIs are the primary communication channels. Relying on manual testing for every endpoint is inefficient and error-prone.</p><p>That’s where API test automation becomes crucial. Automated testing helps you:</p><ul><li>Identify issues earlier in the development lifecycle</li><li>Run tests consistently and repeatedly across environments</li><li>Integrate testing directly into CI/CD pipelines</li><li>Enforce contract and response validation over time</li></ul><p>In this post, I’ll walk you through a real-world example of API automation using <strong>Postman</strong>, <strong>Newman</strong>, and <strong>GitHub Actions</strong>. You can find the full collection here: <a href="https://github.com/senakorkmaz/Postman-Api-Automation">Postman-Api-Automation Repo</a></p><h3>Writing API Test Scripts with Postman</h3><p>Postman is more than just a UI for testing APIs. You can write custom test assertions using JavaScript in the <strong>Tests</strong> tab of each request.</p><p>Here’s an example from the /status endpoint in the collection:</p><pre>pm.test(&quot;Status code is 200&quot;, () =&gt; {<br>    pm.response.to.have.status(200);<br>});<br><br>pm.test(&quot;Check if status is OPERATIONAL&quot;, () =&gt; {<br>    const jsonData = pm.response.json();<br>    pm.expect(jsonData.status).to.eq(&quot;OPERATIONAL&quot;);<br>});</pre><p>You can validate status codes, response body fields, response time, headers, and more.</p><h3>The Structure of the Collection</h3><p>The collection is organized into three main folders:</p><ul><li><strong>Status</strong>: Verifies if the server is up (GET /status)</li><li><strong>User</strong>: Covers registration, login, and profile updates</li><li><strong>Goals</strong>: Includes full CRUD operations and progress visualization</li></ul><p>Example: the CreateGoal request generates dynamic data using {{$randomLoremWords}} and stores values in variables:</p><p><strong>Pre-request Script:</strong></p><pre>let title = pm.variables.replaceIn(&quot;{{$randomLoremWords}}&quot;);<br>let desc = pm.variables.replaceIn(&quot;{{$randomLoremSentences}}&quot;);<br>pm.collectionVariables.set(&quot;goalTitle&quot;, title);<br>pm.collectionVariables.set(&quot;goalDesc&quot;, desc);</pre><p><strong>Test</strong> <strong>Script</strong>:</p><pre>pm.test(&quot;Validate created goal fields&quot;, () =&gt; {<br>    const goal = pm.response.json().goal;<br>    pm.expect(goal.title).to.eq(pm.collectionVariables.get(&quot;goalTitle&quot;));<br>    pm.expect(goal.description).to.eq(pm.collectionVariables.get(&quot;goalDesc&quot;));<br>});</pre><h3>Running Postman Collections with Newman</h3><p><a href="https://www.npmjs.com/package/newman">Newman</a> is Postman’s official CLI tool that allows you to run collections programmatically. It’s perfect for automation and CI environments.</p><p>To install Newman globally:</p><pre>npm install -g newman</pre><p>To run the collection:</p><pre>newman run collections/PostmanAutomationCollection.json \<br>  --env-var baseUrl=&quot;https://goal-tracker-api.onrender.com/api/v1&quot; \<br>  --reporters cli,html \<br>  --reporter-html-export reports/report.html</pre><p>You can replace baseUrl with any environment-specific base URL as needed.</p><h3>Automating API Tests with GitHub Actions</h3><p>We use GitHub Actions to automatically run API tests on every push, pull_request, or manually via the GitHub UI.</p><p>Here’s the complete workflow file:</p><pre>name: Run Postman Tests with Newman<br><br>on:<br>  push:<br>    branches: [ main ]<br>  pull_request:<br>    branches: [ main ]<br>  workflow_dispatch:<br><br>jobs:<br>  postman-tests:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>    - name: Checkout repository<br>      uses: actions/checkout@v3<br><br>    - name: Install Newman<br>      run: npm install -g newman<br><br>    - name: Run Postman Collection<br>      run: |<br>        newman run collections/PostmanAutomationCollection.json \<br>          --reporters cli,html \<br>          --reporter-html-export reports/report.html <br></pre><p>This ensures every code change triggers automated API testing, keeping your API contract and functionality in check.</p><h3>Best Practices for Postman Test Scripts</h3><p>Here are a few tips for writing effective test scripts:</p><ul><li>Use clear, descriptive test names</li><li>Validate both status codes and key response fields</li><li>Test edge cases and invalid inputs</li><li>Keep environment and collection variables separate and organized</li><li>Use dynamic test data generation when possible ({{$random...}})</li><li>Store values (like tokens or IDs) for use across requests</li></ul><p>Example:</p><pre>pm.test(&quot;Token is returned and stored&quot;, () =&gt; {<br>    const response = pm.response.json();<br>    pm.collectionVariables.set(&quot;token&quot;, `Bearer ${response.token}`);<br>    pm.expect(response.token).to.exist;<br>});</pre><h3>Reliable and Scalable API Testing</h3><p>Combining Postman for writing API tests, Newman for executing them programmatically, and GitHub Actions for CI integration gives you a powerful workflow for backend validation.</p><p>This setup is:</p><ul><li>Easy to maintain</li><li>Scalable across environments</li><li>Friendly for both developers and testers</li></ul><p>Feel free to clone the <a href="https://github.com/senakorkmaz/Postman-Api-Automation">Postman-Api-Automation repository</a>, explore the tests, and integrate the pipeline into your own project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3131effa776" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating CI/CD with Playwright and Slack Reporting]]></title>
            <link>https://senanurkorkmaz.medium.com/automating-ci-cd-with-playwright-and-slack-reporting-ad10f3a792a8?source=rss-c4a93b9229cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad10f3a792a8</guid>
            <category><![CDATA[playwrights]]></category>
            <category><![CDATA[test-reporting]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[slack-apps]]></category>
            <category><![CDATA[test-automation]]></category>
            <dc:creator><![CDATA[Senanur KORKMAZ]]></dc:creator>
            <pubDate>Mon, 19 May 2025 06:02:30 GMT</pubDate>
            <atom:updated>2025-05-19T06:02:30.902Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXDy6Q6TYtbKZPCO3xJXeg.png" /></figure><p>In this article, I’ll demonstrate automating test processes with Playwright, as well as setting up CI/CD pipelines via GitHub Actions to integrate and report test results to Slack. This will allow you to run tests in parallel, speed up the process, and track every step in real-time.</p><p>My previous blog post titled <a href="https://medium.com/@senanurkorkmaz/playwright-test-automation-pom-bdd-ddt-architectures-96d41d8b2f5f"><strong>“Playwright Test Automation: POM, BDD, DDT Architectures”</strong></a>, we took the first step into the world of test automation with Playwright. In that post, I demonstrated with examples how we can implement test architectures such as <strong>Page Object Model (POM)</strong>, <strong>Data-Driven Testing (DDT)</strong>, and <strong>Behavior-Driven Development (BDD)</strong> using Playwright.</p><p>Now, we’re taking it a step further by building on that solid foundation: <strong>CI/CD integration</strong>. Using the same GitHub repository, we’ll set up a system that automatically runs tests and reports the results to Slack in real time.</p><p>With this system:</p><ul><li>Tests will run automatically whenever code is pushed to the main branch.</li><li>Playwright test results will be logged, and failed tests will be extracted with detailed information.</li><li>A Slack bot will send summary reports and error details directly to your channel.</li></ul><p>Before we start setting up the CI/CD integration process, we need to complete a few preliminary steps on the Slack and GitHub sides. Let’s go through these preparations step by step!</p><h3>Creating a Slack App and Granting Necessary Permissions</h3><p>To automatically send test results to your Slack channel during the CI/CD process, you need to create a Slack App and assign the necessary permissions. Here are the steps:</p><ol><li><strong>Go to the Slack API: </strong>Visit <a href="https://api.slack.com/apps">https://api.slack.com/apps</a></li><li><strong>Create a New App: </strong>Click the <strong>“Create New App”</strong> button and select <strong>“From scratch.”</strong></li><li><strong>Set App Name and Workspace: </strong>Give your app a name and choose the Slack workspace where it will operate.</li><li><strong>Go to OAuth &amp; Permissions: </strong>In the left menu, navigate to this section and add the following scopes:<br> chat:write → To send messages to Slack channels.</li><li><strong>Save Scopes and Get the Token:<br></strong> → Save the changes.<br> → Click <strong>“Install App to Workspace”</strong> to install the app.<br>Then, copy the <strong>Bot User OAuth Token</strong> (it starts with xoxb-...).</li></ol><h4>Add Information to GitHub Secrets</h4><p>To use the Slack token and channel ID securely within GitHub Actions, you need to store them as GitHub Secrets:</p><ol><li>Go to your GitHub repository page.</li><li>Navigate to: <strong>Settings → Secrets and variables → Actions</strong></li><li>Click <strong>“New repository secret”</strong> and create the following two secrets:<br> → SLACK_BOT_TOKEN → The xoxb-... token you got from Slack<br> → SLACK_CHANNEL_ID → The ID of the channel where you want to send messages (Right-click the channel in Slack and select <strong>“Copy channel ID”</strong>)</li></ol><h3><strong>Understanding the GitHub Actions Workflow File</strong></h3><p>To manage the CI/CD process, we created a YAML file inside the .github/workflows directory. This file automates the execution of tests and the delivery of results to Slack.</p><pre>name: Run Playwright Tests and Send Report<br><br>on:<br>  push:<br>    branches: [main]<br>  workflow_dispatch: <br><br>jobs:<br>  test:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - name: Checkout code<br>        uses: actions/checkout@v3<br><br>      - name: Setup Node.js<br>        uses: actions/setup-node@v3<br>        with:<br>          node-version: 18<br><br>      - name: Install dependencies<br>        run: npm i<br><br>      - name: Install Playwright browsers<br>        run: npx playwright install<br><br>      - name: Run tests and generate log<br>        run: npx playwright test | tee test-results.log<br>        continue-on-error: true<br><br>      - name: Extract test result and build message<br>        id: extract_result<br>        run: |<br>          PASSED=$(grep -oP &#39;\d+(?= passed)&#39; test-results.log || echo 0)<br>          FAILED=$(grep -oP &#39;\d+(?= failed)&#39; test-results.log || echo 0)<br>          TOTAL=$((PASSED + FAILED))<br>      <br>          FAILED_TESTS=$(grep -E &quot;^[[:space:]]*[0-9]+\)&quot; test-results.log | awk &#39;{$1=$1; print $0&quot;\n&quot;}&#39;)<br>      <br>          SUMMARY=&quot;📊 *$TOTAL Total* | ✅ *$PASSED Passed* | ❌ *$FAILED Failed*&quot;<br>      <br>          if [ -n &quot;$FAILED_TESTS&quot; ]; then<br>            MESSAGE=$&#39;🧪 *Playwright Test Results*\n\n*Failed Tests:*\n&#39;&quot;$FAILED_TESTS&quot;$&#39;\n\n&#39;&quot;$SUMMARY&quot;<br>          else<br>            MESSAGE=$&#39;🧪 *Playwright Test Results*\n\n✅ *All tests passed!*\n\n&#39;&quot;$SUMMARY&quot;<br>          fi<br>      <br>          echo &quot;message&lt;&lt;EOF&quot; &gt;&gt; $GITHUB_OUTPUT<br>          echo &quot;$MESSAGE&quot; &gt;&gt; $GITHUB_OUTPUT<br>          echo &quot;EOF&quot; &gt;&gt; $GITHUB_OUTPUT<br><br>      - name: Send test summary to Slack<br>        env:<br>          SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}<br>          SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}<br>        run: |<br>          curl -X POST https://slack.com/api/chat.postMessage \<br>            -H &quot;Authorization: Bearer $SLACK_BOT_TOKEN&quot; \<br>            -H &quot;Content-Type: application/json&quot; \<br>            --data &quot;$(jq -n \<br>              --arg channel &quot;$SLACK_CHANNEL_ID&quot; \<br>              --arg text &quot;${{ steps.extract_result.outputs.message }}&quot; \<br>              &#39;{channel: $channel, text: $text}&#39;)&quot;</pre><p>Below, you’ll find a step-by-step explanation of this file:</p><p><strong>Workflow Definition and Triggers</strong></p><pre>name: Run Playwright Tests and Send Report<br><br>on:<br>  push:<br>    branches: [main]<br>  workflow_dispatch:</pre><ul><li>name: This is the name of the workflow. It will appear with this name in the GitHub Actions interface.</li><li>on: Defines when the workflow should be triggered.</li><li>push: Runs the workflow whenever there is a push to the main branch.</li><li>workflow_dispatch: Allows the workflow to be triggered manually (you can run it from the GitHub Actions tab using the <strong>“Run workflow”</strong> button).</li></ul><p>With this section, we’ve defined when the automation should be triggered.</p><p><strong>Checking Out the Code</strong></p><pre>jobs:<br>  test:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - name: Checkout code<br>        uses: actions/checkout@v3</pre><ul><li>This step clones the code from the GitHub repository into the runner environment.</li><li>In other words, it gives access to the project files before running the tests.</li><li>runs-on: ubuntu-latest: Specifies the environment in which the workflow will run (a GitHub-hosted Ubuntu machine).</li><li>actions/checkout@v3: An official GitHub Action that pulls all the repository files (including those outside .github/workflows) into the runner.</li></ul><p>Without this step, your test files cannot be found, and the process cannot start.</p><p><strong>Setting Up Node.js</strong></p><pre>      - name: Setup Node.js<br>        uses: actions/setup-node@v3<br>        with:<br>          node-version: 18</pre><ul><li>If your test framework and Playwright are based on Node.js, you need to install the appropriate Node version first.</li><li>Here, we are installing <strong>Node.js v18</strong> using setup-node@v3.</li></ul><p>This is required to be able to run npm commands.</p><p><strong>Installing Dependencies</strong></p><pre>      - name: Install dependencies<br>        run: npm i</pre><ul><li>The npm i command installs all dependencies listed in your package.json file.</li><li>This step is essential for both your tests and Playwright to function correctly.</li></ul><p><strong>Installing Playwright Browsers</strong></p><pre>      - name: Install Playwright browsers<br>        run: npx playwright install</pre><ul><li>Playwright requires browser binaries (Chromium, Firefox, WebKit) in addition to the core package in order to run tests.</li><li>The command npx playwright install downloads these browsers so that your tests can run properly.</li></ul><blockquote><em>🔍 </em>Note: Since --with-deps is not used, system-level dependencies will <strong>not</strong> be installed. Make sure your CI environment already has them if needed.</blockquote><p><strong>Running Tests and Logging Output</strong></p><pre>      - name: Run tests and generate log<br>        run: npx playwright test | tee test-results.log<br>        continue-on-error: true</pre><p>This is the step where the actual tests are run. Let’s break it down:</p><ul><li>npx playwright test: Executes the Playwright test suite.</li><li>| tee test-results.log: Outputs the test results to both the console and a test-results.log file.</li><li>continue-on-error: true: Even if some tests fail, the pipeline won’t stop — allowing subsequent steps (like sending Slack messages) to continue.</li></ul><p>This log file will be analyzed in the next step to extract how many tests passed or failed.</p><p>Extracting Failed Tests and Building a Summary Message</p><pre> <br>      - name: Extract test result and build message<br>        id: extract_result<br>        run: |<br>          PASSED=$(grep -oP &#39;\d+(?= passed)&#39; test-results.log || echo 0)<br>          FAILED=$(grep -oP &#39;\d+(?= failed)&#39; test-results.log || echo 0)<br>          TOTAL=$((PASSED + FAILED))<br>      <br>          FAILED_TESTS=$(grep -E &quot;^[[:space:]]*[0-9]+\)&quot; test-results.log | awk &#39;{$1=$1; print $0&quot;\n&quot;}&#39;)<br>      <br>          SUMMARY=&quot;📊 *$TOTAL Total* | ✅ *$PASSED Passed* | ❌ *$FAILED Failed*&quot;<br>      <br>          if [ -n &quot;$FAILED_TESTS&quot; ]; then<br>            MESSAGE=$&#39;🧪 *Playwright Test Results*\n\n*Failed Tests:*\n&#39;&quot;$FAILED_TESTS&quot;$&#39;\n\n&#39;&quot;$SUMMARY&quot;<br>          else<br>            MESSAGE=$&#39;🧪 *Playwright Test Results*\n\n✅ *All tests passed!*\n\n&#39;&quot;$SUMMARY&quot;<br>          fi<br>      <br>          echo &quot;message&lt;&lt;EOF&quot; &gt;&gt; $GITHUB_OUTPUT<br>          echo &quot;$MESSAGE&quot; &gt;&gt; $GITHUB_OUTPUT<br>          echo &quot;EOF&quot; &gt;&gt; $GITHUB_OUTPUT<br></pre><ul><li>grep -E &quot;^[[:space:]]*[0-9]+\)&quot;: Extracts lines corresponding to failed tests path.</li><li>Each failed test line is wrapped in backticks (code block format) for better readability in Slack.</li><li>Collects how many tests passed, failed, and the total count.</li><li>The Slack message is built in the $MESSAGE variable.</li></ul><p>The echo &quot;message&lt;&lt;EOF&quot; block exports the message as an output from this step so that it can be used in a later step (like sending to Slack).</p><p><strong>Sending Test Results to Slack</strong></p><pre>     - name: Send test summary to Slack<br>        env:<br>          SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}<br>          SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}<br>        run: |<br>          curl -X POST https://slack.com/api/chat.postMessage \<br>            -H &quot;Authorization: Bearer $SLACK_BOT_TOKEN&quot; \<br>            -H &quot;Content-Type: application/json&quot; \<br>            --data &quot;$(jq -n \<br>              --arg channel &quot;$SLACK_CHANNEL_ID&quot; \<br>              --arg text &quot;${{ steps.extract_result.outputs.message }}&quot; \<br>              &#39;{channel: $channel, text: $text}&#39;)&quot;</pre><ul><li>This step takes the $MESSAGE content created earlier in the extract_result step.</li><li>It sends a chat.postMessage request to the Slack API using the SLACK_BOT_TOKEN and SLACK_CHANNEL_ID environment variables.</li><li>As a result, test results are instantly posted to your Slack channel.</li></ul><p>✅ <strong>If all tests passed</strong>, the message looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxlNU5gjB8rSNdMgglPrcA.png" /></figure><p>❌ <strong>If there are failed tests</strong>, the message looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S1UaFYH8MWZproIVLq0Nrg.png" /></figure><p>And that’s a wrap — we’ve successfully completed a CI/CD workflow with automated test notifications sent to Slack! With this setup, you can monitor test results in real time and strengthen team communication.</p><p>For more details, feel free to check out the <a href="https://github.com/senakorkmaz/Test-automation-architecture">GitHub repositor</a>y and take a look at my previous post on <a href="https://medium.com/@senanurkorkmaz/playwright-test-automation-pom-bdd-ddt-architectures-96d41d8b2f5f">Playwright architectures</a>. If you have any questions, don’t hesitate to reach out — I’d be happy to help! 💬💞</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad10f3a792a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Playwright Test Automation: POM, BDD & DDT Architectures]]></title>
            <link>https://senanurkorkmaz.medium.com/playwright-test-automation-pom-bdd-ddt-architectures-96d41d8b2f5f?source=rss-c4a93b9229cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/96d41d8b2f5f</guid>
            <category><![CDATA[data-driven-testing]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[bdd-cucumber-framework]]></category>
            <category><![CDATA[page-object-model]]></category>
            <dc:creator><![CDATA[Senanur KORKMAZ]]></dc:creator>
            <pubDate>Mon, 24 Mar 2025 06:01:29 GMT</pubDate>
            <atom:updated>2025-03-24T06:01:29.049Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vq0OVHZpafqNamFhsHnVUg.png" /></figure><p>In this post, I will briefly discuss the most commonly used test automation architectures: <strong>Page Object Model (POM)</strong>, <strong>Data-Driven Testing (DDT)</strong>, and <strong>Behavior-Driven Development (BDD</strong>). I will also share examples showing how you can implement these architectures using <strong>Playwright</strong>. Along with the advantages of each architecture, I will explain how they are applied in real-world scenarios with sample code.</p><p>To help you better understand these implementations, I’ve created a <a href="https://github.com/senakorkmaz/Test-automation-architecture.git"><strong>GitHub repository</strong></a> with examples. You can clone the repository using the command below to view and run it:</p><pre>git clone https://github.com/senakorkmaz/Test-automation-architecture.git</pre><p>Repository structure:</p><pre>Test-automation-architecture/<br>│<br>├── tests/                        # Playwright test scenarios<br>│   ├── bddTests/                 # BDD Testing (Cucumber) examples<br>│   │   ├── features/             # Test scenarios (written in Gherkin)<br>│   │   │   └── login.feature     # Login scenario<br>│   │   ├── steps/                # Step definitions<br>│   │   │   └── loginSteps.js     # Login test steps<br>│   │   ├── world.js              # Cucumber World class<br>│   │   └── cucumber.js           # Cucumber config file<br>│   ├── ddtTests/                 # Data-Driven Testing (DDT) examples<br>│   │   └── loginDDT.spec.js      # Login test<br>│   ├── pomTests/                 # Page Object Model (POM) examples<br>│   │   └── loginPOMTest.spec.js  # Login test<br>│<br>├── pages/                        # Page Object Model (POM) classes<br>│   └── loginPage.js              # Login page POM class<br>│<br>├── testData/                     # Test data (for Data-Driven Testing)<br>│   └── users.json                # User data (for login)<br>│<br>├── playwright.config.js          # Playwright config file<br>├── package.json                  # Dependencies and config file<br>└── README.md                     # Project overview and documentation</pre><p>Now, let’s examine how this structure works and how each architecture is implemented.</p><h4><strong>What is Data-Driven Testing (DDT)?</strong></h4><p><strong>Data-Driven Testing (DDT) </strong>is an approach where the same test scenario is executed with different data sets. Instead of writing the test scenario manually each time, we can <strong>dynamically</strong> run tests <strong>using data from external sources (JSON, CSV, Excel, etc.)</strong>.</p><p>For example, we can use a <strong>JSON file</strong> containing different usernames and passwords to repeat login tests. This approach <strong>speeds up the testing process, simplifies maintenance, and allows for more comprehensive tests</strong>.</p><p><strong><em>→ loginDDT.spec.js</em></strong></p><pre>const { test, expect } = require(&#39;@playwright/test&#39;);<br>const LoginPage = require(&#39;../../pages/loginPage&#39;);<br>const users = require(&#39;../../testData/users.json&#39;).users;<br><br>test.describe(&#39;Data-Driven Login Tests&#39;, () =&gt; {<br>  users.forEach(data =&gt; {<br>    test(`Login test for ${data.username}`, async ({ page }) =&gt; {<br>      const loginPage = new LoginPage(page);<br>      await loginPage.navigate();<br>      await loginPage.login(data.username, data.password);<br><br>      await expect(page).toHaveURL(/inventory/);<br>    });<br>  });<br>});</pre><p>In the Playwright test code written for DDT:</p><ul><li>User information is read from a <strong>JSON file</strong>.</li><li>The test is <strong>automatically executed</strong> for each user.</li><li><strong>Page management</strong> <strong>is handled</strong> using a Page Object Model (POM).</li><li><strong>The URL the page is redirected to is verified </strong>in case of a successful login.</li></ul><h4><strong>What is Page Object Model (POM)?</strong></h4><p>The Page Object Model (POM) is a design pattern used to abstract and manage page interactions in test scenarios. In this approach, each web page is modeled as an object (class), and all actions related to that page (e.g., filling out forms, clicking buttons) are defined within that object.</p><p>For example, instead of writing login actions in every test file, we can define them in a LoginPage class.</p><p><strong><em>→ loginPage.js</em></strong></p><pre>class LoginPage {<br>    constructor(page) {<br>      this.page = page;<br>      this.usernameField = &#39;#user-name&#39;;<br>      this.passwordField = &#39;#password&#39;;<br>      this.loginButton = &#39;#login-button&#39;;<br>    }<br>  <br>    async navigate() {<br>      await this.page.goto(&#39;https://www.saucedemo.com/&#39;);<br>    }<br>  <br>    async login(username, password) {<br>      await this.page.fill(this.usernameField, username);<br>      await this.page.fill(this.passwordField, password);<br>      await this.page.click(this.loginButton);<br>    }<br>}<br>module.exports = LoginPage;</pre><ul><li><strong>Constructor:</strong><br> The constructor of the class takes the page object and defines the CSS selectors for the elements on the login page (username, password, login button).</li><li><strong>navigate():</strong><br> This function redirects the user to the <strong>login page</strong> using the goto method.</li><li><strong>login(username, password):</strong><br> This function performs the <strong>login operation</strong> with the provided username and password. It fills in the fields in the login form and clicks the login button.</li></ul><p>This class manages page interactions centrally according to the <strong>Page Object Model (POM)</strong> architecture, making it reusable in tests.</p><p><strong><em>→ loginPOMTest.spec.js</em></strong></p><pre>const { test, expect } = require(&#39;@playwright/test&#39;);<br>const LoginPage = require(&#39;../../pages/loginPage&#39;);<br><br>test(&#39;User should be able to login&#39;, async ({ page }) =&gt; {<br>  const loginPage = new LoginPage(page);<br>  await loginPage.navigate();<br>  await loginPage.login(&#39;standard_user&#39;, &#39;secret_sauce&#39;);<br><br>  await expect(page).toHaveURL(/inventory/);<br>});</pre><p>In the Playwright test code written for POM:</p><ul><li><strong>An object is created from the LoginPage class</strong>. This class contains all interactions related to the login page.</li><li><strong>The</strong> navigate <strong>function is used to go to the page</strong>. It opens the login page..</li><li><strong>The</strong> login <strong>function is called to perform login with the username and password</strong>. The user information is defined in the test code.</li><li><strong>A successful login check is performed</strong>. When the page is redirected to the correct URL, it confirms that the login operation was successful.</li></ul><h4><strong>What is Behavior-Driven Development (BDD)?</strong></h4><p>It is an approach used to write behavior-driven tests in the software development process. <strong>BDD</strong> facilitates communication between <strong>business units (Business Analyst, Product Manager, Product Owner, etc.)</strong> and <strong>developers</strong>, as test scenarios directly express business requirements. Scenarios are typically written in the “<strong>Given-When-Then</strong>” format and defined using the <strong>Gherkin</strong> language. Now, let’s take a look at our example code together.</p><p><strong><em>→ loginSteps.js</em></strong></p><pre>const { Given, When, Then } = require(&#39;@cucumber/cucumber&#39;);<br>const { expect } = require(&#39;@playwright/test&#39;);<br>const LoginPage = require(&#39;../../../pages/loginPage&#39;);<br><br>let loginPage;<br><br>Given(&#39;User is on the login page&#39;, async function () {<br>  loginPage = new LoginPage(this.page);<br>  await loginPage.navigate();<br>});<br><br>When(&#39;User enters {string} and {string}&#39;, async function (username, password) {<br>  await loginPage.login(username, password);<br>});<br><br>Then(&#39;User should see the product inventory page&#39;, async function () {<br>  await expect(this.page).toHaveURL(/inventory/);<br>});</pre><p>It is used to implement the steps in the feature file written in <strong>Gherkin syntax</strong>. The <strong>Given, When</strong>, and <strong>Then</strong> steps correspond to the scenario statements in Gherkin. These steps are implemented using <strong>Page Object Model (POM)</strong> functions. For example, the navigate() function is used in the <strong>Given</strong> step to go to the page, the login() function is used in the <strong>When </strong>step to perform the login, and the expect() function is used in the <strong>Then</strong> step to validate the URL. This way, we establish a consistent link between the Gherkin scenarios and the tests.</p><p><strong><em>→ login.feature</em></strong></p><pre>Feature: User Login<br><br>  Scenario: Successful Login<br>    Given User is on the login page<br>    When User enters &quot;standard_user&quot; and &quot;secret_sauce&quot;<br>    Then User should see the product inventory page</pre><p>The <strong>Given</strong>, <strong>When</strong>, and <strong>Then</strong> steps correspond to the relevant functions in the <strong>loginSteps.js</strong> file. This approach ensures that tests align with Gherkin scenarios, making them understandable even for <strong>non-technical</strong> individuals.</p><p>You can add new <strong>feature</strong> files to create new scenarios and test different cases. For example, you can easily test different scenarios with files like <strong>login-invalid-credentials.feature</strong> or <strong>login-locked-out.feature.</strong></p><h4>When to Use Which Architecture?</h4><ul><li><strong>POM (Page Object Model):</strong> Used for medium-to-large scale UI tests and increases readability by preventing code duplication.</li><li><strong>BDD (Behavior-Driven Development):</strong> Preferred in collaboration-driven projects, allowing even non-technical people to write tests.</li><li><strong>DDT (Data-Driven Testing): </strong>Used when testing with different data sets. It’s easy to add new data.</li></ul><p>To discover which architecture is best for you, try different methods. You can enhance your applications by exploring the repository on GitHub. If you have any questions, I’m always happy to help! 💞</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96d41d8b2f5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>