A System and Method for Generating Test Scripts for an Application Under Test

IN605938BActive Publication Date: 2026-10-14ALGOSHACK TECHNOLOGIES PVT LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
IN202641039520
Authority / Receiving Office
IN · IN
Patent Type
Patents
Current Assignee / Owner
Filing Date
2026-03-30
Publication Date
2026-10-14
Estimated Expiration
2046-03-30

AI Technical Summary

Technical Problem

Traditional test automation systems require continuous availability of the Application Under Test (AUT) for script generation, produce inaccurate mappings, and demand significant technical expertise, leading to fragile scripts and poor traceability between natural language inputs and executable code.

Method used

A persistent offline UI model integrated with a Large Language Model (LLM) that grounds natural language inputs to actual UI elements, generating Behavior-Driven Development (BDD) scenarios in Gherkin format, allowing decoupled editing and collaborative validation before transforming into executable scripts.

Benefits of technology

Reduces maintenance overhead and simplifies test automation by ensuring accurate, decoupled script generation, achieving ≥70% reduction in AUT dependency, ≥90% reduction in ambiguous steps, and ≥60% reduction in manual locator effort, with ≥100% traceability from defect description to executable script.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The subject matter discloses a method 300 and a system 100 for generating test scripts 118 for an Application Under Test, AUT. A metadata extracting module 102 extracts UI metadata from the AUT. An offline model storage module 104 constructs a persistent offline UI model editable independently of the AUT. An Input Processing Module 108 receives test intent inputs in natural language. An LLM module 110 ground references the test intent inputs to actual UI elements in the offline model. A Scenario Generation Module 112 Generates BDD scenarios in Gherkin format. A review Module 114 presents the generated BDD scenarios to users for validation. The Script Transformation Module 116 Transforms the scenarios into executable test scripts 118 in automation frameworks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field

[0001] The subject matter relates to software testing automation, and moreparticularly to methods and systems for generating Behavior-Driven Development(BDD) scenarios and executable test scripts by using a persistent offlinerepresentation of an Application Under Test (AUT) and Large Language Models(LLMs).Background

[0002] Traditional test automation systems rely on live inspection of the AUT toidentify User Interface (UI) elements and generate test scripts. This approach iscumbersome, requires continuous AUT availability, and often produces inaccuratemappings when defect descriptions or requirements are expressed in naturallanguage.

[0003] The prior art US20230315615A1 discloses systems for generatingautomated test cases using large language models. It primarily focuses on directconversion of natural language requirements into executable test scripts.

[0004] The prior art US20200347894 A1 describes capturing UI metadata andgenerating automated test cases referencing UI elements.

[0005] Prior arts disclose metadata extraction and rule-based test generation butlacks a persistent offline UI model and integration with LLMs for natural languagegrounding.

[0006] In some known arts, automated test generation systems typically rely ondirect inspection of the AUT at runtime or require manual authoring of test scripts.These approaches suffer from several limitations: they are tightly coupled to theAUT, meaning that any change in the interface requires repeated rescanning orrewriting of the test scripts; they often produce fragile and error-prone scripts thatbreak when locators change; and they demand significant technical expertise fromtesters to translate natural language defect descriptions into executable code. Priorart systems also struggle with ambiguity in natural language inputs, frequentlyleading to ambiguity on non-existent UI elements or failing to maintain traceabilitybetween requirements, scenarios, and scripts. As a result, they do not adequatelybridge the gap between users who describe defects in plain language and technicalteams who must implement automated tests.

[0007] The subject matter solves these problems by introducing a persistent offlineUI model, editable independently of the AUT, and integrating a large languagemodel (LLM) for test authoring. This architecture ensures that natural language userinputs are converted to BDD test steps which are grounded to actual UI elementsand AUT context. By generating intermediate BDD scenarios in Gherkin format,the system provides a human readable artifact that users can validate beforetransformation into executable scripts. The subject matter thus overcomes thedeficiencies of prior arts by enabling traceability from natural language test intentinputs like defect descriptions, requirements, etc. to test script, reducingmaintenance overhead, and simplifying test automation so that different users cancontribute and use the system effectively.Summary

