Member-only story
How to use ChatGPT/Gemini/Claude to write Test Automation Code. No Code only Prompts!
This is a realtime approach being used by Test Automation Engineers
I have conducted test this on an open source testing application. Obviously if you want to use this trick, than make sure there are no security or privacy concerns for your project/product to be used with these LLM models. They might lead to Data Leakage. For such concerns use Offline LLM (AI) models.
(Complete code repo attached below)
Let’s jump right into it!
Step: 1 = Share your Project structure with LLM model to make sure to it writes the code following the same structure. Below is an example prompt
Example Prompt with Project Structure:
Above is the folder structure I have created for my Test Automation Project
Now We need to create code to fit into this structure.
I'll share the names of Page classes and Test Classes and you can
generate the code.
let me know if you have any questions?
ProjectName/
├── pom.xml
├── README.md
└── src
├── main
│ ├── java
│ │ └── com
│ │ └── yourcompany
│ │ ├── base
│ │ │ └── BasePage.java
│ │ ├── pages
│ │ │ ├── HomePage.java
│ │…