<?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 Aditi Gupta on Medium]]></title>
        <description><![CDATA[Stories by Aditi Gupta on Medium]]></description>
        <link>https://medium.com/@aditi.ambitious?source=rss-4b6253e8cd9f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*eohE31gu-nQyW9ep</url>
            <title>Stories by Aditi Gupta on Medium</title>
            <link>https://medium.com/@aditi.ambitious?source=rss-4b6253e8cd9f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 15:05:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aditi.ambitious/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[ From Hours to Minutes: How We Used GenAI to generate new and modify existing automation…]]></title>
            <link>https://medium.com/naukri-engineering/from-hours-to-minutes-how-we-used-genai-to-generate-new-and-modify-existing-automation-4f9e8d4da3eb?source=rss-4b6253e8cd9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f9e8d4da3eb</guid>
            <dc:creator><![CDATA[Aditi Gupta]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 13:42:32 GMT</pubDate>
            <atom:updated>2025-07-16T16:51:05.269Z</atom:updated>
            <content:encoded><![CDATA[<h3>🤖 <strong>From Hours to Minutes: GenAI for Testcase Automation in IntelliJ</strong></h3><p>It all started with a common pain most QA engineers face.</p><p>You’re juggling multiple tasks — executing regression suites, attending sprint ceremonies, reviewing test coverage — and somewhere in between, you’re expected to write clean, maintainable automation code for 10 new and 5 existing NITMs (oops, test cases — in Naukri, we often call them by their Jira project names) before EOD.</p><p>You open IntelliJ, stare at the screen, and the thought hits:</p><blockquote>“Didn’t I write something similar last sprint? Where’s that method? Should I create a new one or update the existing code?”</blockquote><p>You dig through files.<br> Check for reusable methods.<br> Maybe even ping a teammate to ask, <em>“Hey, did we automate something like this before?”</em></p><p>And this loop kept repeating — sprint after sprint.</p><h3>💡 The Spark: What If GenAI Could Write Automation Code?</h3><p>That was the trigger.<br>We asked ourselves:</p><p>Can we build something that reads the context of a test case, understands reusable patterns, and writes automation code like a seasoned QA engineer?</p><p>So we built it.</p><p>A <strong>GenAI-powered IntelliJ plugin</strong> — not just to generate new test cases but also to intelligently modify existing ones, understand the codebase, and even self-heal when page elements change.</p><p>That’s how the <strong>Automation Code Generator</strong> was born.</p><h3>✨ What It Can Do</h3><p>This isn’t your typical plugin. It’s an AI-powered co-pilot for QA engineers:</p><p>✅ <strong>Smart Automation Code Generation</strong></p><ul><li>Instantly generate new Playwright scripts by entering Jira test case IDs.</li><li>Auto-detect reusable XPaths &amp; methods, eliminating redundant code.</li><li>Seamlessly update existing scripts when page structures evolve.</li></ul><p>⚡ <strong>AI-Powered Refactoring</strong></p><ul><li>Fetch test steps from Jira and refactor code with AI precision.</li></ul><p>🔄 <strong>One-Click XPath Updation</strong></p><ul><li>Simply provide updated outerHTML, and the plugin fixes broken selectors in seconds.</li></ul><p>🔐 <strong>Secure &amp; Configurable</strong></p><ul><li>Easily bind to GenAI’s backend services and configure API keys, prompts, and model endpoints right within IntelliJ.</li></ul><p>🚀 <strong>Built for Speed</strong></p><ul><li>Saves hours of manual effort, enabling QA teams to focus on critical testing instead of boilerplate coding.</li></ul><p>🎯 <strong>Designed for QA Engineers</strong></p><ul><li>Context-aware suggestions, persistent session history, and seamless IntelliJ integration.</li></ul><h3>⚙️ How It’s Built</h3><p>We packed a lot under the hood to make the magic happen:</p><ul><li><strong>Modern Tech Stack</strong>: Built with <strong>Java 17</strong>, <strong>Javax Swing</strong>, <strong>Kotlin</strong>, and the <strong>IntelliJ Platform SDK</strong>, with Gradle powering builds and a custom Swing UI.</li><li><strong>API-Driven Backend</strong>: Connects securely to GenAI’s infrastructure using <strong>OkHttp</strong> for API calls and <strong>Jackson</strong> for JSON processing.</li><li><strong>AI Models</strong>: Uses <strong>gpt-4o-mini</strong> for XPath generation and <strong>O3-mini</strong> for automation flow orchestration.</li><li><strong>Program Structure Interface (PSI)</strong>: Enables deep access to project files and code structures for smarter code suggestions.</li><li><strong>Xray API Integration</strong>: Fetches test case descriptions and steps directly from Jira for accurate code generation.</li><li><strong>Enterprise-Grade Security</strong>: Includes session-based authentication, encrypted keys, and secure configuration storage.</li><li><strong>Deployment Ready</strong>: Signed builds distributed via internal marketplaces and CI/CD pipelines.</li></ul><h3>🏭 Under the Hood: How It Works</h3><p>Think of the plugin as a high-performance assembly line for test automation.<br> Here’s the flow:</p><ol><li>The plugin fetches test steps from Jira and analyzes existing project code via PSI.</li><li>You provide the outerHTML of relevant pages, and the AI gets to work.</li><li><strong>gpt-4o-mini</strong> crafts and updates XPaths with precision.</li><li><strong>O3-mini</strong> stitches together generic methods, page code, updated selectors, and test steps into clean Playwright scripts.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*4hNzt0wjEkW-n4SRjYodng.png" /></figure><p>The result?<br><strong>Production-ready automation scripts in minutes — not hours.</strong></p><h3>🧠 Final Thought</h3><p>This isn’t just a plugin.<br> It’s a step towards <strong>AI-assisted quality engineering</strong>.</p><p>So the next time someone asks,<br> <em>“Who wrote this test case so cleanly?”</em><br> You can smile and say,</p><blockquote>“Me… and my Automation Code Generator.”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f9e8d4da3eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/naukri-engineering/from-hours-to-minutes-how-we-used-genai-to-generate-new-and-modify-existing-automation-4f9e8d4da3eb">🤖 From Hours to Minutes: How We Used GenAI to generate new and modify existing automation…</a> was originally published in <a href="https://medium.com/naukri-engineering">Naukri Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turning Exploratory Testing into Actionable Test Cases — Seamlessly with GenAI!]]></title>
            <link>https://medium.com/naukri-engineering/turning-exploratory-testing-into-actionable-test-cases-seamlessly-with-genai-5dced4223ea2?source=rss-4b6253e8cd9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5dced4223ea2</guid>
            <dc:creator><![CDATA[Aditi Gupta]]></dc:creator>
            <pubDate>Tue, 08 Jul 2025 11:25:02 GMT</pubDate>
            <atom:updated>2025-07-09T06:46:01.165Z</atom:updated>
            <content:encoded><![CDATA[<h3>Turning Exploratory Testing into Actionable Test Cases — Seamlessly with GenAI!</h3><p>In the world of quality assurance, exploratory testing plays a critical role — uncovering real-world bugs, edge cases, and usability issues that scripted tests often miss. However, many of these valuable insights are lost — either forgotten or left undocumented due to time constraints. To bridge this gap, we built a solution that automatically captures user interactions, converts them into structured test cases, and sends them directly to the tester’s inbox — ensuring that no insight goes unnoticed.</p><p>That’s the challenge we set out to solve.</p><h3>🚀 The Spark Behind the Idea</h3><p>Writing manual test cases is often a time-consuming and overlooked task, especially after exploratory testing. While testers may uncover valuable edge cases during these sessions, the insights frequently remain undocumented — simply because there’s no time or it slips through the cracks. With multiple priorities competing for attention, it’s not uncommon for test cases to be forgotten or never logged into JIRA at all.</p><p>So, we asked: <em>What if we could capture browser interactions automatically, and use AI to transform them into meaningful, structured test cases — without the tester lifting a pen (or a keyboard)?</em></p><p>And that’s how our project — <strong>Chrome Extension for Capturing Manual Testcase </strong>— was born.</p><h3>🎯 Project Objective</h3><p>To reduce manual effort and eliminate loss of edge-case coverage by:</p><ul><li>Capturing meaningful browser interactions during exploratory testing</li><li>Generating intelligent manual test cases using GenAI</li><li>Applying de-duplication logic and sending unique ones over the email</li></ul><p>We aimed to bridge the gap between <strong>real-time testing insights</strong> and <strong>formal documentation</strong>, with a smart, AI-powered solution.</p><h3>🔧 How It Works</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fFSGmsm75zz9BhZFPoiZ2w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ImknzLhoebR5CkWT7sg66g.png" /></figure><p>Here’s the flow:</p><ol><li><strong>Start Recording</strong>: Tester initiates tracking in the browser.</li><li><strong>Action Capture</strong>: All JS events are logged silently.</li><li><strong>Prompting GenAI</strong>: Captured data is processed by GenAI 4-o mini.</li><li><strong>Test Case Generation</strong>: Structured test cases are created and stored in a central database.</li><li><strong>End-of-Day Deduplication</strong>: A smart logic engine filters out duplicates.</li><li><strong>Notification</strong>: Only <strong>unique test cases</strong> are emailed directly to the tester.</li></ol><p>📬 No more lost edge cases. No more missed documentation.</p><h3>🛠️ Tech Behind the Magic</h3><ul><li><strong>Frontend:</strong> JavaScript, HTML, CSS (for Chrome Extension UI)</li><li><strong>Backend:</strong> Java Spring Boot (for business logic and database integration)</li><li><strong>Database:</strong> MySQL</li><li><strong>AI/ML:</strong> GenAI (for intelligent mapping of actions to test steps)</li><li><strong>DeDuplication logic</strong>: Xray API, GenAI and java</li></ul><h4>Event Capture Mechanism</h4><p>The Chrome extension captures user actions (clicks, input changes, checkbox toggles, etc.) in real-time using addEventListener on DOM elements. Each interaction is converted into a structured event object.</p><h4>📋 Event Schema</h4><pre>const eventSchema = {<br>  id: &quot;string (optional)&quot;,            // Unique ID for event tracking<br>  eventType: &quot;string (e.g., click)&quot;,  // Type of user action<br>  url: &quot;string&quot;,                      // Page URL where the event occurred<br>  elementDetails: {<br>    placeholder: &quot;string&quot;,            // Input placeholder (if any)<br>    label: &quot;string&quot;,                  // Associated label for context<br>    classes: &quot;string&quot;,                // CSS classes for identification<br>    type: &quot;string&quot;,                   // Input type (text, checkbox, etc.)<br>    isSelected: &quot;boolean&quot;,           // For checkboxes/radios<br>    isDisabled: &quot;boolean&quot;,           // Element’s active/disabled status<br>    value: &quot;string&quot;,                  // Captured input or change<br>  }<br>};</pre><p>Each event is appended to an in-memory array until the user stops recording. Then, the captured events are passed into a prompt for AI to generate test cases.</p><h4>🧠 Prompt Construction &amp; AI Processing</h4><p>All captured events are passed to a base prompt which instructs the GenAI model to:</p><ul><li>Identify the flow</li><li>Group logically related steps</li><li>Extract meaningful assertions (error/success messages, final state)</li><li>Generate concise, Jira-compatible test case steps.</li></ul><h4>💾 Database Storage (pluginCases Table)</h4><p>Captured and generated data is saved in the pluginCases table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*fJNwu3lgVma2blW-QR013g.png" /></figure><h4>📧 Email Summary to QA</h4><p>The system automatically sends a summary email to the QA daily with:</p><ul><li>Total test cases captured that day</li><li>Non-duplicate test cases</li><li>A downloadable .xlsx file of all test cases (directly uploadable to Jira)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*Y7Ab9LJD1k0cyIPftTf1XQ.png" /></figure><h3>💡 Innovation Highlights</h3><ul><li>✅ Context-aware GenAI prompts for high-accuracy test step mapping</li><li>✅ Intelligent duplication detection</li><li>✅ Start/Stop recording for focused capture</li><li>✅ Editable test cases with human-in-the-loop validation</li><li>✅ Notification on Email</li></ul><h3>✨ Final Word</h3><p>This isn’t just about saving time — it’s about preserving valuable insights.<br> With our Chrome extension, every critical test scenario — no matter how fleeting — is captured, structured, and delivered to the tester.</p><p><strong>Exploratory testing just got smarter.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5dced4223ea2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/naukri-engineering/turning-exploratory-testing-into-actionable-test-cases-seamlessly-with-genai-5dced4223ea2">Turning Exploratory Testing into Actionable Test Cases — Seamlessly with GenAI!</a> was originally published in <a href="https://medium.com/naukri-engineering">Naukri Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test Automation… Play it right with “PLAYWRIGHT.”]]></title>
            <link>https://medium.com/naukri-engineering/test-automation-play-it-right-with-playwright-2cdcd79d5618?source=rss-4b6253e8cd9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cdcd79d5618</guid>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[playwrights]]></category>
            <category><![CDATA[quality-assurance-testing]]></category>
            <dc:creator><![CDATA[Aditi Gupta]]></dc:creator>
            <pubDate>Wed, 22 Mar 2023 07:17:54 GMT</pubDate>
            <atom:updated>2023-03-22T07:24:01.518Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUB33ySeQpmy8Qc8_Y3Rpg.png" /><figcaption><a href="https://www.bing.com/images/blob?bcid=RP6B3S7KWmAFqxcxoNWLuD9SqbotqVTdP-Y">https://www.bing.com/images/blob?bcid=RP6B3S7KWmAFqxcxoNWLuD9SqbotqVTdP-Y</a></figcaption></figure><p><em>‘Slow and steady wins the race’?? Well not always…</em></p><p>Yes, you read it right! Naukri testing team did a detailed analysis of multiple testing automation tools and based on our initial findings Playwright seems to be a right candidate for further detailed POC.</p><p>We had been leveraging the benefits of Selenium since long, but we could not ignore the two major problems…</p><p>Well, S<strong>lowness</strong> and <strong>flakiness</strong> they are!</p><p>These have led to additional maintenance efforts OfCourse!</p><p>We were looking for something which could solve both of these problems and as we mentioned based on our initial findings, we decided to move ahead with Playwright for detailed POC.</p><p>This end-to-end browser automation tool is an open-source automation tool that is managed by Microsoft that provides support for all modern rendering engines like chromium, Web Kit, and Firefox. Apart from this, there are several other reasons that led us to this decision of choosing Playwright for our final POC.</p><p>In this blog, we will talk about the tools with which we compared Playwright and some futuristic features which might help you also in deciding on a new test automation tool for your application.</p><ol><li><strong>Browser Support:</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*6iljsqRlwB3B5xI3nZfyYA.png" /></figure><p><strong>2. Testing Framework Support:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*dBGHD2cFrB6Vd2q8cTMbtw.png" /></figure><p><strong>3. Language Support:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*1tkpUQsSIt9QOnQ3VB_c0w.png" /></figure><p><strong>4. Cross Platform Support:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*JSkcFy8BJiFc5x1Og5S9vw.png" /></figure><p><strong>5. Multiple Windows/Tab Support:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*jc7pssu7Z2QNsvc9bHvQ7g.png" /></figure><p><strong>6. Parallel Execution Support:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*n255mwarZ6xBk9Wsyndrhg.png" /></figure><p><strong>8. Continuous Integration:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*O0R7RWnOTGA7_89jMFdAOg.png" /></figure><h3>Prominent Features of Playwright:</h3><h3><strong>Speed:</strong></h3><p>As per our initial POC where we did comparison of same testcases written using selenium and playwright we found that the latter is around 4 times faster than the former. This was one of the much-needed features and Playwright outshone Selenium in this space. Below screenshot explains the same where same set of testcases were written and executed using both selenium webdriver and playwright.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IKoeH1T8b9tVSOsSt5kdKQ.png" /></figure><p>As you can see Playwright is much faster than Selenium.</p><h3>Enhanced Locators:</h3><p>Locators are the central piece of Playwright’s <strong>auto-waiting and retry-ability.</strong> These locators are far more stable and accurate as compared to those offered in selenium as per our analysis. Recommended built-in locators are:</p><p><strong>Page.getByRole()</strong> to locate by explicit and implicit accessibility attributes.<br><strong>Page.getByText()</strong> to locate by text content.<br><strong>Page.getByLabel()</strong> to locate a form control by the associated label’s text.<br><strong>Page.getByPlaceholder()</strong> to locate an input by a placeholder.<br><strong>Page.getByAltText()</strong> to locate an element, usually an image, by its text alternative.<br><strong>Page.getByTitle()</strong> to locate an element by its title attribute.<br><strong>Page.getByTestId()</strong> to locate an element based on its data-testid attribute (other attributes can be configured).</p><p><strong>Locate by CSS or XPATH:</strong></p><p>you can use Page.locator() to create a locator that takes a selector describing how to find an element in the page. Playwright supports CSS and XPath selectors, and auto-detects them if you omit css= or xpath= prefix.</p><pre>page.locator(&quot;css=button&quot;).click();<br>page.locator(&quot;xpath=//button&quot;).click();</pre><pre>page.locator(&quot;button&quot;).click();<br>page.locator(&quot;//button&quot;).click();</pre><h3><strong>Playwright Test Generator — Codegen :</strong></h3><p>Playwright comes with Codegen where you can generate test. Run codegen and perform actions in the browser. It will generate the code for the user interactions and will attempt to generate resilient text-based selectors.</p><p><strong><em>mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args=”codegen </em></strong><a href="https://www.naukri.com/"><strong><em>https://www.naukri.com</em></strong></a><strong><em>&quot;</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvpg5wGrU1H4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dvpg5wGrU1H4&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/54eb237c338bf9496544add1c5b41638/href">https://medium.com/media/54eb237c338bf9496544add1c5b41638/href</a></iframe><h3><strong>Playwright Inspector:</strong></h3><p>Playwright Inspector is a GUI tool that helps in debugging Playwright scripts. It helps in script troubleshooting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YF2auPTTjXEvWzbnmJcTtA.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fb5JIQIPMjSE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Db5JIQIPMjSE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fb5JIQIPMjSE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d3bcc64c3e19ed2c88b1fd90893ddba4/href">https://medium.com/media/d3bcc64c3e19ed2c88b1fd90893ddba4/href</a></iframe><h3><strong>Auto-wait:</strong></h3><p>Playwright performs a range of actionability checks on the elements before making actions to ensure these actions behave as expected. It auto-waits for all the relevant checks to pass and only then performs the requested action. If the required checks do not pass within the given timeout, action fails with the TimeoutError.</p><p>Here is the complete list of actionability checks performed for each action:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7mX1n9MOnCd71YqMTLeEZg.png" /></figure><h3>Trace<strong> Viewer:</strong></h3><p>Playwright Trace Viewer is a GUI tool that helps you explore recorded Playwright traces after the script has run. You can open traces locally or in your browser on <a href="https://trace.playwright.dev/">trace.playwright.dev</a>.</p><h4>Viewing the trace<a href="https://playwright.dev/java/docs/trace-viewer#viewing-the-trace">​</a></h4><p>You can open the saved trace using Playwright CLI or in your browser on <a href="https://trace.playwright.dev/">trace.playwright.dev</a>.</p><pre>mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args=&quot;show-trace trace.zip&quot;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0pCTWW5GWzo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0pCTWW5GWzo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0pCTWW5GWzo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4483482ac2bd3d6e1ea2a3143cc53b58/href">https://medium.com/media/4483482ac2bd3d6e1ea2a3143cc53b58/href</a></iframe><h3><strong>Log in once:</strong></h3><p>This feature helps to save the authentication state of the context and reuse it in all the tests. This bypasses repetitive log-in operations in each test, yet delivers full isolation of independent tests. This eliminates the need to login in every context and speeds up test execution.</p><p>You can implement through the following tasks:</p><ol><li>Automate logging in</li><li>Reuse signed in the state: Web apps use cookie-based or token-based authentication, where the authenticated state is stored as <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies">cookies</a> or in <a href="https://developer.mozilla.org/en-US/docs/Web/API/Storage">local storage</a>. Playwright provides <a href="https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state">browserContext.storageState([options])</a> method that can be used to retrieve storage state from authenticated contexts and then create new contexts with the pre-populated state.</li></ol><p>Cookies and local storage states can be used across different browsers. They depend on your application’s authentication model: some apps might require both cookies and local storage.</p><p>The following code snippet retrieves the state from an authenticated context and creates a new context with that state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*xkJLfAdCwN_VKjtWCf_m9w.png" /></figure><p>3. Session Storage: Session storage is used for storing information associated with the logged-in state. It is specific to a particular domain and is not persisted across page loads. We can use below code to save/load the same:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*0Np27KDXS1rtye6YGGrK2g.png" /></figure><p><strong>Conclusion:</strong></p><p>Just as you saw, there are many pros and cons followed by features and limitations associated with Playwright. And as per our initial analysis, we found Playwright stable and fast which makes it a powerful tool.</p><p>Since we are still exploring this tool, we would recommend you to try it yourself and explore the best of it for your application!</p><p>Hope the information provided in this blog would help you find a suitable test automation tool for your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cdcd79d5618" width="1" height="1" alt=""><hr><p><a href="https://medium.com/naukri-engineering/test-automation-play-it-right-with-playwright-2cdcd79d5618">Test Automation… Play it right with “PLAYWRIGHT.”</a> was originally published in <a href="https://medium.com/naukri-engineering">Naukri Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>