[0008] The subject matter is defined in the independent claims. Further details aredefined in the dependent claims.

[0009] The subject matter discloses a method and a system for generating testscripts for an Application Under Test (AUT). The method comprises Extracting UImetadata from the AUT; Constructing a persistent offline UI model editableindependently of the AUT; Receiving test intent inputs in natural language orstructured form; Using an LLM to ground references in the test intent inputs toactual UI elements in the offline model; Generating BDD scenarios in Gherkinformat and Transforming the scenarios into executable test scripts in selectedautomation frameworks.

[0010] The system comprises various modules to perform the functionalities of theclaimed subject matter.Brief description of the drawings

[0011] The detailed description is described with reference to the accompanyingfigures. In the figures, similar reference numerals are used throughout the drawingsto reference like features and components.Figure 1 illustrates a block diagram of a system for generating test scriptsfor an Application Under Test according to an embodimentFigure 2 illustrates a hardware block diagram of the system for generatingtest scripts for an Application Under Test according to an embodimentFigure 3 illustrates a method for generating test scripts for an ApplicationUnder Test according to an embodimentDetailed description

[0012] The subject matter now will be described with exemplary embodiments.However, the claimed subject matter may be embodied in many different forms andshould not be construed as limited to the embodiments described herein. Theseembodiments are provided only as examples so that this disclosure is clear andconcise.

[0013] Only the details / components required to describe the claimed subject matterin specific, are disclosed in this document. The details / components which arecommonly known or understood by people skilled in the art may not be covered inthis document.

[0014] Some terms may be used interchangeably in this document. The terms'offline UI model', 'offline model' and 'UI model' are used interchangeably.

[0015] Figure 1, illustrates a system 100 for test automation for generating testscripts for an Application Under Test, using an offline UI model of the AUTaccording to an embodiment. The system 100 comprises UI element metadataextraction module 102, Offline model storage module 104, User interface module106, Input processing module 108, Large Language Model module 110, Scenariogeneration module 112, Review module 114 and Script transformation module 116.Some of these modules may be combined.

[0016] The UI element metadata extraction module 102 analyzes the live AUT tocapture its user interface structure. It analyzes the Document Object Model tree forweb applications or the accessibility hierarchy for native / mobile apps. Each UIelement such as text fields, buttons, dropdowns, and links, are identified along withits attributes, including element type, label, identifier, and locator strategy. Themodule 102 ensures that metadata is normalized into a consistent structure so thatdownstream components can process it reliably.

[0017] The output is a structured dataset, typically in JSON or XML, thatcomprehensively represents the AUT's UI elements. This dataset serves as the rawmaterial for constructing the offline UI model. By capturing locators and attributesat this stage, the module 102 ensures that subsequent test generation steps canreference actual UI elements rather than inferred or assumed ones.Inputs: The live AUT, Access to its UI structureWorking: The module scans the AUT to identify UI elements such as textfields, buttons, dropdowns, and links. It extracts attributes (element type,label, identifier, and locator strategy like XPath / CSS / ID). It normalizes thisinformation into a structured format.Output: A machine-readable dataset (e.g., JSON / XML) containing all UIelements and their metadata.Tools & Technologies:Web: JavaScriptMobile: JavaScriptParsing: JavaScriptImplementation Details: The module 102 analyzes the AUT's UI tree andextracts element attributes (ID, name, type, locator). Metadata is normalizedinto JSON / XML for consistency.

[0018] Once metadata is extracted, the Offline Model Storage Module 104constructs the persistent offline model as below.

