UiPath Documentation
autopilot
latest
false
Autopilot user guide

Generate coded test cases

Autopilot capabilities for generating coded and low-code test cases from natural language, comments, or existing code.

Autopilot assists you in generating coded test cases, either from text and existing code, or from manual test cases created in Test Manager.

Generating coded test cases from text and existing code

In a new or existing coded automation, you can use Autopilot to generate code from natural language, from comments in your automation, or from existing lines of code. Use the Ctrl + Shift + G shortcut, or the Autopilot icon, to generate code.

Generating coded test cases from manual tests

After you connect Studio Desktop to Test Manager, navigate to the Test Explorer and search for your manual tests. From here, you can choose one of the following scenarios to generate a coded test case for it:

  • Create a coded test case, where the steps are shown as comments, using Create Coded Test Case.. Then prompt Autopilot to generate code based on the comments.

  • Directly generate a fully functional coded test case using Generate Coded Test Case with Autopilot.

Refer to Creating a coded test case from a manual test case and Generating coded test cases using AI for more information about generating test cases.

Generate coded API test cases

If you want to create a coded test case that automates a scenario involving APIs, Autopilot can help with generating the code for this scenario. In the code editor, open the context menu and select Generate Code, then offer Autopilot the necessary instructions. For instance, you should offer Autopilot the API that you want to use, and the API key that it should access.

Generate low-code test cases

Autopilot assists you in generating low-code test cases, either from text or from manual tests created in Test Manager.

From manual tests

Connect Studio Desktop to Test Manager and locate your manual test in the Test Explorer. Then, open the context menu for the manual test and select Generate Test Case with Autopilot.

From text

Open your blank low-code test case and select generate with Autopilot from the Designer panel. Enter the desired test steps, and then select Generate to trigger the test case generation.

Figure 1. Typing prompt instructions in the Type annotation field

For more information, refer to Generating low-code test cases using AI.

Best practices

For guidance on writing effective prompts, and on using object repositories and naming conventions when converting text or manual tests into code, see:

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated