Chat GPT and testdatacreation

How We Use ChatGPT in Consultancy: A Blog Series Preview

In this series, I will walk you through hands-on demonstrations of how we leverage ChatGPT in our daily consultancy activities.

Today’s Experience:
Today I was talking to a Tosca expert(very hard working guy though) and we were talking about how long it would take to parse a xml data set to generate a bsn structure for a certain activity for one projects. I gave him the challenge to do it totally different and he choose for python

The Big Question:
So the question was: Can ChatGPT work together helping him creating a python script by a tester who does not have any programming skills? :sweat_smile: The answer is… yes ;-),but :rocket: :woman_technologist: :man_technologist:

Yes, ChatGPT can indeed assist in crafting a Python script even for a tester who lacks programming expertise. :smiley: However, there are certain nuances and complexities in scripting that might require a deeper dive or some hands-on practice to fully getting hold on it. But with the right guidance anything is possible!

Step-by-Step Guide:

The first thing I advised him to do is installing faker

Setting Up:
Start by installing Faker, a library that can generate mock data in various languages. This will be handy for populating our XML structure.

pip install Faker

Crafting the Script:
To structure the XML, use ET.Element:

This can generate mock data for any language which can be used in the xml structure to be created. Second import which Chatgpt gave us and I never heard of (the above one I did) is ET.Element. This actually setups a an elementree object for xml and you can then enter data based on the tag structure

from faker import Faker
import xml.etree.ElementTree as ET

fake = Faker('nl_NL')  # Dutch locale

def generate_dutch_citizen_data():
    citizen = ET.Element("citizen")

    # First name and last name
    name = ET.SubElement(citizen, "name")
    name.text =

    # BSN
    bsn = ET.SubElement(citizen, "bsn")
    bsn.text = fake.ssn()  # In the Dutch locale, ssn() generates a BSN.

    return citizen

def main():
    root = ET.Element("citizens")

    # Generate data for 10 citizens
    for _ in range(10):
        citizen = generate_dutch_citizen_data()

    # Convert the XML data to a string and save
    tree = ET.ElementTree(root)

if __name__ == "__main__":

When the script has be made and you have ran the script locally you can see that it created a structure.

        <name>Full Name of Citizen 1</name>
        <bsn>BSN of Citizen 1</bsn>
        <name>Full Name of Citizen 2</name>
        <bsn>BSN of Citizen 2</bsn>
        <name>Full Name of Citizen 10</name>
        <bsn>BSN of Citizen 10</bsn>

“It’s incredibly speedy, and both Python and JavaScript excel at generating this data. By integrating it with tools like Tosca and Katalon, or open-source options like Robot Framework, WDIO, and Cypress, you can significantly enhance your test data management and test automation success.”
Caviats are: you still need to have some programming skills. It is nice that Chatgpt generates code and does suggestions but still you have to interpret if the code is efficient and working. So for a nontechnical tester. Dive into the studybooks and learn!

More things which can be done with ChatGPT are:

Creating Test Cases: ChatGPT can help make test cases for your software. If you tell it what a user does on a website, it can think of different situations to test. Like, what happens if the password is wrong? Or if a user tries to log in too many times?

Writing Test Documents: Need to write down how you tested? Or the results? ChatGPT can help you write these documents.

Exploring Software: ChatGPT can help testers look around the software to find mistakes by talking to it.

Guessing Where Bugs Are: ChatGPT can try to guess where the software might have problems. This helps testers know where to look first.

Helping Teams Talk: Sometimes it’s hard for people who know a lot about technology to talk to people who don’t. ChatGPT can help them understand each other by turning what they say into test steps.

This is just the start. There’s a lot more we can do with AI in testing and I believe it has a lot of potential

More information on how to create this example Pythonfile can be found in my repo

Follow me on LinkedIn: if you have any questions

Related articles

Integrating python Gmail api using Service Account to fetch e.g. oauth


15 Oct 2023

Integrating python Gmail api using Service Account to fetch e.g. oauth

Mastering Waits in UI Automation


6 Oct 2023

Mastering Waits in UI Automation

Parrallel testing with Python, Cucumber, and Docker Compose


6 Oct 2023

Parrallel testing with Python, Cucumber, and Docker Compose


Are you ready to learn everything regarding testautomation

The guided path and the learnportal will make you a t-shaped tester. Guided by advanced material and hosted by a senior tester this portal will help you become professional

Contact us