[0019] The module 104 normalizes the collected information into a consistentformat and organizes it into a structured, tree-like representation of the userinterface. Each UI element is stored as a node with attributes such as type, identifier,locator strategy, and hierarchical relationships, ensuring that the model mirrors theAUT's structure while remaining independent of it. The offline UI model is storedas persistent offline UI model in format such as JSON, XML, or YAML, and storesit in a repository accessible to other modules. The model 104 is designed to beindependent of the AUT, meaning it can be edited, extended, or annotated evenwhen the AUT is unavailable. The module 104 also supports versioning andsynchronization, allowing updates when the AUT changes. This persistence ensuresthat test generation does not require continuous AUT inspection. The offline modelthus becomes a knowledge source that can be reused across multiple test cycles,defect analyses, and automation frameworks.Input: Metadata dataset generated by the extraction module102.Working: Constructs a persistent offline UI model from the dataset. Storesthe model in a structured format (JSON, XML, YAML). Providesversioning and allows synchronization with updated AUTs. Decouples testgeneration from AUT availability.Output: A persistent offline UI model that can be edited and extendedindependently of the AUT.Tools & Technologies:Storage formats: JSON, XML, YAML.Databases: MongoDB (document store)Implementation Details: Metadata is serialized into JSON and stored in arepository. Synchronization scripts can periodically refresh the model whenAUT changes. An embodiment stores JSON in MongoDB and allowssynchronization scripts to refresh when AUT changes.

[0020] User Interface Module 106 provides a graphical interface for users tointeract with the offline UI model. It displays the captured UI elements, theirattributes, and locator information in a user friendly format. Through the GUI, userscan edit element names, add annotations, or extend the model with newcomponents. The module 106 enables collaborative editing, allowing multipletesters or developers to refine the offline model. By decoupling model editing fromAUT availability, it enables teams to maintain accurate UI knowledge even duringdowntime or when the AUT is inaccessible. The updated model is then stored backinto the repository for use in downstream processes.Input: Offline UI model.Working: Presents the offline model to the user via a GUI. Allows editing,extension, and annotation of UI elements. Supports collaborative updatesand visualization of UI metadata.Output: Updated offline UI model reflecting user edits and annotations.Tools & Technologies:Frontend: Example, React, Angular, or Vue.js for GUI.Backend: Node.js for API services.Visualization: React for rendering UI element hierarchies.Implementation Details: GUI displays the offline model in a tree or tableview. Users can edit element names, add annotations, or extend the model.Changes are persisted back into the storage module. An embodiment usesReact GUI connected to MongoDB, enabling collaborative editing

[0021] The Input Processing Module 108 handles incoming test intent inputs,which may be defect descriptions, structured requirements, or natural language testcases. The UI element data in the offline model along with existing test scenarios(if they are already available) are prepared for retrieval and are further stored in avector database. The module normalizes the inputs into a format suitable forprocessing by the LLM along with retrieval of contextual UI element data from theoffline model and existing test scenarios (if they are already available). Forexample, it may tokenize natural language text, extract key phrases, or convertstructured requirements into a standardized structures. This is later used to retrieverelevant offline model data and existing scenario information. By preprocessinginputs, the module 108 ensures that the LLM receives clean, consistent data. Thisstep reduces ambiguity and improves the accuracy of grounding references to UIelements. The processed inputs are then passed to the LLM module along with theoffline UI model and existing test scenarios (if they are already available).Input: Test intent inputs such as defect descriptions, requirements, orstructured test cases.Working: Normalizes natural language inputs into a format suitable forLLM processing. Handles structured inputs (e.g., manual test cases) andunstructured text (e.g., defect descriptions).Output: Pre-processed test intent data ready for LLM interpretation.Tools & Technologies:LLM based normalization: Example, uses an LLM to analyze the input andorganize it into actionablesIntegration: Part of the pipeline.Vector Database: Example Qdrant, MilvusImplementation Details: Converts user inputs into structured tokens, saves theoffline model and existing scenario information in a vector database suitable forretrieval. Outputs a normalized representation for LLM consumption along withrelevant context. An embodiment uses an LLM for preprocessing and Qdrantdatabase for storing offline model and existing scenario information.

[0022] The Large Language Model (LLM) Module 110 interprets the normalizedtest intent inputs and generates test scenarios with steps referring to the actual UIelements defined in the offline model. For example, when a defect descriptionmentions "user is not able to login," the LLM interprets this as a login relatedscenario and creates test steps which map to login_button. Similarly, other steps aremapped to say, username_field and password_field. This grounding preventsambiguities / assumptions of nonexistent components and ensures that generatedscenarios reference real UI elements. The output is a set of grounded test scenariosready for conversion into BDD format.

