Generate test steps in Katalon Studio script view
Once a new test case is created, you can switch to the Script view using the corresponding tab at the bottom of the test case editor. Test steps specified in the Manual view are translated into a Groovy script in Script view.
By using the import statement in a test script, you can reference to the classes you wish to use. Expand the import section to see all default imported classes by Katalon Studio. The name after 'as' in each import statement is an alias for the class. You can change the alias for each class. These classes are necessary for composing a test script.
Use built-in keywords in script view
The following API docs may prove useful when working in script view:
Class | Description |
---|---|
Builtin Keywords | List of common built-in keywords |
WebUI Builtin Keywords | List of Web UI built-in keywords |
Web Service Builtin Keywords | List of Web Service built-in keywords |
Mobile Builtin Keywords | List of Mobile built-in keywords |
Windows Builtin Keywords | List of Windows built-in keywords |
WebUI.
for Web UI or WS.
for Web Service.Refer to an object in script view
Usage example: Generate test steps in script view
In our example, we use a sample test case with the steps as below:
- Open the browser.
- Navigate to a website.
- Click on a specific control.
- Validate if a control exists on the page.
- Close the browser.
In this scenario, you will create a Web application test script to make use of the WebUI built-in keywords. Follow these steps to automate the above test scenario in Script view:
Learn more with our Katalon Academy course: Create and Execute Test Cases.