Topview Logo
  • Create viral videos with
    GPT-4o + Ads library
    Use GPT-4o to edit video empowered by Youtube & Tiktok & Facebook ads library. Turns your links or media assets into viral videos in one click.
    Try it free
    gpt video

    4 ways you can use AI for Software Testing (QA)

    blog thumbnail

    Introduction

    Hey everyone, and welcome to a new article on ID Vlog. This is either my second or third piece published in English, so please bear with me. Today, I'd like to show you how you can use Chat GPT AI, regardless of the version, to help your QA career flourish or improve. There are several simple ways Chat GPT can enhance your career and work as a software tester. Follow along as I walk you through various examples.

    1. Creating Test Cases

    The first thing I'd like to show you is how Chat GPT can help create test cases. Let's start with a simple prompt for generating a list of happy flow test cases for a search functionality in a clothing e-commerce website:

    Prompt:

    Create a list of happy flow test cases for a search functionality in a clothing e-commerce website.
    

    Example Output:

    • Basic search: Validate the steps and expected results for a basic search query.
    • Search with filters: Ensure the search can filter results accurately.
    • Sorting search results: Check the sorting feature works as expected.
    • Search clear button: Verify that the clear button resets the search.
    • Search result pagination: Test the pagination for search results.

    These are solid starting points to structure your test planning, especially if you're short on ideas.

    2. Writing Automated Tests

    Chat GPT can also write automated tests. Let’s look at a prompt for writing an automated test in Cypress.js for a search bar:

    Prompt:

    Write an automated test in cypress.js that tests a search bar.
    

    Example Output:

    describe('Search Functionality', () => (
      beforeEach(() => {
        cy.visit('your-website-url');
      ));
    
      it('should display search results for a valid query', () => (
        cy.get('your-search-input-selector').type('laptop');
        cy.get('your-search-button-selector').click();
        cy.get('your-results-div-selector').should('contain', 'laptop');
      ));
    
      it('should show an error message for an empty search', () => (
        cy.get('your-search-button-selector').click();
        cy.get('your-error-message-selector').should('be.visible');
      ));
    });
    

    Simply copy this template and update it with specific selectors and queries related to your project. It's much faster than writing everything from scratch.

    3. Checking UI Accessibility

    Next, let’s test UI accessibility, specifically color contrast, to ensure compliance with web accessibility guidelines (e.g., WebAIM).

    Prompt:

    Is the contrast good as per WebAIM guidelines between two hex colors, #ff0000 and #ff9900?
    

    Example Output:

    The contrast ratio should be 4.5:1 for normal text and 3:1 for large text. For these colors, the contrast is not sufficient, indicating a potential accessibility issue. You can raise a bug in your tracking system to address this.

    4. Generating Security Testing Ideas

    Finally, Chat GPT can be a valuable assistant in security testing.

    Prompt:

    Give me some security testing ideas for a search functionality.
    

    Example Output:

    • SQL Injection Testing
    • XSS (Cross-Site Scripting) Testing
    • CSRF (Cross-Site Request Forgery) Testing
    • Session Hijacking
    • Input Validation

    Expanded Example for SQL Injection:

    Prompt:

    How can I test SQL Injection?
    

    Example Output:

    • Identify input points.
    • Test with valid inputs initially.
    • Use special characters like commas, quotes, and semicolons to identify vulnerabilities.
    • Execute basic payloads like 1' OR '1'='1.

    List of SQL Injection Payloads Prompt:

    Please give me a list of SQL injection payloads that I can use to test my website.
    

    Example Payloads:

    • 1' OR '1'='1
    • '; DROP TABLE users; --
    • ' OR 1=1; --

    These payloads can be pasted into input fields like login, search, or contact forms to test for vulnerabilities.

    Keywords

    • Chat GPT
    • QA Career
    • Software Testing
    • Creating Test Cases
    • Automated Tests
    • Cypress.js
    • UI Accessibility
    • Security Testing
    • SQL Injection

    FAQ

    What is Chat GPT and how can it assist in QA?

    Chat GPT is an AI language model that can assist QA professionals by generating test cases, writing automated test scripts, checking UI accessibility, and suggesting security testing ideas.

    Can Chat GPT create automated tests?

    Yes, by providing specific prompts, Chat GPT can generate automated test scripts for frameworks like Cypress.js.

    How does Chat GPT help with UI accessibility?

    Chat GPT can check color contrast ratios based on web accessibility guidelines to ensure that your application is usable by people with different vision impairments.

    What types of security tests can Chat GPT suggest?

    Chat GPT can suggest various security tests, including SQL injection, XSS, CSRF, and input validation testing.

    How reliable are the test cases generated by Chat GPT?

    The generated test cases are good starting points, but it's essential to review and tailor them to fit the specific needs and architecture of your application.

    Feel free to adapt these examples to suit your particular testing environment. If you'd like more content like this, leave a comment or like the post. Thanks for reading!

    One more thing

    In addition to the incredible tools mentioned above, for those looking to elevate their video creation process even further, Topview.ai stands out as a revolutionary online AI video editor.

    TopView.ai provides two powerful tools to help you make ads video in one click.

    Materials to Video: you can upload your raw footage or pictures, TopView.ai will edit video based on media you uploaded for you.

    Link to Video: you can paste an E-Commerce product link, TopView.ai will generate a video for you.

    You may also like