[0023] Grounding references mean linking abstract or ambiguous natural languageexpressions to concrete, verifiable elements in the system 100. It refers to theprocess where the large language model interprets phrases from defect descriptionsor test intents and maps them to the actual UI element metadata stored in the offlinemodel while generating test steps.

[0024] This ensures that every reference in a generated scenario corresponds to areal, existing element in the application under test, thereby reducing ambiguity andpreventing invalid or "assumed" test steps.Input: Pre-processed test intent inputs. Offline UI model.Working: Interprets natural language test descriptions. Grounds referencesin the input to actual UI elements defined in the offline model. Prevents ambiguitiesof non-existent components.Output: Grounded test scenarios referencing actual UI elements.Tools & Technologies:LLMs: Example, Claude Sonnet, a foundation model developed byAnthropic, accessed through Amazon Bedrock, Amazon Web Servicesmanaged platform for foundation models. GPT style models (OpenAI,Azure OpenAI, Hugging Face).Prompt engineering: Templates for grounding references.Implementation Details: LLM receives normalized input and offline modelalong with already existing test scenarios (if any). Uses grounding logic tomap generated test steps to actual UI elements. An embodiment uses ClaudeSonnet, a foundation model.

[0025] The Scenario Generation Module 112 takes the grounded scenarios from theLLM and converts them into standardized BDD scenarios in Gherkin format. Eachstep in the scenario explicitly references UI elements from the offline model,ensuring consistency and traceability. The generated scenarios are human readableand collaborative, making them suitable for communication between testers,developers, and analysts. By adhering to the Gherkin syntax, the module 112ensures compatibility with popular BDD frameworks such as Cucumber or Behave.Input: Grounded test scenarios from the LLM.Working: Converts grounded scenarios into standardized BDD scenarios inGherkin format. Ensures references to UI elements are consistent with theoffline model. Produces human-readable, collaborative artifacts.Output: BDD scenarios in Gherkin format.Tools & Technologies:BDD frameworks: Cucumber (Java), Behave (Python), SpecFlow (.NET).Text generation: LLM output formatted into Gherkin syntax.Implementation Details: Converts grounded mappings into Gherkinscenarios. Ensures each step references actual UI elements.Example: Generates, the user enters "validUser", in username_field.An embodiment generates Gherkin scenarios compatible with Cucumber.

[0026] Sample output of BDD scenarios in Gherkin formatFeature: Login functionalityScenario: Successful login with valid credentialsGiven the user navigates to the login pageAnd the user enters a valid usernameAnd the user enters a valid passwordWhen the user clicks the Login buttonThen the system should navigate to the dashboardScenario: Login fails with invalid credentialsGiven the user navigates to the login pageAnd the user enters an invalid usernameAnd the user enters an invalid passwordWhen the user clicks the Login buttonThen the system should display an error message

[0027] Review Module 114 presents the generated BDD scenarios to users forvalidation. It provides an interactive interface where users can edit scenarios, addclarifications, or adjust references. This validation step ensures that scenarios alignwith user expectations and AUT requirements. Once reviewed, the scenarios arefinalized and passed to the script transformation module for conversion intoexecutable test scripts.Input: Generated BDD scenarios.Working: Displays scenarios to users for validation and editing. Providesinteractive editing. Ensures scenarios align with user expectations and AUTrequirements.Output: Reviewed and validated BDD scenarios.Tools & Technologies:Web GUI: React / Angular frontend for scenario editing.Implementation Details: Displays generated scenarios for user validation.Provides inline editing with autocomplete suggestions. Finalized scenariosare stored for transformation. An embodiment uses React GUI forcollaborative editing.

