<?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 Thilani Mahaarachchi on Medium]]></title>
        <description><![CDATA[Stories by Thilani Mahaarachchi on Medium]]></description>
        <link>https://medium.com/@thilani-mahaarachchi?source=rss-a0da6fb45f6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*X_SVQZYmFq0ZjSM7rddK0Q.jpeg</url>
            <title>Stories by Thilani Mahaarachchi on Medium</title>
            <link>https://medium.com/@thilani-mahaarachchi?source=rss-a0da6fb45f6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 18:13:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thilani-mahaarachchi/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[Generating custom loads with Locust]]></title>
            <link>https://thilani-mahaarachchi.medium.com/generating-custom-loads-with-locust-cffe72078f6b?source=rss-a0da6fb45f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/cffe72078f6b</guid>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[locust]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[loadtestshape-class]]></category>
            <dc:creator><![CDATA[Thilani Mahaarachchi]]></dc:creator>
            <pubDate>Tue, 28 Sep 2021 07:42:59 GMT</pubDate>
            <atom:updated>2021-09-28T07:42:59.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3rPgHqLMBmOx80SwKaltIQ.png" /></figure><h3><strong>The significance in ramping-up and ramping-down the user load</strong></h3><p>Performance tests support in creating reliable applications and make a better end-user experience. Hence, before we release an application to production it is recommended to run performance tests. Load testing scripts that can simulate actual user behaviors should be developed to understand performance bottlenecks. And then developers can come up with appropriate fixes. User patterns and application usage should be analyzed before writing performance scripts. These analyses indicate where the usual and peak traffic times exist.</p><p>A load test carried out with a thorough understanding of these patterns gives more accurate results. Every application has its peak hours in real user environments, where concurrent users tend to increase gradually before the start of peak time, which is known as ramp-up. And at the end of peak time, a drop in concurrent users is observed which is ramp-down. And in spike tests, we drastically ramp up and ramp down traffic load to evaluate the behavior of the software application under sudden increment or decrement in user load and determine recovery time after a spike in user load.</p><p>These ramping ups and ramping downs help to test how the server auto-scaling happens to manage the load. Reflect more real-like server metrics like CPU utilization and memory utilization further. Response time will also be close to the production environment so the testers can come up with more realistic performance statistics.</p><h3>Locust</h3><p>We can generate similar load test scenarios and check at what stage our infrastructure starts misbehaving using Locust. Locust is an open-source performance testing framework written in Python which allows writing performance scripts in pure Python. The tool is implemented to resolve some specific issues with existing performance tools. You can write some effective performance scripts using this framework with some Python experience.</p><h3><strong><em>LoadTestShape </em>class in Locust</strong></h3><p>Locust supports controlling user count and simulates load test strategies by using its <strong><em>LoadTestShape</em></strong> class. When we need to test how our applications behave during high traffic times, that cannot be achieved by simply setting or changing the user count and spawn rate. In such scenarios, a completely custom-shaped load test is required.</p><p>You can simply do it by creating a class that inherits <strong><em>LoadTestShape. </em></strong>In the same class, you need to define a <strong><em>tick()</em></strong> method that returns a tuple with the ‘user count’ and ‘spawn rate’(number of users to start per second). If you want to stop the test, you can return <strong><em>None</em></strong>. Locust calls this<strong><em> tick()</em></strong> method roughly once per second.<br> <br> Let’s look at the below Locust script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*ww9w1h-04V8WQ8VmIvbjMg.png" /><figcaption>Figure (1). loadtestShape.py</figcaption></figure><p>This script executes a GET request to launch <a href="http://www.demoblaze.com/">www.demoblaze.com</a>.</p><p>To create a more real user behavior in code, a wait_time has been declared which makes a simulated user wait for 0.5 seconds after each task. Then in the class which inherits the LoadTestShape class, time base stages are declared.</p><p>In this script,</p><ul><li>The load will start with 0 users and a spawn rate of 10 until the 15 seconds mark</li><li>Then continue with a spawn rate of 10 users and ramp-up to 50 users until the 45 seconds mark</li><li>Then again continue with a spawn rate of 10 users and ramp-up to 100 users until the 75 seconds mark</li><li>Then continue with a spawn rate of 10 users and ramp-down to 30 users until the 90 seconds mark</li><li>Then continue with a spawn rate of 10 users and ramp-down to 10 users until the 105 seconds mark</li><li>Then continue with a spawn rate of 1 user and ramp-down to 1 user until the 120 seconds mark</li><li>And finally, end the stages and ramp-down to 0 user</li></ul><p>Once you run the script by running the command locust -f &lt;file_name&gt;.py, you can access the web user interface at <a href="http://localhost:8089/">http://localhost:8089</a> as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Kcf142fCxblXbhIyMlZjw.png" /><figcaption>Figure (2). Running the Locust file</figcaption></figure><p>You don’t need to provide the total user and hatch rate for a locust script with a custom load shape as we define those values in stage steps. Hence, the fields for the user count and hatch rate are disabled in the web interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*0-ZzwaQ_TMsv2O68UxZL0g.png" /><figcaption>Figure(3). Starting a new load test</figcaption></figure><p>And then click on the “<strong>Start swarming</strong>” button. In the console log following output can be observed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UqfL9wwQ-dzudktSajA9GA.png" /><figcaption>Figure(4).Console log which explains the load</figcaption></figure><p>The test will stop once it completes all the stages and the following statistics can be observed in the console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rY8BVpd93wXx0DdBUIfTmA.png" /><figcaption>Figure(5).Console log statistics</figcaption></figure><p>In the statistics tab of the web user interface, Locust presents data about the executed script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z9mg9x2e7md3dRKIm6HMkA.png" /><figcaption>Figure(6).User interface statistics</figcaption></figure><p>And the <strong>Number of Users graph</strong> in the charts tab indicates how the users are ramped up and ramped down during the defined interval.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b28OfEBwg48KDyYtCQYBuA.png" /><figcaption>Figure(7).Number of Users graph</figcaption></figure><p><strong>Conclusion</strong></p><p>A load testing script that can simulate real-world scenarios is required to verify whether a web application behaves well during high traffic times. Comping up with a strategy and simulating the real usage pattern of an application can help us find the actual issues at the correct time using tools like Locust.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cffe72078f6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fiddler Classic for security testing.]]></title>
            <link>https://thilani-mahaarachchi.medium.com/fiddler-classic-for-security-testing-a3a253cd3079?source=rss-a0da6fb45f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3a253cd3079</guid>
            <category><![CDATA[fiddler]]></category>
            <category><![CDATA[security-testing]]></category>
            <dc:creator><![CDATA[Thilani Mahaarachchi]]></dc:creator>
            <pubDate>Sat, 14 Aug 2021 18:09:56 GMT</pubDate>
            <atom:updated>2021-08-14T18:09:56.210Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EPbBQ0r0E9L3roQjBXp8FQ.jpeg" /></figure><p>Identifying security vulnerabilities of web applications is vital to avoid loss of customer trust, website downtime, and securing web applications against future attacks. Web security testing tools are useful in proactively detecting these vulnerabilities and securing websites against attacks. In my <a href="https://thilani-mahaarachchi.medium.com/security-testing-with-fiddler-everywhere-8c69a3f5c190">last article</a>, I described how to access three of the most common security vulnerabilities using Fiddler Everywhere, which used to be an open-source tool. Since Telerik decided to make it a commercial tool, I am writing this article to explain how the same vulnerabilities can be accessed by Fidler classic, which has been a free tool since its launch.</p><p>You can download <a href="https://www.telerik.com/download/fiddler">Fiddler Classic</a> by Telerik from their official website. And then install it.</p><p><strong>Setting Up</strong></p><p>a) To start with, close down all the applications that communicate with the network except one tab for a specific browser. Then launch Fiddler.</p><p>b) For Fiddler to decrypt the HTTPS session, its root certification should be trusted. This is done to provide an SSL proxy so that unencrypted traffic is also captured.</p><p>To do this, go to Tools and select Options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*7O12WL8jAYBlm1i3FITTLw.png" /></figure><p>And select the HTTPS tab. Select the checkboxes for ‘<strong>Capture HTTPS CONNECTS</strong>’ and <strong>‘Decrypt HTTPS traffic. </strong>Then click on the<strong> Actions </strong>button and select<strong> ‘Trust Root Certificate’.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*rzxfu1SGNnnO2no9TVVHBA.png" /></figure><p>c) Then the request header that you need to capture has to be configured in the filter window. This information can be taken from the Network tab after loading your web application’s URL in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*q_Lxh2qz8KUmndtzwm6lJg.png" /></figure><p>Go to the Filters tab in Fidler and enable filtering. From the ‘<strong>Hosts</strong>’ dropdown option select <strong>‘Show only the following hosts’</strong> and give the hostname to the text field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*P0EFXK1gEojCIlRHhHIBAQ.png" /></figure><p>Then run the web application in the browser. Once it starts to run, Fiddler will start capturing the API calls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*98Q0CNjRPCDOyITAiGC4IA.png" /></figure><p>d) Pick one of the requests, then take a look at the <strong>Inspectors</strong> tab. Fiddler will show the request information and the Response in the right-side grids.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t9P0MRRDFfDi7YYAdQ9ESw.png" /></figure><h3><strong>Security tests.</strong></h3><p><strong>1: Parameter Tampering</strong></p><p>In Parameter Tampering, manipulated parameters are exchanged between client and server to modify application data, such as user credentials, permissions, quantity, etc.<br> The Composer tab in Fiddler allows editing requests by changing the values of form fields or query strings. To test this,</p><ol><li>In Fiddler go to the Composer tab</li><li>Select a captured API call and drag it over to the <strong>Composer</strong> tab. The raw text of the request will be filled in.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XeLJOfeXDj-mewOuNLmdaA.gif" /></figure><p>3) Then in the request body, change the form field values.</p><p>Since we are testing the security aspects, be mindful to choose form fields that are important concerning security.</p><p>Here in this example, product_id and variant_merchant_id are chosen to be edited because this pair can not have any other values.</p><p>“product_id”: 23144<br>“variant_merchant_id”: 55190</p><p>That means product 23144 is only sold by merchant 55190. No other merchant sells product 23144.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*jjv7_l8k1YJDs2WDe8qx1A.png" /></figure><p>4). After setting a different value to “variant_merchant_id” the call is executed again by clicking on the execute button.</p><p>And a successful response body is received and the same item was added to the cart with the tampered variant_merchant_id, which means the selected API request is vulnerable to Parameter Tampering.</p><p>If you get an unsuccessful response, the selected API request is immune to Parameter Tampering.</p><p>To avoid Parameter Tampering, the applications must always validate the incoming parameters.</p><p><strong>2: Broken Authentication and Session Management</strong></p><p>This vulnerability happens when the application lets people access secure data without forcing them to log on first.</p><p>To test this,</p><p>1) While Fiddler is running, log on to the application, do something there that requires a user to be logged on, then log off.</p><p>2) Select an API call from the Fiddler, where login should be required, right-click, and select Replay and then Reissue Unconditionally (<em>Unconditional Reissue will replay the request without first checking whether anything has changed on the server</em>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*07wTamQGAf8TV3IapFwF7g.png" /></figure><p>3) If you get a successful response body, it means the application is vulnerable to Broken Authentication and Session Management. If you get an unsuccessful response, the application is immune to Broken Authentication and Session Management.</p><p><strong>3. Missing Function Level Access Control</strong></p><p>This vulnerability is about letting the browser decide what form fields to show, hide, or make read-only based on the level of access, and not doing the same set of checks when making changes.</p><p>To test this,</p><p>1) While Fiddler is running, log on to the application, as a user (User A) who <strong>has access</strong> permission <strong>for a particular module.</strong><br>Then log out. Fiddler will record the session information.</p><p>2) Login with a <strong>regular user (User B) </strong>who <strong>has not access</strong> permission <strong>for the particular module</strong> in the application.</p><p>3) From Fiddler, select the <strong>API call</strong> related to <strong>User A</strong> and drag it to the <strong>Composer</strong> tab.</p><p>4) Now go to the <strong>Inspector</strong> tab and <strong>Auth</strong> and pick <strong>User B</strong>’s (regular user’s) most recent request with an <strong>‘Authorization key’</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fziQJKjlQ4hGXOeIvyDljA.png" /></figure><p>5) Copy the User B’s <strong>Authorization key’</strong>.</p><p>6) Replace the User B’s <strong>Authorization key’</strong> in the <strong>Composer</strong> request of User A’s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*l3c2Iz52a9axxkEsb9yvcQ.png" /></figure><p>7) Execute the doctored request from the <strong>Composer.</strong></p><p>If you get a successful response body, it means the application is vulnerable for Function Level Access Control. If you get an unsuccessful response, the selected API request is immune for Function Level Access Control.</p><p><strong>Fiddler Classic vs Fidler Everywhere</strong></p><p>Fiddler Classic is not appealing to the users due to its cluttered complicated UI. And the tool is not straightforwardly accessible by macOS and Linux developers, whereas Fiddler Everywhere is a more attentive application of Fiddler which provides access to the most treasured features of Fiddler Classic. And it fiddles across all platforms including macOS, Linux, and Windows.</p><p>Fiddler Classic is a tool with a lot of features that it has implemented over its lifespan. And not all of them are in Fiddler Everywhere and it is highly doubtable will all of them ever be in Fiddler Everywhere. Fiddler Everywhere has significant usability improvements but it is becoming a paid tool in the near future whereas Fiddler Classic has been a free tool for its all past 15 years.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3a253cd3079" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security Testing with Fiddler Everywhere]]></title>
            <link>https://thilani-mahaarachchi.medium.com/security-testing-with-fiddler-everywhere-8c69a3f5c190?source=rss-a0da6fb45f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c69a3f5c190</guid>
            <category><![CDATA[broken-authentication]]></category>
            <category><![CDATA[security-testing]]></category>
            <category><![CDATA[parameter-tampering]]></category>
            <category><![CDATA[access-control]]></category>
            <category><![CDATA[fiddler-everywhere]]></category>
            <dc:creator><![CDATA[Thilani Mahaarachchi]]></dc:creator>
            <pubDate>Wed, 31 Mar 2021 05:54:12 GMT</pubDate>
            <atom:updated>2021-03-31T05:54:12.197Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CP4XdWzQ61X9CeLz8rLp8g.jpeg" /></figure><p>Security threats are growing rapidly and are persistent. Hence the need for security testing can no longer be ignored. Security Testing reveals the vulnerabilities of a system and finds out the possible weaknesses which might result in losing data or reputation.</p><p><a href="https://owasp.org/www-project-top-ten/">OWASP</a> provides the top 10 most critical web application security risks of the year since 2003. These risks are ranked on the frequency, severity, and magnitude of their potential impact. This list offers web developers and security professionals insights into the most predominant security risks. These insights will allow them to find solutions to minimize the known risks in their applications.</p><p>Some software testers assume security testing is a very complex task left only to the security test professionals. The glossary used by the security test experts makes the subject look scarier.</p><p>But when I started learning about security testing, I found that though there is a lot to learn, it is not hard to get started. There are so many free tools to try out security testing and I chose Fiddler Everywhere. And in this article, I discuss how to assess some of the most common security vulnerabilities using Fiddler Everywhere.</p><p>First, download and install <a href="https://www.telerik.com/download/fiddler-everywhere">Fiddler Everywhere</a> by Telerik. Then log in to Fiddler with a preferred account.</p><p><strong>Configuration</strong></p><ol><li>Since Fiddler is capturing all the outgoing network calls, we need to apply a filter to capture the required HTTP/HTTPS traffic. To do that, click on the filter icon and let the filter window open.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gp_zd3IKqH2-ZQ819cv_Yw.png" /><figcaption>a) Filter window button</figcaption></figure><p>2) Then configure the request header that you need to capture in the filter window.</p><p>This information can be taken from the Network tab after loading your web application’s URL in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-TxHRM9WxgSoodveP07W9Q.png" /><figcaption>b) Network tab — header</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*W_De0uNnNhitFwWbn0XLiQ.png" /><figcaption>c)Filter window</figcaption></figure><p>3) Then reload your web application in the browser.<br> Once it starts to run, Fiddler will start capturing the API calls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NPikIkujhee2A8fFSHRTlw.png" /><figcaption>d) Live traffic capturing</figcaption></figure><p>4) When a particular call is selected, Fiddler will show request information and the response in the right-side grids.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZADGdrrVbw2VhZAnNihxlw.png" /><figcaption>e) Right side grids</figcaption></figure><p>5) By default HTTPS calls can not be decoded by Fiddler. To do that you have to add the Fiddler root certificate into the operating system.</p><p>You can do that easily by clicking the ‘Trust’ button in Fiddler setting window and checking the ‘Capture HTTPS traffic’ option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*mFajPkT4lTitcfVpMfieHw.png" /><figcaption>f) Fiddler SSL Certificate</figcaption></figure><p><strong>Security tests</strong></p><p><strong>1: Parameter tampering</strong></p><p>In Parameter Tampering, manipulated parameters are exchanged between client and server in order to modify application data, such as user credentials, permissions, quantity, etc.</p><p>The Composer tab in Fiddler allows editing requests by changing the values of form fields or query strings. To test this,<br>1) Select a captured API call<br>2) Right-click → Select ‘Edit in Composer’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bWFV7WYWf_c065Noy7lfsQ.png" /><figcaption>g) Edit in composer</figcaption></figure><p>3) Then in the request body, change the form field values.</p><p>Since we are testing the security aspects, be mindful to choose form fields that are important concerning security.</p><p>Here in this example, product_id and variant_merchant_id are chosen to be edited because this pair can not have any other values.</p><p>“product_id”: 13747<br>“variant_merchant_id”: 30867</p><p>That means product 13747 is only sold by merchant 30867. No other merchant sells product 13747.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NVPTMl5AXNngDyGy0HGVTQ.png" /><figcaption>h) Composer — body data</figcaption></figure><p>4. After setting a different value to “variant_merchant_id” the call is executed again by clicking on the execute button.</p><p>And a successful response body is received and the same item was added to the cart with the tampered variant_merchant_id, which means the selected API request is vulnerable to Parameter Tampering.</p><p>If you get an unsuccessful response, the selected API request is immune to Parameter Tampering.</p><p>To avoid Parameter Tampering, the applications must always validate the incoming parameters.</p><p><strong>2: Broken Authentication and Session Management</strong></p><p>This vulnerability happens when the application allows people to access secure data without forcing them to log in first. To test this,</p><p>1) While Fiddler is running, log in to the application, perform some actions that require a user to be logged in, then log off.<br>2) Select an API call from the Fiddler, which requires a user to log in, right-click, and select Replay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*moYFoZCL4cKuIzII_eObzQ.png" /><figcaption>i) API replay</figcaption></figure><p>3) If you get a successful response body, it means the application is vulnerable to Broken Authentication and Session Management. If you get an unsuccessful response, the application is immune to Broken Authentication and Session Management.</p><p><strong>3. Missing Function Level Access Control</strong></p><p>This vulnerability is about letting the browser decide what form fields to show, hide, or make read-only based on the level of access, and not doing the same set of checks when making changes. To test this,</p><p>1) While Fiddler is running, log in to the application, as a user <strong>(User A) </strong>who has access permission for a <strong>particular module. ex: Admin user</strong><br>Then log out.<br>2) Login with a <strong>regular user (User B) </strong>who <strong>does not have access</strong> permission for the<strong> particular module</strong> in the application.<br>3) From Fiddler, select the <strong>API call</strong> related to <strong>User A</strong> and <strong>open it in the composer.<br></strong>4) Now go to the <strong>Live traffic tab</strong> and pick <strong>User B</strong>’s most recent request with an <strong>‘Authorization key’</strong>.<br>5)Copy the User B’s <strong>Authorization key’</strong> from the <strong>inspector</strong> tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*SmrI49yppW6spZgW7sjrDQ.png" /><figcaption>i) Authorization key</figcaption></figure><p>6) Replace the User B’s <strong>Authorization key’</strong> in the <strong>Composer</strong> request of User A’s. Click on the tick icon.<br>7) Execute the doctored request from the <strong>Composer.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PD8eN7t-pnUzxqX8VF5--g.png" /><figcaption>j) Doctored request</figcaption></figure><p>8) If you get a successful response body, it means the application is vulnerable to Function Level Access Control. If you get an unsuccessful response, the selected API request is immune to Function Level Access Control.</p><p>Kudos! With these security tests, you have covered some of the common security vulnerabilities which you might have assumed too difficult before you read this article. Happy testing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c69a3f5c190" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Measuring Web Accessibility with DevTools]]></title>
            <link>https://thilani-mahaarachchi.medium.com/measuring-web-accessibility-with-devtools-69073b266aff?source=rss-a0da6fb45f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/69073b266aff</guid>
            <category><![CDATA[accessibility-testing]]></category>
            <category><![CDATA[devtools]]></category>
            <dc:creator><![CDATA[Thilani Mahaarachchi]]></dc:creator>
            <pubDate>Fri, 19 Jun 2020 11:30:31 GMT</pubDate>
            <atom:updated>2020-06-19T11:30:31.439Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*Qq2Vh1LovKFT7HXUVmUXqg.png" /></figure><p>There are 7.8 billion people in the world, and they come with different abilities. According to the World Bank, 1 billion people or 15% of the world’s population experience some form of disability. Though someone may be good at reading a road sign from far away, someone may not. Another person will find reading small text easier than another person. So, accessibility is not either true or false, rather it is a measurement.</p><p>COVID-19 pandemic has brought concepts such as online transactions, working from home, e-education, and real-time communication platforms into the limelight. Many people adapting to the situation find themselves using new software they may not have used before.</p><p>These tools and technologies may not cater to everyone’s needs equally as many of these people will be differently-abled from each other. Thus, these software applications which facilitate services need to be accessible to all the users to cater to the broadest audience possible.</p><p>We, as software testers, have the responsibility to make sure that our products can be used by ‘<strong>everyone</strong>’. It is a good practice to implement accessibility techniques in the initial stage of the project. Both testing and fixing in-accessible software products requires additional effort. Most importantly, there are recommended certain laws and guidelines to follow to come up with an accessibility rich product.</p><p>Accessibility of the web can be measured with the help of web accessibility standards created by the <strong>Web Content Accessibility Guidelines (WCAG)</strong>.</p><p>WCAG recommends building <strong>POUR</strong> websites. Simply it means, a website should have the following characteristics to make it accessible.</p><p><strong>Perceivable:</strong> Presentation of the web site should be perceivable. Content should make sense from all the perspectives of all the users.</p><p><strong>Operable: </strong>One can say that the site is operable if a user is able to navigate the site easily.</p><p><strong>Understandable:</strong> Everything present on the website must be understood by any type of user. In short, the language should be convenient and not a complex one.</p><p><strong>Robust:</strong> Regardless of the changing technology and the type of users, the content should be robust.</p><p><strong>Example techniques:</strong></p><p><strong>Perceivable</strong>: Image text alternatives (“alt text”), Contrast ratio (“color contrast”)<br><strong>Operable: </strong>Keyboard access, Current focus indication<br><strong>Understandable:</strong> Verification of page title, Language metadata<br><strong>Robust: </strong>Run markup and code through linters, Code review</p><p>Many tools are available in the market for accessibility testing, still, we can apply manual testing as well. Below I have mentioned a few ways to test website accessibility with developer tools.</p><p><strong>1) Color contrast</strong></p><p>One of the most important techniques of making accessible websites is ensuring readable text. The readable text means making sure adequate color contrast has been used between the text colors and background colors. If the text has a low contrast ratio, then the low vision users may literally experience the web site as a <strong><em>blank</em></strong> screen.</p><p>1. Open Chrome DevTools.<br>2. Click the Elements tab.<br>3. Click on the Element Finder<br>4. Focus on the element that you want to inspect and let the CSS properties popup open.</p><figure><img alt="recommended contrast ratio" src="https://cdn-images-1.medium.com/max/232/1*KnQcomb2HB475bh3lOg0dQ.png" /><figcaption>Image (a)</figcaption></figure><p>According to the above Image (a), a contrast ratio score of 17.65 has given for the text element. The green tick next to the score signifies this contrast ratio is within the accepted parameters for accessibility.</p><figure><img alt="contrast ratio — below recommended" src="https://cdn-images-1.medium.com/max/330/1*aTa1S6HT4riyJ9oQ_FUB6w.png" /><figcaption>Image (b)</figcaption></figure><p>For the element given in Image (b), the contrast ratio is 2.48 and, the yellow warning sign next to the score indicates it is below the accepted parameters for accessibility. This means we need to integrate the new colors for the element given in Image (b)</p><p><strong>2) Page title</strong></p><p>Page titles help people know where they are and move between pages open in their browser. The title should be <strong>different from other pages on the website,</strong> and effectively <strong>distinguishes the page from other web pages.</strong></p><p>If you have trouble finding the page title from the title bar, use the find function available in ‘page source’. The webpage Title is everything between &lt;title&gt; and &lt;/title&gt;.</p><p>1. Open Chrome DevTools.<br>2. Click the Elements tab.<br>3. Select Ctrl + F and then type “title” to quickly find the Title.<br>4. The webpage Title is everything between &lt;title&gt; and &lt;/title&gt;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*HaHGfPm8MjecCzM78-sCRg.png" /></figure><p><strong>3. Text alternatives (“alt text”)</strong></p><p>The text alternative is about conveying the purpose of an image. “alt text” should be applied if an image carries information beneficial for interacting with or understanding the web page content. These are <strong><em>used by the people who do not see the image</em></strong> such as people who are blind. They use screen readers which reads out the alt text.</p><p>The text must be functional and provide a corresponding user experience. For example, an appropriate text alternative for a notification icon would be “notifications”, not “bell”.</p><p>To verify “alt text”,</p><p>1. Open Chrome DevTools.<br>2. Click the Elements tab.<br>3. Click on the Element Finder.<br>4. Focus on the particular image element.<br>5. Verify the alt in the markup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*Z1IRfE5rwiMVoOOSLP3bEA.png" /></figure><p>When the image is just decorative, then it should have a null alt.</p><p><strong>Lighthouse</strong></p><figure><img alt="lighthouse logo" src="https://cdn-images-1.medium.com/max/252/1*myInVJoqHR33fRRvpvDzfg.png" /></figure><p>Lighthouse is an open-source, automated tool that can improve the quality of web pages. It can be run on any web page, public, or requiring authentication. This is available in Chrome DevTools. When a URL is given, Lighthouse runs a series of audits against the page, and then it generates a report on how well the page did. A “Good” score is above 80 and “bad end-user experience” is a score lower than 80.<strong> </strong>The report indicates on how to improve the page.</p><p><strong>Accessibility test with the lighthouse</strong></p><p>1. Open Chrome DevTools.<br>2. Click the Lighthouse tab.<br>3. Select ‘Accessibility’ as the category and ‘Desktop’ as the device<br>4. Click on the Generate Report button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*E3gNgg18kIWDfPsYiUVK7A.png" /></figure><p>Then we will get an accessibility score as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*69AssJDfN8ywZebnLHfMVA.png" /></figure><p>The score is 64, which is somewhat low. And the report suggests how to improve the accessibility score. Let us review the suggestions given.</p><p>The suggestions to increase the score are :</p><p>1.To have values for the attributes which is a desirable feature for screen readers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*oA5IZumOkJqmqODsGOqi9A.png" /></figure><p>2. Image not having the alt attribute. This is highly useful for users with vision difficulty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*2znSHfAsEdXkaC5g31CcWQ.png" /></figure><p>3. Form elements are not having labels</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*g0ohHksM8_BJi0U6XHtbLg.png" /></figure><p>By adding these suggestions, web page accessibility can be improved. To increase the quality of our software products, we can maintain a separate accessibility test suite. Else, for each backlog item, we can add a test case to capture these accessibility parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6KlA4uEtnm8-iTTjDNAFg.png" /></figure><p>So, with this simple process, we can enhance the quality and bring more crowd to our web applications. Happy testing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69073b266aff" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>