ChatGPT —Cypress— QA- Developers

Kishor Munot
6 min readApr 28, 2023

--

Developers and QA with ChatGPT

Hello readers,

Hope you doing well these days. We are going to discuss ChatGPT and its meaningful use in the daily working life of people in technology. Today, the word ChatGPT is on almost everyone’s lips and now the launch of ChatGPT is sure to impact everyone’s life.

What is ChatGPT

ChatGPT is an artificial intelligence chatbot that uses natural language processing (NLP) to communicate with developers. It’s built on the GPT-3.5 architecture, which is an advanced machine-learning algorithm capable of understanding human language and generating human-like responses. Chat GPT can analyze code, provide suggestions, and assist developers in writing code more efficiently.

How it works

Chat GPT uses deep learning algorithms to understand the context of a developer’s query. It can analyze the code, identify errors, and suggest improvements based on the code’s structure and syntax. The chatbot can also provide relevant documentation and code examples to help developers or QA better understand a particular programming concept. Chat GPT’s ability to understand natural language means that developers can communicate with it in the same way they would with a human colleague.

Relation between Developer/ QA and ChatGPT

When ChatGPT came out on the market in late November 2022, people regarded it as a powerful content-generation tool. But quickly, the curtains came off and ChatGPT showed its amazing potential for writing software code as well. This came as a surprise for everyone because nobody was expecting this ability from this tool. This stunning capability made headlines in the field of software development, giving developers and QA a new tool to add to their repertoire.

Considering its current capabilities, ChatGPT brings a lot of benefits for developers. It can write complete programming code on its own, allowing developers to just sit back and provide the instructions. All they have to do is check the correctness of the code generated at the end, but this is not a difficult task because ChatGPT writes code very well. This certainly represents a next-level evolution, showing how software programming (like the development process) can also be automated.

However, with this great advancement, some valid concerns have also been raised by the development and QA community. Many people fear that this great evolution could replace their jobs in the future.

Today’s ChatGPT role in technology

With the use of in-depth machine learning algorithms, ChatGPT can handle and manipulate data in bulk. This means that basic programming operations can be easily done with ChatGPT. It will help you to quickly create functions, modules, and so on. And, based on case-specific requirements, you can always edit the results to create the perfect code for any needed software feature.

ChatGPT with Cypress

In its first week of launch, ChatGPT shattered Internet records by becoming extremely popular. As a person who works in QA automation, my initial thinking when I started looking into it was how to use this wonderful platform to make the jobs of testers for Web and UI automation simpler.

As ChatGPT may be used to write code in a variety of programming languages and technologies. After more investigation, I made the decision to create some scenarios using it. I have created some use cases around UI, and API. You will find how to write automation test scripts using Cypress and chatbot.

Let’s set up a Chat-GPT login test scenario for a predefined website.

Questions: Create a test scenario for testing the login of https://web.testquality.com “I got an interesting answer from ChatGPT.

ChatGPT response to a question

Then, I asked ChatGPT to write a code for opening a web URL through cypress and I got the below answer form ChatGPT. I have executed the same test with the received response and it worked well.

Now, I asked ChatGPT to click on the NSblogs link on the respective page and I got the below result but that is not working in reality.

after that, I modified the code and executed my code with { force: true } for smooth work.

Now, I changed my testing and moved to API testing.

I asked ChatGPT to Generate Cypress API code for GET request for link https://reqres.in/api/users?page=2 and verify status code 200

When I ran the above-Generated code in reality Its worked fine and I am able to verify the response with the status code “200”

Generate Cucumber .feature file using ChatGPT

ChatGPT is very useful in creating the .feature file. I have asked to Generate .feature file for some of the below scenarios and the generated file looks good to me.

Now, after testing ChatGPT with Cypress which is an emerging tool these days I think we can use ChatGPT to generate code but we can’t say that generated code is perfectly fine, you need to make some changes to work.

ChatGPT is replacement for human.

ChatGPT is undoubtedly a great AI tool that brings various advantages to software development. However, it is still a computer bot and has a few limitations in its system today. These boundaries can’t be passed by the AI itself, and can only be resolved by a human. This is one of the core reasons why human developers still have an edge over ChatGPT. There are various jobs in which software developers need to work themselves because they cannot be done using automated code.

Developers or Quality Engineers have a unique set of skills that make them invaluable problem-solvers in the workplace. Their expertise and experience ensure they possess an in-depth understanding of the development & quality assurance process that cannot be easily replicated by ChatGPT and other AI technologies. This deep knowledge is key to recognizing and resolving common problems quickly and efficiently. Furthermore, QA engineers bring creative solutions to the table by utilizing their years of hands-on experience to take a novel approach to their work. In summary, their expertise, experience, and creativity make engineers essential assets for successful problem-solving in any business setting.

If developers and QA will take help from the ChatGPT to keep their code clean and fresh that will be good benefit for them. They will get ready code as we get in stack overflow and after that, we have to modify it as per our requirement.

From where ChatGPT stands today, it may very well help humans as computers helped humans when computers came along, or ChatGPT may fail if humans have no reason to help.

Keep reading, Keep testing and follow me and my team for upcoming interesting content.

Thank you.

--

--