Main content of this section:
1. Create a new automated test project;
2. Create a new test case;
3. Run the project;
4. View reports and logs.
Open AutoTest Studio and select "New Project" on the start page to open the new project wizard.
Enter the project name and project save location in the New Project Wizard dialog box. This article takes "Demo" as an example, and the save location is the default path.
Configure the project's python interpreter, "Python Interpreter" can choose one from the list of pre-configured python interpreters, or you can select a new python interpreter through the "..." button behind.
AutoTest Studio supports running automated test projects in a virtual environment. Select "New a virtual environment with the Pipenv Tool", and AutoTest Studio will create a virtual environment based on the selected "Python Interpreter".
If you need to modify the configuration of the Python interpreter, you can modify it in the project's properties window after the project is created.
Click the "OK" button, AutoTest Studio will automatically create the project, including initializing the runtime environment of the python interpreter.
Click the right-click menu in the "Project Explorer" of AutoTest Studio, click "New" -> "File" in turn, and complete the creation of the test case in the pop-up test case creation wizard.
Only tset cases or files created in the "Project Explorer"will appear in the project's directory.
Through the creation wizard, select "File"->"Python File" to create a new test case file, fill in the name of the test case, and the file storage location cannot be changed.
The creation of tset cases can also be created through templates. AutoTest Stduio allows users to create different template files according to their needs and add them to the program.
Write the following code in the test case.
from autotest import *
SetCase("TC-001","Check if variables are equal","1")
AssertEqual(a,b,"Checks if the values of two variables are equal.")
The "SetCase" function is used to set the CaseID, CaseName, and CaseLevel information of the test case.
"AssertEqual", which verifies that the values of two variables are equal.
The "autotest" package must be included in each test case.
Select the test case, right-click, and select "Run" from the pop-up menu.
After the test case run is complete, the test report will be automatically opened by default.
In "Details" you can view the logs of all test cases.
Click "Open" to view the complete test case log.
If you need to view the previous test reports and logs, you can run the test report manager in the menu "Tools" -> "Reports". In the manager, you can see all the historical test reports of the current project.
Select the test report record and click "Open Report" to open the specified test report. You can also export the test report through "Export".