<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zain Ul Rehman</title>
    <description>The latest articles on DEV Community by Zain Ul Rehman (@zain-qa).</description>
    <link>https://dev.to/zain-qa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3883246%2F53635bf8-bb6d-44aa-b8ee-ecff4cbb3249.jpg</url>
      <title>DEV Community: Zain Ul Rehman</title>
      <link>https://dev.to/zain-qa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zain-qa"/>
    <language>en</language>
    <item>
      <title>17 SDET Interview Questions That Will Actually Be Asked in 2026</title>
      <dc:creator>Zain Ul Rehman</dc:creator>
      <pubDate>Thu, 23 Apr 2026 20:25:34 +0000</pubDate>
      <link>https://dev.to/zain-qa/17-sdet-interview-questions-that-will-actually-be-asked-in-2026-2f6c</link>
      <guid>https://dev.to/zain-qa/17-sdet-interview-questions-that-will-actually-be-asked-in-2026-2f6c</guid>
      <description>&lt;h2&gt;
  
  
  How most SDET interviews are structured
&lt;/h2&gt;

&lt;p&gt;Understanding the structure helps you prepare the right material for the right stage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 1 — Recruiter screening (15–30 min)&lt;/strong&gt;&lt;br&gt;
Your background, experience, and basic technical awareness. No coding here. Just be clear and confident about your stack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 2 — Technical phone screen (45–60 min)&lt;/strong&gt;&lt;br&gt;
Automation concepts and basic coding questions. This is where most candidates get screened out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 3 — Technical interview (60–90 min)&lt;/strong&gt;&lt;br&gt;
Live coding, framework design questions, system design for testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 4 — Behavioural / final round&lt;/strong&gt;&lt;br&gt;
Team fit, communication, how you handle conflict with developers.&lt;/p&gt;
&lt;h2&gt;
  
  
  The questions — with real answers
&lt;/h2&gt;
&lt;h2&gt;
  
  
  Q1: What programming language do you use for test automation and why?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What interviewers want&lt;/strong&gt;: A clear, justified choice — not "it depends."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strong answer:&lt;/strong&gt; I primarily use Python because of its readable syntax, strong ecosystem (pytest, requests, selenium), and growing demand in AI and automation roles. I have also worked with Java in enterprise environments where TestNG and Maven are the standard stack. The language matters less than framework design — I can adapt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q2: Explain the Page Object Model. Why is it important?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What interviewers want:&lt;/strong&gt; A practical explanation, not a textbook definition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strong answer:&lt;/strong&gt; POM separates page interactions from test logic. Each page in your application gets its own class that contains the locators and actions for that page. Tests import these classes and call methods rather than directly touching the browser.&lt;/p&gt;

&lt;p&gt;When the UI changes, you update one page class — not every test that touches that page. That is the real value. Modern AI tools like Mabl are trying to eliminate this maintenance work with self-healing locators, but POM remains the industry standard for code-based frameworks.&lt;/p&gt;
&lt;h2&gt;
  
  
  Q3: What is the testing pyramid and how does it apply to your work?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Strong answer&lt;/strong&gt;: The pyramid recommends many unit tests, fewer integration tests, and even fewer end-to-end tests. E2E tests are slower, more brittle, and more expensive to maintain.&lt;br&gt;
As an SDET, I focus on integration and E2E automation while supporting developers in writing unit tests. I push back when teams want to over-invest in E2E coverage — flaky E2E tests erode trust in the entire test suite.&lt;/p&gt;
&lt;h2&gt;
  
  
  Q4: How do you handle file uploads in Selenium?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Strong answer:&lt;/strong&gt; For standard HTML file input elements, Selenium handles uploads by sending the file path directly to the input element using send_keys. For custom components using JavaScript or third-party libraries, you may need to use execute_script to make the input visible before interacting with it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;file_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find_element&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;By&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;file-upload&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;file_input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send_keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/absolute/path/to/file.pdf&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Q5: Tell me about a time your automated test caught a bug before production.
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What interviewers want:&lt;/strong&gt; A specific real example using the STAR format.&lt;br&gt;
Structure to use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Situation: What were you testing and what was the context?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Task: What was your automation covering?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Action: What did the test flag specifically?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Result: What was the impact — how serious was the bug, what would have happened if it reached users?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if the bug was not catastrophic, emphasize that automation caught it faster than manual testing would have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Q6: How do you decide what to automate and what not to automate?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Strong answer:&lt;/strong&gt; I automate tests that are: run frequently (regression), stable in their requirements, time-consuming to run manually, and where human error is a real risk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I do not automate:&lt;/strong&gt; one-time tests, exploratory testing, tests requiring human judgement about subjective quality, and tests that change so frequently that maintenance cost exceeds the benefit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rule:&lt;/strong&gt; if a test will be run more than 10 times and takes more than 5 minutes manually — automate it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q7: What is flaky test and how do you fix it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strong answer:&lt;/strong&gt; A flaky test is one that passes sometimes and fails sometimes without any code change. The most common causes are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Timing issues — element not ready when test tries to interact&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test data dependency — tests sharing state and polluting each other&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Environment inconsistency — differences between local and CI&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dynamic content — IDs or classes that change on each page load&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fix approach: Add explicit waits (not sleep), isolate test data per test, investigate the failure pattern (does it always fail on CI? on certain browsers?), and add retry logic as a last resort — not a first resort.&lt;/p&gt;

&lt;h2&gt;
  
  
  What separates a good SDET interview answer from a great one
&lt;/h2&gt;

&lt;p&gt;Good answers explain what. Great answers explain why and connect to impact.&lt;br&gt;
"I use POM" is good.&lt;br&gt;
"I use POM because it reduces maintenance cost when the UI changes, which I have seen save our team 2–3 hours per sprint cycle" is great.&lt;br&gt;
Always connect your technical answers to a business outcome. That is what senior interviewers are evaluating.&lt;/p&gt;

&lt;p&gt;Originally published with 10 more questions and detailed answers at &lt;a href="https://dev.tourl"&gt;aitestingguide.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>career</category>
      <category>testing</category>
      <category>interview</category>
    </item>
    <item>
      <title>12 ChatGPT Prompts for Selenium Tests That Actually Work (2026)</title>
      <dc:creator>Zain Ul Rehman</dc:creator>
      <pubDate>Thu, 16 Apr 2026 22:35:33 +0000</pubDate>
      <link>https://dev.to/zain-qa/12-chatgpt-prompts-for-selenium-tests-that-actually-work-2026-7ec</link>
      <guid>https://dev.to/zain-qa/12-chatgpt-prompts-for-selenium-tests-that-actually-work-2026-7ec</guid>
      <description>&lt;p&gt;If you have ever stared at a blank test file not knowing where to start, ChatGPT prompts for Selenium tests can change your workflow completely.&lt;/p&gt;

&lt;p&gt;In 2026, the best SDETs are not writing every line of automation code from scratch. They are using AI to accelerate test creation while applying their expertise to review and improve the output.&lt;/p&gt;

&lt;p&gt;I have been doing this in my own SDET workflow for months. Here are the exact prompts I use — and the four rules that make them actually work.&lt;/p&gt;




&lt;h2&gt;
  
  
  4 rules before you start prompting
&lt;/h2&gt;

&lt;p&gt;Before sharing the prompts, these four rules dramatically improve the quality of output:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Always specify your stack.&lt;/strong&gt;&lt;br&gt;
Mention Python or Java, Selenium 4, Pytest or TestNG, and any patterns like Page Object Model. Vague prompts produce generic code that needs heavy editing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Give context about your application.&lt;/strong&gt;&lt;br&gt;
Tell ChatGPT what the page does, what elements are involved, what the expected behavior is. The more context, the more accurate the output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Ask for one thing at a time.&lt;/strong&gt;&lt;br&gt;
Do not ask ChatGPT to write an entire framework in one prompt. Break it down — one page class, one test file, one utility function at a time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Always review and test the output.&lt;/strong&gt;&lt;br&gt;
Never paste ChatGPT code directly into production without running it and understanding every line. This is non-negotiable.&lt;/p&gt;


&lt;h2&gt;
  
  
  The prompts
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Prompt 1 — Browser setup and configuration
&lt;/h3&gt;

