Officially published by OpenAI on 30th November 2022, ChatGPT recorded a surge of over 1 million users only in one week after launching. This technology enables genuine conversational interactions, allowing it to answer and explain concepts plainly, reply to follow-up questions, and acknowledge errors, just like a human. In fact, its capabilities have been applied in various aspects, such as writing an article, composing song lyrics, or even generating lines of code in different programming languages.
It’s undeniable that ChatGPT is powerful. But do you think this AI technology can transform enterprise software testing? Let’s explore the possibility!
ChatGPT is a natural language processing chatbot that uses the Generative Pre-Trained Transformer 3 (GPT-3) model to generate human-like text for back-and-forth communication. Since it is trained on a massive amount of text data, the response tone from ChatGPT can be varied based on different scenarios.
Here’re some of the inherent capabilities of this AI chatbot:
Among its capabilities, ChatGPT can automatically produce correctly formatted and relevant code in response to a simple natural language request. The advantage is that it can generate code in a variety of languages and frameworks and employ multiple built-in packages across those languages. For example, this AI chatbot can write Selenium code in many languages and can even be further queried if any adjustments are necessary.
So, can ChatGPT create code for use in test automation? The answer at this point is, “Yes, but to some extent.” Following are some possible use cases of ChatGPT in enterprise software testing:
ChatGPT can help improve ROI in automation software testing by improving test coverage and increasing testing efficiency while reducing the time and effort required for test case creation and cutting down costs.
Here are some of the typical testing activities that ChatGPT can perform:
Imagine the following scenario: you want to arrange the test automation for a mobile banking app, for which you have created several features. In these cases, you may use ChatGPT to produce a test plan by providing the tool with information about the functional components and how they are utilised.
Prompt: “Prepare a test plan for an automation test to check the functionality of a login form on the mobile banking app. After opening the app, success if the user fills in the right user name, and password and presses the "Login" button."
ChatGPT:
As mentioned above, ChatGPT's capability includes generating test scripts in various programming languages. You can request ChatGPT to generate a test case to open a specific website and perform an action on that with defined frameworks.
Cypress is a JavaScript-based test automation framework for web applications, so I’ll use ChatGPT to create a test script in this language.
Prompt: “Write Cypress/ Javascript code for opening the URL of the site https://kms-solutions.asia/ and Click on the Link “Blogs”
ChatGPT:
The answer from ChatGPT is designed to be straightforward, easy to understand, and flexible, allowing testers to quickly and effortlessly generate automated UI tests. By minimising the need for time-consuming manual testing, ChatGPT frees up engineers to work on higher-level projects while saving the company time and money.
It is possible that high-level test cases may miss critical information that can mislead any QA expert. The AI-driven ChatGPT tool can build test scenarios and enhance its results on the repetition of the same question.
ChatGPT can generate test cases for a variety of requests, including:
Prompt: “Prepare sample test cases to test a login form on mobile, in which has a user name, password, and login button.”
ChatGPT:
Additionally, ChatGPT can provide recommendations and best practices for designing test cases. Since it lists down all the necessary test cases that you need to perform, your testers can have ideas for testing even though they aren't familiar with that functionality.
ChatGPT can be used to format any information and get it ready for any other format. For instance, you need to format the test plan to input data and track bug simply like Jira or Github; in this scenario, you may leverage ChatGPT by prompting further in the same thread:
Prompt: “Prepare test case table to enter into Jira tickets.”
ChatGPT
ChatGPT also can help identify some positive and negative test cases using any possible variants of data input (both valid and invalid).
Prompt: "Write positive test case/ negative test case for mobile login form"
ChatGPT:
ChatGPT can be perceived as a powerful tool for writing test cases with no code experience. This AI technology accepts natural language as input, allowing users to write in their natural cadence while still being understood, in contrast to template-based models that often depend on certain language structures or key phrases.
In essence, using ChatGPT, QA teams can generate test automation scripts, classes, and functions and define both positive and negative test cases for complicated scenarios in automated testing.
Additionally, this AI tool can:
As a low-code testing tool, ChatGPT makes it effortless to update and fix code. For instance, QA experts can request ChatGPT to change the previously created code to correct any bugs. Users can leverage ChatGPT to perform precise changes in the code by using its conversational model.
Despite tons of potential to become a low-code solution for automation testing, ChatGPT also has some downsides, and it cannot replace the main job of an automtion tester.
For example, some websites require both the username and password entered on the same page before submitting, but others have you first input the username, then click a button like “Next” and then input the password. ChatGPT cannot flexibly change the test strategies and will need to be trained to perform the test, which can be done simply by the automation tester.
Although ChatGPT has some drawbacks, it is used regularly to reduce stress related to automation testing and create test cases faster.
ChatGPT is undoubtedly a powerful natural language model with huge potential in automation testing. From conversation to code, it helps simplify the automation testing process, revolutionise overall growth and achieve top quality assurance. Several capabilities from ChatGPT, including advanced language processing, vast knowledge, and others, allow efficient and natural testing experience.
However, as ChatGPT is in the beta phase so it has various limitations and cannot perform complicated tasks. Thus, this tool is believed to be “a future of automation testing”, but now, it is mainly the QA experts' job.
Further Reading: ChatGPT and Developers: Friend or Foe?
If you're interested in our Digital Testing content and services, don't forget to leave your information here!