[0028] The Script Transformation Module 116 transforms reviewed BDD scenariosinto executable test scripts 118. It supports multiple automation frameworks suchas Selenium, Playwright, Cypress, and Appium. Locator strategies from the offlinemodel are automatically inserted into the scripts, ensuring accuracy and reducingmanual effort. The output is a set of executable test scripts that can be run directlyon the AUT. By maintaining traceability from user inputs to grounded scenario toexecutable script, this module closes the loop in the test automation lifecycle,delivering robust and reliable automation artifacts.Input: Reviewed BDD scenarios. Offline UI model (for locator strategies).Working: Transforms BDD scenarios into executable test scripts. Supportsmultiple automation frameworks (Selenium, Playwright, Cypress, Appium).Automatically inserts locator strategies from the offline model.Output: Executable test scripts ready to run in chosen automationframeworks.Tools & Technologies:Automation frameworks: Selenium, Playwright, Cypress, Appium.Code generation: Example, Template engines (Jinja2 for Python,Mustache / Handlebars for JS).Locator insertion: Mapping from offline model JSON to framework syntax.Implementation Details: Translates Gherkin steps into executable code.Inserts locators from offline model into framework commands. Anembodiment generates scripts in chosen framework with locators directlyinserted from offline model JSON.

[0029] LLM module 110 Implementation

[0030] In an embodiment, the Large Language Model (LLM) module 110 isimplemented using Claude Sonnet, a foundation model developed by Anthropic,accessed through Amazon Bedrock in a serverless setup. Amazon Bedrock providessecure, scalable API access to Claude Sonnet without requiring the applicant to hostor maintain the model infrastructure. This embodiment ensures enterprise gradereliability, compliance, and integration with existing cloud services.

[0031] The LLM module 110 receives as input (i) normalized test intent dataproduced by the input processing module, (ii) the retrieved UI element informationand (iii) retrieved existing test scenarios information (if any). A structured prompttemplate is constructed, which includes the normalized test intent along with (ii)and (iii). This prompt is submitted to Claude Sonnet via Amazon Bedrock's API.Claude Sonnet analyzes the input, applies contextual reasoning, and generates thetest scenario with test steps referring to actual UI elements defined in the offlinemodel.

[0032] For instance, the term "user login to the application" is mapped to steps withusername_field password_field, and submit_login. The output is a groundedscenario representation that can be consumed by the scenario generation module.

[0033] The use of Claude Sonnet through Amazon Bedrock in serverless modeprovides several advantages: (a) scalability, as Bedrock automatically handlesmodel hosting and scaling; (b) accuracy, since Claude Sonnet is optimized forcoding, agent workflows, and complex reasoning, making it well suited for testautomation tasks; and (c) security, as Amazon Bedrock integrates with enterpriseauthentication and monitoring systems. This embodiment represents the best modeknown for implementing the LLM module, ensuring that natural language defectdescriptions and requirements are reliably grounded to structured UI metadata fordownstream scenario generation and script transformation.

[0034] Alternative LLM Implementation Embodiment

[0035] In another embodiment, the Large Language Model (LLM) module isimplemented using OpenAI GPT models, Amazon Nova models accessed throughtheir respective cloud service APIs. OpenAI GPT models are widely used fornatural language understanding and generation, while Amazon Nova is a foundationmodel family available through Amazon Bedrock, designed for text generation,summarization, and semantic grounding. Both alternatives provide robustcapabilities for interpreting defect descriptions and mapping them to structured UImetadata.

[0036] End-to-End ExampleConsider a defect description: "Login fails when valid credentials areentered."The Metadata Extraction Module 102 captures UI metadata:username_field, password_field, login_button.The Offline Model Storage Module 104 persists this metadata in JSON.The User Interface Module 106 allows a tester to rename login_button tosubmit_login.The Input Processing Module 108 saves the offline model information andexisting scenario information (if present) in a vector database. It also,normalizes the defect description.The LLM Module 110 generates test scenario with steps using "credentials"to username_field and password_field, and "login" to submit_login.The Scenario Generation Module 112 produces a Gherkin scenarioreferencing these elements.The Review Module 114 displays the scenario for validation.The Script Transformation Module 116 generates a script with locators(id=username, id=password, id=submit_login).The final script can be executed directly against the AUT, ensuring accuracyand traceability.

[0037] Figure 2 illustrates hardware block diagram of the system 100. The system100 comprises one or more processor units 200, a memory unit 202 coupled to theprocessor unit 200 and a User Interface (UI) unit 208. The UI unit 208 may atouchscreen.

[0038] The processor unit 200 may comprise one or more of microcontrollers,central processing units (CPU), graphical processing units (GPU), digital signalprocessors (DSP), application specific integrated circuits (ASIC), a controller, fieldprogrammable gate arrays (FPGA), or any other hardware device, a firmwaredevice, or any combination of these. The processor unit 200 is configured using itscontrol registers, input output ports, firmware to perform the operations describedherein.

