# Qgen – AI-Powered Test Case Generation

Last updated on : 05 May 2025

## Overview
Qgen is an AI‑powered test case generation feature that helps QA teams and developers quickly create comprehensive test cases from different types of inputs. Instead of manually writing test cases, users can provide functional information in multiple formats, and Qgen automatically analyzes it to generate structured, high‑quality test cases.
Qgen supports test case generation using the following input sources:
- Feature or user story descriptions (text)
- Uploaded images (screenshots, UI mockups, flows)
- SRS or API documents (JSON)
- Website URLs
This feature is designed to improve test coverage, reduce manual effort, and accelerate the testing lifecycle.

## Accessing Qgen
1. Log in to the Pcloudy platform.
2. From the left navigation panel, navigate to Qpilot and click on start agent  present on Qgen card
3. The Test Case Generator screen opens, where you can create and manage test generation projects.
4. Create Scenario-> Create folder-> (Click the Add Test Case option to open the test case generation flow.)

## Creating a New Test Generation Project

[Video: Qgen – AI-Powered Test Case Generation](https://www.youtube.com/watch?v=cgTZ5zC7soE)

### Step 1: Select Platform
Under Enter Test Gen Details, choose the platform for which you want to generate test cases:
- Web
- Android
- iOS
You can enable one or more platforms based on your testing scope.

### Step 2: Enter Scenario Set Details
- Scenario Set Name (mandatory): Provide a meaningful name for your test scenario set (for example, Login Functionality).
- Scenario Set Description (optional): Add a short description to explain the scope or purpose of the scenario set.

### Step 3: Create Test Gen
- Click Create Test Gen to create the scenario set. Once created, it appears in the left panel under the selected scenario hierarchy.

## Generating Test Cases
After creating a scenario set, you can start generating test cases.

## Providing Input to Qgen
Qgen allows multiple input types. Select the appropriate input option based on the information you have.

### 1. Description (Text Input)
Use this option to manually describe the feature, user story, or functionality.

## Best practices for descriptions:
- Clearly define user roles (for example, registered user, admin).
- Describe main flows and alternate flows.
- Mention validations, error messages, and edge cases.
- Include expected outcomes.

## Example:
“As a registered user, I should be able to log in using a valid email and password. The system should validate email format, show inline error messages for invalid inputs, lock the account after five failed attempts, and support session timeout.”

### 2. Upload Image
Use this option to upload:
- UI screenshots
- Wireframes or mockups
- Flow diagrams
Qgen analyzes visual elements such as fields, buttons, labels, and flows to generate relevant test scenarios

### 3. API Document (JSON)
Upload an API document in JSON format to generate API test cases.
Qgen can derive test cases for:
- Request and response validation
- Mandatory and optional fields
- Positive and negative scenarios
- Error handling and status codes

### 4. Website URL
Provide a live website URL for analysis.
Qgen crawls the page structure and UI elements to generate test cases covering:
- Page loads and navigation
- UI validations
- Functional flows
- Error and boundary scenarios

### Step 5 – Analyze Input

Click Analyze after entering the input. Qgen analyzes the input and generates the test scenarios.

### Step 6 – Generation of Test Scenarios

Selecting / deselecting the generated test scenarios. Once scenarios are generated, the user can select all or a few scenarios as per requirement to generate the test cases.

## Reviewing and Managing Test scenarios
- Generated test cases are listed under the selected scenario in the left panel.
- You can review, edit, or refine test cases as needed.

Refine with AI –User can add any feedback,if he feels if anything is missing  using this option.
Scenario will get updated

### Step 7 – Generation of Test Cases

Click Analyze to generate the test cases. Test cases will be generated based on the selected scenarios.

### Step 8 – Exporting the Test Cases

Click the export option to download the generated test cases.

## Benefits of Using Qgen
- Reduces manual test case authoring effort
- Improves test coverage and consistency
- Supports multiple input formats
- Accelerates test design for web, mobile, and API testing

## Summary
Qgen simplifies and accelerates test case creation by leveraging AI to transform functional inputs—text, images, documents, APIs, or URLs—into structured, reusable test cases. It enables teams to focus more on testing quality and less on manual documentation.