&lt;p&gt;Use this when starting a new project and you need the initial browser configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Write&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="n"&gt;Selenium&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt; &lt;span class="n"&gt;setup&lt;/span&gt; &lt;span class="n"&gt;using&lt;/span&gt; &lt;span class="n"&gt;pytest&lt;/span&gt; &lt;span class="n"&gt;fixtures&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Chrome&lt;/span&gt; &lt;span class="n"&gt;WebDriver&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;ChromeDriverManager&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headless&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="n"&gt;option&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;implicit&lt;/span&gt; &lt;span class="n"&gt;wait&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;teardown&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;closes&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt; &lt;span class="n"&gt;after&lt;/span&gt;
&lt;span class="n"&gt;each&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="n"&gt;Use&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;pytest&lt;/span&gt; &lt;span class="n"&gt;conftest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What you get:&lt;/strong&gt; A production-ready conftest.py with driver initialization and teardown. No more copy-pasting setup boilerplate across every new project.&lt;/p&gt;




&lt;h3&gt;
  
  
  Prompt 2 — Page Object Model class
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Write&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="n"&gt;Selenium&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="n"&gt;Page&lt;/span&gt; &lt;span class="n"&gt;Object&lt;/span&gt; &lt;span class="n"&gt;Model&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="n"&gt;has&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="nf"&gt;field &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;username&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="nf"&gt;field &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;password&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="n"&gt;submit&lt;/span&gt; &lt;span class="nf"&gt;button &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;login-btn&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt; &lt;span class="nf"&gt;message &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;error-msg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;
&lt;span class="n"&gt;Include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;explicit&lt;/span&gt; &lt;span class="n"&gt;waits&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;each&lt;/span&gt; &lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="nf"&gt;login&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;takes&lt;/span&gt;
&lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="nf"&gt;get_error_message&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Use&lt;/span&gt; &lt;span class="n"&gt;pytest&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;inherit&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;BasePage&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What you get:&lt;/strong&gt; A complete, clean POM class. Replace the locators with your actual application's element IDs and it works immediately.&lt;/p&gt;




&lt;h3&gt;
  
  
  Prompt 3 — Generating test cases from a POM class
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;have&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;LoginPage&lt;/span&gt; &lt;span class="n"&gt;POM&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;with&lt;/span&gt; &lt;span class="n"&gt;these&lt;/span&gt; &lt;span class="n"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;login&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;—&lt;/span&gt; &lt;span class="n"&gt;fills&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;submits&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;get_error_message&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="err"&gt;—&lt;/span&gt; &lt;span class="n"&gt;returns&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt; &lt;span class="n"&gt;fails&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;is_dashboard_visible&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="err"&gt;—&lt;/span&gt; &lt;span class="n"&gt;returns&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt; &lt;span class="n"&gt;succeeded&lt;/span&gt;

&lt;span class="n"&gt;Write&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;pytest&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;these&lt;/span&gt; &lt;span class="n"&gt;scenarios&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="mf"&gt;1.&lt;/span&gt; &lt;span class="n"&gt;Valid&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt; &lt;span class="n"&gt;redirects&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;dashboard&lt;/span&gt;
&lt;span class="mf"&gt;2.&lt;/span&gt; &lt;span class="n"&gt;Invalid&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="n"&gt;shows&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;
&lt;span class="mf"&gt;3.&lt;/span&gt; &lt;span class="n"&gt;Empty&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="n"&gt;shows&lt;/span&gt; &lt;span class="n"&gt;validation&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;
&lt;span class="mf"&gt;4.&lt;/span&gt; &lt;span class="n"&gt;SQL&lt;/span&gt; &lt;span class="n"&gt;injection&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;handled&lt;/span&gt; &lt;span class="n"&gt;safely&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What you get:&lt;/strong&gt; Four complete test cases with assertions, ready to run. You gave it the context — it writes the scenarios.&lt;/p&gt;




&lt;h3&gt;
  
  
  Prompt 4 — Locator strategy suggestions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;am&lt;/span&gt; &lt;span class="n"&gt;testing&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;search&lt;/span&gt; &lt;span class="n"&gt;feature&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="n"&gt;search&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt; &lt;span class="n"&gt;has&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="n"&gt;ID&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="n"&gt;attribute&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Available&lt;/span&gt; &lt;span class="n"&gt;attributes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Search products...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;testid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;search-input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;search-field active&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Which&lt;/span&gt; &lt;span class="n"&gt;Selenium&lt;/span&gt; &lt;span class="n"&gt;locator&lt;/span&gt; &lt;span class="n"&gt;strategy&lt;/span&gt; &lt;span class="n"&gt;should&lt;/span&gt; &lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;why&lt;/span&gt;&lt;span class="err"&gt;?&lt;/span&gt;