[0039] The term configured is used for modules to indicate that they performspecific functionality. The modules are configured using the firmware, processorunit 200, memory unit 202, user interface unit 108 etc.

[0040] In an embodiment, the memory unit 202 comprises one or more volatile andnon-volatile memory components which can store data and instructions to beexecuted.

[0041] Tools and technologies

[0042] The modules, interfaces described here may be implemented using variouslanguages like C++, Java, Python, HTML, or any other suitable language. Asuitable language or a combination of languages may be selected based on theplatform where the system 100 runs.

[0043] Data storage / Persistent storage may use Relational DB, NoSQL DB, inmemory storesPostgreSQL, MySQL, MongoDB etc.

[0044] The functionalities of the modules are explained in detail including theinputs, outputs, internal mechanism used etc. The specific implementation of thesemodules depends on the specific platform, hardware etc. The implementationdetails provided herein are only for illustrative purposes and actual implementationmay vary based on platform, hardware, requirements etc.

[0045] Figure 3 illustrates a method 300 for generating test scripts for anApplication Under Test AUT. The method 300 starts with step 302. Step 302discloses extracting UI metadata from the AUT, the metadata comprisingidentifiers, attributes, and locator information of UI elements.

[0046] Step 304 discloses constructing a persistent offline UI model from theextracted metadata and storing the persistent offline UI model in a machinereadable format, being editable independently of the AUT, i.e. editing does notrequire live AUT access, only the offline model repository.

[0047] Step 306 discloses receiving test intent inputs expressed in natural language,structured requirements, defect descriptions etc.

[0048] Step 308 discloses providing the offline UI model and the test intent inputsto a large language model (LLM) configured to interpret the test intent inputs andground references in the test intent inputs to corresponding UI elements defined inthe offline UI model.

[0049] Step 310 discloses generating behavior-driven development (BDD)scenarios in Gherkin format that reference the grounded UI elements from theoffline UI model.

[0050] Step 312 discloses presenting the generated BDD scenarios for user reviewand editing.

[0051] Step 314 discloses automatically transforming the reviewed BDD scenariosinto executable test scripts in a selected automation framework.

[0052] The method 300 may be a preferred embodiment. However, the claimsdefine the legal scope of protection sought, and the examples, embodiments, andbest mode disclosures are intended to support enablement and sufficiency ofdescription. References to particular tools, technologies, or models are illustrativeonly.

[0053] Automatic validation of generated BDD scenarios is achieved by by parsingeach generated BDD scenario step using standard Gherkin parsers or textprocessing libraries, extracting referenced UI element identifiers, andcross-checking them against the persistent offline UI model stored in JSON, XML,or a database. Database queries or schema validation techniques confirm existenceand correctness of attributes such as type, locator strategy, and hierarchy. If amismatch or missing element is detected, the system 100 flags the error and promptscorrection before script transformation. This ensures that only grounded, verifiableUI elements are referenced in executable scripts.

[0054] Transformation of BDD scenarios into executable test scripts comprisesautomatic insertion of locator strategies (e.g., XPath, CSS selectors, accessibilityIDs) derived directly from the offline UI model. This ensures that generated scriptsare robust and consistent with the AUT's actual structure.

[0055] Periodic synchronization of the offline UI model with updated versions ofthe AUT is implemented by rerunning the metadata extraction module 102 atscheduled intervals or upon deployment events, then merging changes into thestored model using version control or diff based updates.

[0056] Receiving test intent inputs from issue tracking systems or requirementmanagement tools is enabled through API integrations with platforms such as Jira,Azure DevOps, or Trello. Defect descriptions or requirements are automaticallyingested and normalized for processing.

[0057] Collaborative editing of the persistent offline UI model 104 is enabled bystoring the model in a shared database or cloud repository with concurrency control.Multiple users can simultaneously annotate or modify UI metadata, with editssynchronized across client interfaces using real-time protocols such as WebSocketor operational transformation algorithms.

