4. Scriptless Test Case Creation
The test case is a set of conditions that determines if the application or one of its modules is behaving as expected. You can write multiple test cases in a single module. Test cases are executed in alphabetically ascending order of test case names. Here’s a step-by-step guide for Scriptless Test Case Creation for mobile.
1. Test Cases
-
- Click on Add Test Case
- Add a Test Case Name and Description.
- Add steps (more on this below in the section)
Actions
These are the actions we use to write our test cases. The following are the definitions and a few examples of when each action would be used.
Wait For
-
- This action is for Android, iOS, and Web.
- This action will delay the test case for a specified amount of time (in seconds) or until a certain condition is met before continuing to the next step.
Tap on
-
- This action is for Android, iOS, and Web.
- This action is used to Click on any element. We can also specify the number of taps and the number of touches to perform.
Check
-
- This action is for Android, iOS, and Web.
- We can specify assertions using the Check action. It can “Check” if a specified condition is true. The check action will also “Check” the value of any element.
Start If, Start Else, End If
-
- This action is for Android, iOS, and Web.
- This action works as a conditional IF and Else statement like in any other programming language. We can check if the element is visible before we perform the “tap on” action on it.
Scroll to
-
- This action is for Android, iOS, and Web.
- This action is used to scroll the screen until the element is at the top of the screen.
Swipe
-
- This action is for Android, iOS, and Web.
- This action is used to perform a directional swipe gesture. We can specify any of the four directions, and the swipe will happen in the middle of the screen. We can also specify the container that we wish to swipe in.
Type In
-
- This action is for Android, iOS, and Web.
- This action is used to type text in the text fields. The auto-hide keyboard feature can be set to true or false.
Variable
-
- This action is for Android, iOS, and Web.
- This Action is used to declare a variable. We can also specify its datatype (String, integer or JSON)
Save to Variable
-
- This action is for Android, iOS, and Web.
- This action is used to assign value to the already declared variable.
Repeat If, End Repeat
-
- This action is for Android, iOS, and Web.
- This action performs a repetitive action based on the condition set by the user.
Comment
-
- This action is for Android, iOS, and Web.
- This action has no effect on the test case running. Commenting is used as a way to make notes for the user.
Dismiss Alerts
-
- This action is for Android and iOS.
- This action is used to dismiss alerts that are native to the OS.
Call Test Functions
-
- This action is for Android, iOS, and Web.
- This action calls a declared test function.
Pull Down to Refresh
-
- This action is for Android and iOS.
- This action will pull down on a certain element to refresh the screen.
Call Network Assert
-
- This action is for Android, iOS, and Web.
- This action calls the network assert test case inside the UI test case.
Relaunch App
-
- This action is only for iOS.
- This action will close and relaunch the application.
Clear Network Log
-
- This action is for Android, iOS, and Web.
- This action ignores the network calls that were made prior to this step in the network assert test case.
Debug Element
-
- This action is only for iOS.
- This action without any argument prints the description of all elements on that screen.
- This action with the ElementName – prints the descriptions of all descendants of that element.
Print Log
-
- This action is for Android, iOS, and Web.
- This action will print the parameter you give it in the detailed log (ie: Typing “Hello World” will print “Hello World” in the detailed logs)
Check Ad with ID
-
- This action is for Android and iOS.
- This action will use the resource id for the ad container.
Increase
-
- This action is for Android, iOS, and Web.
- This action increases the value of an integer variable.
Declare
-
- This action is for Android, iOS, and Web.
- This action is used to declare elements while writing test cases.
2. Test Functions
-
- Test Function is a set of commands that performs a specific action. You can create a Test Function of any repetitive actions.
- Click on “Add Test Function” button
-
- If you have the same scenario in many test cases then you can create one function for that and use it in every test case.
- Add a Test Function Name and Description.
- Add steps.
- Click on Update button.
Use Test Function In TestCase
-
- Open your test case.
- Select the Call Test Function.
- Now, you can see your test functions in the right field and select the function from the drop-down list.
3. Network Assert
-
- Click on Add Network Assert
- Add a Test Case Name and Description.
- Add steps (more on this below in the section)
Actions
After running a UI test case you receive a network log. Once we have the network log we can go in and select the Network calls to assert.
Variable
-
- This action is for Android, iOS, and Web.
- This Action is used to declare a variable. We can also specify its datatype (String, Integer, or JSON) and store static values, request parameter values and response values into the variable.
Request URL
-
- This action is for Android, iOS, and Web.
- This action will select the specified URL as the request.
- Once you have selected “Request URL” and once you name the request you are able to select a URL from a dropdown list.
-
- If you select a URL with queries you can select queries to be added as request parameters
Request Parameter
-
- This action is for Android, iOS, and Web.
- This action requests parameter variables(This will be auto-filled if you select the queries from the Request URL)
Response URL
-
- This action is for Android, iOS, and Web.
- This action gets the response of a specific request made in the response variable.
Check
-
- This action is for Android, iOS, and Web.
- This action is used to make assertions on network request, request parameters and response as well as variables (ie: Checking that the URL exists while the application is running)
4. Custom Scripts
-
- Click on Add Custom Script
- Below the Popup box will appear on the screen.
-
- Add a Test Case Name and Description.
- Add your scripts on Custom Script.
- Click on Save.
Actions
Call Custom Script
-
- This action is for Android, iOS, and Web.
- This action is used to call the custom script that you created in a custom script section.