<?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 Sparshi Dhiman on Medium]]></title>
        <description><![CDATA[Stories by Sparshi Dhiman on Medium]]></description>
        <link>https://medium.com/@sparshidhiman?source=rss-bbda8b091ae9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RxyRTUqMfIPCGz_1.</url>
            <title>Stories by Sparshi Dhiman on Medium</title>
            <link>https://medium.com/@sparshidhiman?source=rss-bbda8b091ae9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 18:47:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sparshidhiman/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[Decode JWT Token in Apache Jmeter]]></title>
            <link>https://medium.com/@sparshidhiman/decode-jwt-token-in-apache-jmeter-3e9123192529?source=rss-bbda8b091ae9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e9123192529</guid>
            <category><![CDATA[decode]]></category>
            <category><![CDATA[jwt-token]]></category>
            <category><![CDATA[jwt-authentication]]></category>
            <category><![CDATA[apache-jmeter]]></category>
            <dc:creator><![CDATA[Sparshi Dhiman]]></dc:creator>
            <pubDate>Tue, 12 Apr 2022 10:05:26 GMT</pubDate>
            <atom:updated>2022-04-12T10:05:26.113Z</atom:updated>
            <content:encoded><![CDATA[<p>JSON Web Token (JWT) is an open standard and secured way to send information between two parties i.e. client and server. JWT can be used as an authentication system which contains encoded JSON objects.</p><p>As JWT token is encoded, hence to extract information from JWT token, we need to decode it and pass as variable for subsequent requests if needed.</p><p>Lets see with an example how can we achieve it via using Apache Jmeter.</p><p><strong>Identifying JWT Token</strong></p><p>JWT token is a string which contains <strong>header, body and signature </strong>seperated by three dots which can be seen in response body of any HTTP request e.g. HTTP Request Test1 .</p><p>For example,</p><p>{jwtToken”:”eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c”}</p><p>Now, add regular expression extractor against HTTP Request Test1 to get value of JWT token so that we can decode it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-B9s7Fo8vZ9dlGCPGPCCmQ.png" /></figure><p>Now, add JSR223 PostProcessor against HTTP Request Test1 to deocode the value of variable “jwt_Token” and print in response body.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRJeAhdINvKoSg0tNqK94Q.png" /></figure><p><strong>Excerpt:</strong></p><blockquote><em>import org.apache.commons.codec.binary.Base64;</em></blockquote><blockquote><em>String jwtToken = vars.get(‘jwt_Token’);<br> log.info(“ — — — — — — Decode JWT — — — — — — “);<br> String[] split_string = jwtToken.split(“\\.”);<br> String base64EncodedHeader = split_string[0];<br> String base64EncodedBody = split_string[1];<br> String base64EncodedSignature = split_string[2];</em></blockquote><blockquote><em>log.info(“~~~~~~~~~ JWT Header ~~~~~~~”);<br> Base64 base64Url = new Base64(true);<br> String header = new String(base64Url.decode(base64EncodedHeader));<br> log.info(“JWT Header : “ + header);</em></blockquote><blockquote><em>log.info(“~~~~~~~~~ JWT Body ~~~~~~~”);<br> String body = new String(base64Url.decode(base64EncodedBody));<br> log.info(“JWT Body : “+body);</em></blockquote><blockquote><em>// to print the decoded JWT value in response body of JSR223 PostProcessor<br> prev.setResponseData(body,”UTF-8&quot;);</em></blockquote><p>Response body of HTTP Request 1 will show values like this</p><blockquote>{<br> “alg”: “HS256”,<br> “typ”: “JWT”<br>},</blockquote><blockquote>{<br> “sub”: “1234567890”,<br> “name”: “John Doe”,<br> “iat”: 1516239022<br>},</blockquote><p>Now, add JSON extractor to extract the value of any key e.g. name and pass to variable e.g. name_value so that it can be used in subsequent HTTP requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MSUrOM3om2R_hCDmLpx-LA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e9123192529" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Browser Stack Integration with Katalon Studio for automated testing of private/local sites.]]></title>
            <link>https://medium.com/@sparshidhiman/browser-stack-integration-with-katalon-studio-for-automated-testing-of-private-local-sites-41acbde04fbf?source=rss-bbda8b091ae9------2</link>
            <guid isPermaLink="false">https://medium.com/p/41acbde04fbf</guid>
            <dc:creator><![CDATA[Sparshi Dhiman]]></dc:creator>
            <pubDate>Wed, 03 Jun 2020 10:27:05 GMT</pubDate>
            <atom:updated>2020-10-21T06:37:35.897Z</atom:updated>
            <content:encoded><![CDATA[<h3>Browser Stack Integration with Katalon Studio for test automation of private/local sites</h3><p>Here is the step by step guide to run web UI test scripts written with Katalon Studio on browserstack platform —</p><h4>Get Browser Stack Username and Access Key</h4><p>Login to Browser Stack Account &gt; Settings &gt; and note down Username and Access Key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*4g9Hsvxx5inwhCm-yZTkDQ.png" /></figure><h4>Set Custom Remote Capabilities in Katalon Studio</h4><p>Open Katalon Studio &gt; Project (Menu bar) &gt; Settings &gt; Desired Capabilities &gt; Custom &gt; Add remote capability</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*p072oD9w8G1RdqUfAECGhg.png" /></figure><p><strong>Remote Server URL :</strong> https://” + USERNAME + “:” + AUTOMATE_KEY + “@hub-cloud.browserstack.com/wd/hub ; where Username and Access key needs to added.</p><p><strong>Remote Server type : </strong>Selenium/Appium</p><p><strong>Add Desired Capabilities:</strong></p><p>For example to run the automated script on Windows 10, Edge 81.0</p><p><em>os : Windows</em></p><p><em>os_version: 10</em></p><p><em>browser: Edge</em></p><p><em>browser_version : 81.0</em></p><p><em>browserstack.local : true // To test private/local sites</em></p><p><em>browserstack.debug : true</em></p><p><em>browserstack.networkLogs : true</em></p><p><strong>For all available devices/browsers on browser stack, check the desired capabilities here </strong><a href="https://www.browserstack.com/automate/capabilities">https://www.browserstack.com/automate/capabilities</a></p><p>Once the Custom Remote Capability is set, it will appear under Run Options</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*k2mJLYXs9bwJSjOLmtjdOA.png" /></figure><h4>Enabling Local Testing</h4><ol><li>Download the appropriate binary from <a href="https://www.browserstack.com/local-testing/automate">here </a>for your system to start a Local Testing connection through your command-line interface</li></ol><p>2. Unzip the binary to a folder/directory on your machine.</p><p>3. Open your command-line interface and navigate to the folder containing the Local binary.</p><p>4. Run the binary using the following command:</p><p>BrowserStackLocal.exe --key WgPpBqpFLvTHRMF4Tmy6 --force-local</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*zqkwBC6ySThTRShyqjCWVA.png" /></figure><p><strong>Execute Tests on Browser stack with custom remote capabilities</strong></p><p>Select test case/test suite &gt;Run Options &gt; Click on Custom capabilities &gt; click on option e.g. winedge as shown in screenshot above.</p><p>Navigate to browserstack account &gt; automate &gt; dashboard and view test script execution status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*L_KhK8AFAlsLA9AlnCs4IA.png" /></figure><p>Click on the build to view session and execution</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*oce24rxaksMLF1lfsLz8fA.png" /></figure><p>And its done!! Happy Testing!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41acbde04fbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>