[0058] Fine-tuning of LLM may be performed by providing domain-specificdatasets (defect descriptions, UI metadata mappings, historical test cases). Trainingcan be supervised (pairing defect descriptions with UI element identifiers) orreinforcement-based (rewarding correct mappings). This ensures the LLM adaptsto the AUT domain.

[0059] Automatic or periodically updating the persistent offline UI model withchanges in the Application Under Test (AUT) is achieved by implementingsynchronization mechanisms that automatically refresh the offline UI model atscheduled intervals or upon detection of AUT deployment events. The metadataextraction module is rerun to capture updated UI element attributes, identifiers, andlocator strategies. Synchronization scripts compare the newly extracted metadatawith the existing offline model using difference-based algorithms or version controltechniques, merging changes while preserving historical versions. Scheduling toolssuch as cron jobs, task schedulers, or CI / CD pipeline hooks ensure that updatesoccur within twenty-four hours of AUT changes. The offline model repository,stored in formats such as JSON or XML within databases like MongoDB, is therebykept current with minimal latency. Skilled practitioners can implement thissynchronization using standard scheduling frameworks, database update scripts,and version control systems without undue experimentation, ensuring that theoffline model remains accurate and resilient against AUT evolution.

[0060] The subject matter provides various technical effects / benefits, some arelisted below.

[0061] Decoupling from AUT: Test scripts can be generated and maintainedwithout requiring continuous access to the live AUT. Reduction in AUTdependency measured as ≥70% decrease in live AUT usage time during testauthoring compared to conventional systems.

[0062] Accuracy through Grounding: Natural language defect descriptions and testintents are grounded to actual UI elements in the offline model, preventingambiguity / assumptions and ensuring that generated scenarios reference real, validelements. Achieves ≥ 90% reduction in invalid or ambiguous test steps comparedto prior art systems, verified by scenario validation logs.

[0063] Intermediate Validation Layer: The generation of BDD scenarios in Gherkinformat provides a human-readable artefact that users can review and validate beforetransformation into executable scripts, improving traceability and reducing errors.Achieves ≥50% reduction in post-execution script failures due to early detection ofmis-referenced UI elements.

[0064] Automation of Locator Strategies: Automatic insertion of locator strategiesderived from the offline model ensures robust and maintainable test scripts acrossdifferent automation frameworks. Achieves ≥60% reduction in manual locatorauthoring effort.

[0065] Continuous Synchronization: Periodic updates of the offline model withnewer AUT versions keep the system 100 aligned with evolving UI structures,minimizing manual maintenance. Synchronization latency ≤24 hours after AUTdeployment events, ensuring scripts remain aligned with evolving UI structures.

[0066] Integration with Enterprise Tools: Direct ingestion of defect descriptionsfrom issue tracking and requirement management systems streamlines workflowsand reduces duplication of effort. Achieves ≥30% reduction in duplicate data entryand ≥25% faster test case creation cycle time.

[0067] Collaborative Editing: Capability for collaborative editing of the offlinemodel enable both technical and nontechnical users to contribute effectively,enhancing productivity and effective use of test automation.

[0068] Traceability and Auditability: Explicit links maintained between userinputs, UI elements, scenarios, and scripts provide end to end traceability,supporting compliance, quality assurance, and audit requirements. Achieves 100%traceability coverage from defect description to executable script, verified throughaudit logs.Reference numerals and their descriptions100 Test script generation system102 Metadata extraction module104 Offline model storage module106 User Interface module108 Input processing module110 Large Language Model module112 Scenario generation module114 Review module116 Script transformation module118 Test scripts200 Processor unit202 Memory unit204 System memory206 Persistent memory208 User Interface Unit.

Claims

1. A method (300) for generating test scripts for an Application Under Test (AUT), the method (300) comprising: extracting (302) User Interface, UI, metadata from the AUT, the metadata comprising identifiers, attributes, and locator information of UI elements; constructing (304) a persistent offline UI model from the extracted metadata and storing the persistent offline UI model in a machinereadable format, being editable independently of the AUT; receiving (306) one or more test intent inputs expressed in natural language, structured requirements, and defect descriptions; providing (308) the offline UI model and the test intent inputs to a large language model (LLM) configured to: interpret the test intent inputs, generate test scenarios, and ground references in the test intent inputs to corresponding UI elements defined in the offline UI model; generating (310) behaviour-driven development (BDD) scenarios in Gherkin format that reference the grounded UI elements from the offline UI model; presenting (312) the generated BDD scenarios for user review and editing; and automatically (314) transforming the reviewed BDD scenarios into executable test scripts in a selected automation framework.

2. The method (300) as claimed in claim 1, comprising presenting the offline UI model to a user via a graphical user interface (GUI) that allows editing, extension, and annotation of UI elements without requiring live interaction with the AUT.

3. The method (300) as claimed in claim 1, comprising storing the offline UI model in a structured machine-readable format selected from JSON, XML, or YAML.

4. The method (300) as claimed in claim 1, comprising fine-tuning the large language model for software testing tasks to improve accuracy in mapping natural language defect descriptions to UI elements.

5. The method (300) as claimed in claim 1, comprising automatically validating the generated BDD scenarios against the offline UI model to ensure that all referenced UI elements exist and are correctly identified.

6. The method (300) as claimed in claim 1, wherein transforming the BDD scenarios into executable test scripts comprises automatic insertion of locator strategies derived from the offline UI model.

7. The method (300) as claimed in claim 1, comprising editing of the offline UI model with updated versions of the AUT to incorporate changes in UI elements.

8. The method (300) as claimed in claim 1, wherein receiving the test intent inputs comprises receiving one or more of requirements, manual test cases, defect descriptions extracted from issue tracking systems or requirement management tools.

9. The method (300) as claimed in claim 1, comprises reviewing the generated BDD scenarios along with interactive editing.

10. The method (300) as claimed in claim 1, comprising enabling collaborative editing of the persistent offline UI model by multiple users simultaneously, wherein edits are synchronized in real time across client interfaces.

11. The method (300) as claimed in claim 1, further comprising periodically or automatically updating the persistent offline UI model with changes in the Application Under Test (AUT), wherein synchronization scripts or scheduled processes refresh the offline UI model after detecting AUT deployment events or changes in AUT, thereby ensuring that the offline model remains aligned with the evolving UI structure.

12. A system (100) for generating test scripts for an Application Under Test (AUT), the system (100) comprising: a metadata extraction module (102) configured to extract user interface element (UI) metadata from the AUT; an offline UI model construction module (104) configured to create an offline UI model and store the extracted metadata in a structured format;a user interface module (106) configured to present and allow editing of the stored metadata; an input processing module (108) configured to normalize natural language test intent inputs and store, retrieve UI element data from the offline model and existing scenarios in a vector database; a large language model (LLM) module (110) configured to ground the normalized inputs to user interface elements in the stored metadata; a scenario generation module (112) configured to produce behavior-driven development (BDD) scenarios based on the grounded inputs; a review module (114) configured to present and allow editing of the generated scenarios; and a script transformation module (116) configured to convert the reviewed scenarios into executable test scripts (118).

13. The system (100) as claimed in claim 12, wherein the offline model storage module (104) stores UI metadata in a document-oriented database selected from the group consisting of MongoDB and MySQL.

14. The system (100) as claimed in claim 12, wherein the input processing module (108) applies LLM based normalization and stores, retrieves data from a vector database like Qdrant.

15. The system (100) as claimed in claim 12, wherein the large language model module (110) is implemented using Claude Sonnet or using OpenAI GPT models or Amazon Nova.

16. The system (100) as claimed in claim 12, wherein the scenario generation module (112) produces behavior-driven development scenarios in Gherkin format.

17. The system (100) as claimed in claim 12, wherein the review module (114) provides real-time scenario editing.

18. The system (100) as claimed in claim 12, wherein the script transformation module (116) generates executable test scripts (118) using a template engine.

19. The system (100) as claimed in claim 12, wherein the script transformation module (116) outputs test scripts (118) compatible with automationframeworks selected from the group consisting of Selenium, Playwright, Cypress, and Appium.

20. The system (100) as claimed in claim 12, wherein the system (100) maintains traceability between defect descriptions, grounded UI elements, generated scenarios, and executable test scripts.