&lt;span class="n"&gt;Write&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;locator&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="n"&gt;Selenium&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="n"&gt;syntax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What you get:&lt;/strong&gt; A reasoned explanation of locator priority (data-testid is most stable) plus the exact Python syntax. Useful when you are dealing with poorly structured HTML.&lt;/p&gt;




&lt;h3&gt;
  
  
  Prompt 5 — CI/CD pipeline for test automation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;Write a GitHub Actions workflow file that runs a Python Selenium test suite&lt;/span&gt;
&lt;span class="na"&gt;on every push to the main branch. The workflow should&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Use Ubuntu latest&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Install Python &lt;/span&gt;&lt;span class="m"&gt;3.11&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Install dependencies from requirements.txt&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Install Chrome browser&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Run pytest with HTML report generation&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Upload the HTML report as a workflow artifact&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What you get:&lt;/strong&gt; A complete, working GitHub Actions YAML file. Drop it into your .github/workflows/ folder and your tests run automatically on every push.&lt;/p&gt;




&lt;h3&gt;
  
  
  Prompt 6 — Converting manual test cases to automation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;have&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;manual&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="n"&gt;case&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="n"&gt;Test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Verify&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="nb"&gt;filter&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;
&lt;span class="n"&gt;Steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="mf"&gt;1.&lt;/span&gt; &lt;span class="n"&gt;Navigate&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt;
&lt;span class="mf"&gt;2.&lt;/span&gt; &lt;span class="n"&gt;Set&lt;/span&gt; &lt;span class="n"&gt;minimum&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;
&lt;span class="mf"&gt;3.&lt;/span&gt; &lt;span class="n"&gt;Set&lt;/span&gt; &lt;span class="n"&gt;maximum&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;
&lt;span class="mf"&gt;4.&lt;/span&gt; &lt;span class="n"&gt;Click&lt;/span&gt; &lt;span class="n"&gt;Apply&lt;/span&gt; &lt;span class="nb"&gt;filter&lt;/span&gt;
&lt;span class="mf"&gt;5.&lt;/span&gt; &lt;span class="n"&gt;Verify&lt;/span&gt; &lt;span class="nb"&gt;all&lt;/span&gt; &lt;span class="n"&gt;displayed&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="n"&gt;show&lt;/span&gt; &lt;span class="n"&gt;prices&lt;/span&gt; &lt;span class="n"&gt;between&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;

&lt;span class="n"&gt;Convert&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="n"&gt;Selenium&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="n"&gt;using&lt;/span&gt; &lt;span class="n"&gt;pytest&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;POM&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Assume&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;ProductPage&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;with&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="nf"&gt;set_price_filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="n"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What you get:&lt;/strong&gt; A direct translation from manual to automated — extremely useful when you have a large manual test suite to migrate.&lt;/p&gt;




&lt;h2&gt;
  
  
  The 3 mistakes that kill your results
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Not providing locator information.&lt;/strong&gt;&lt;br&gt;
Generic prompts produce locators like &lt;code&gt;By.ID("submit")&lt;/code&gt; that will not work in your application. Always provide real element attributes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accepting the first output without refinement.&lt;/strong&gt;&lt;br&gt;
ChatGPT's first response is a starting point. The best results come from two or three rounds of refinement. Say "this is good but make the waits explicit and add a try/except for StaleElementException."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Asking for too much at once.&lt;/strong&gt;&lt;br&gt;
Prompts that ask for an entire framework produce messy, inconsistent code. Small focused prompts produce clean, maintainable output.&lt;/p&gt;




&lt;h2&gt;
  
  
  The mindset shift
&lt;/h2&gt;

&lt;p&gt;The most effective way to use ChatGPT in a professional SDET workflow is not to replace your coding — it is to eliminate the parts that are repetitive and time-consuming so you can focus on the parts that require real expertise.&lt;/p&gt;

&lt;p&gt;Framework design, test strategy, coverage decisions — those still need a human. Boilerplate, repetitive test variations, CI/CD scaffolding — that is where ChatGPT saves you hours every week.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published with more prompts and examples at &lt;a href="https://aitestingguide.com/chatgpt-prompts-for-selenium-tests/" rel="noopener noreferrer"&gt;aitestingguide.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>selenium</category>
      <category>ai</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
