Updated Action Keyword for Web and Android

You are here:
< All Topics

A test case is a set of conditions that determine whether an application or one of its modules is functioning properly. You can write multiple test cases in a single module. Test cases are executed in alphabetically ascending order of their names.

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.

 

1. 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.

 

  • “Is Visible” condition to be checked whether the element is visible or not.

  • “Is Invisible” condition to be checked whether the element is Invisible or not.

  • “Is On” condition to be checked where the element is UI like toggle button on or off.

  • “Is Off” condition to be checked where the element is UI like toggle button on or off.

  • “Is Equal To” condition to be checked where the element condition value matches the aspected or received value.

  • “Is Not Equal To” condition to be checked where the element condition value does not match the aspected or received value.

  • “Is Greater Then Or Equal To” condition to be checked where element condition is logically given accordingly value.

  • “Is Less Than Or Equal To” condition to be checked where element condition is logically given accordingly value.

  • “Is Greater Than” condition to be checked where element condition is logically given accordingly value.

  • “Is Less Than” condition to be checked where element condition is logically given accordingly value.

  • “Contains” condition to be checked where element text contains some character, digit, etc. given accordingly value.

  • “Is Enable” condition to be checked where elements are enabled, like UI buttons, toggles, etc

  • “Is Disable” condition to be checked where elements are enabled, like UI buttons, toggles, etc.

 

2. 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.

  • For the Number of Tap

  • For Multi-touch

3. 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.

 

  • “Is Visible”: This assertion condition is checked when an element is visible or not.

  • “Is Invisible”: This assertion condition is checked when an element is visible or not.

  • “Is On”: This assertion condition is checked when an element is UI like a toggle button on or off.

  • “Is Off”: This assertion condition is checked when an element is UI like a toggle button on or off.

  • “Is Selected“: This assertion condition is checked when an element is UI like a checkbox or dropdown value is selected or not.

  • “Is Equal To”: This assertion condition is checked when an element value equal to the condition is logically given accordingly value.

 

  • “Is Not Equal To”: This assertion condition is checked when an element value not equal to the condition is logically given accordingly value.

 

  • “Is Greater Than Or Equal To”: This assertion condition is checked when an element value to greater equal to condition is logically given accordingly value.

 

  • “Is Less Than Or Equal To”: This assertion condition is checked when an element value to less equal to the condition is logically given accordingly value.

 

  • “Contains”: This assertion condition is checked when an element value to contains is logically given accordingly value or not like characters, digits, etc.

 

  • “Contains Alert Type”: This assertion condition is checked when an element values on the Alert popup contains are logically given accordingly value or not like characters, digits, etc.

 

  • “Is Enable”: This assertion condition is checked when an element is enabled, like UI buttons, toggles, etc

  • “Is Disable”: This assertion condition is checked when an element is enabled, like UI buttons, toggles, etc.

 

 

4. 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.

  • This keyword is used as a conditional operator.

  • Each Start IF keyword should be followed by End If. It can contain necessary steps between the Start IF and End IF statements, which will be executed if the condition is true.

  • Start Else can be used in between “Start If“ and “End If” to specify the statements that are executed if the condition specified in the “Start If“ statement fails.

 

 

5.  Scroll to:

  • This action is for Android, iOS, and Web.
    This action is used to scroll the screen until the element is in the visible part of the screen. accordingly, action as we use for UP, DOWN, LEFT, & RIGHT.
    For Multiple layout elements to be used parents and child elements form the below example.

 

6. 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 (up, down, left, and right) will happen in the middle of the screen. We can also specify the container that we wish to swipe into. Also able to swipe on interaction in particular elements.

 

 

7. 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. True, it means keyboard hide and is also able to be used as a saved variable with a name and directly passed text that you want to type.

8. 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)

 

 

  • Using this URL, you can convert CSV to JSON:  https://{_YOUR_DOMAIN_}.testgrid.io/csv-to-json.

 

9. Save to Variable :

  • This action is for Android, iOS, and Web.
    This action is used to assign value to the already declared variable.

 

10. Repeat If,  End Repeat : 

  • This action is for AndroidiOS, and Web.
  • This action performs a repetitive action based on the condition set by the user.

 

11. 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.

 

12. Call Test Functions : 

  • This action is for Android, iOS, and Web.
    This action is called a declared test function.

13. Call Network Assert : 

  • This action is for Android, iOS, and Web.
    This action calls the network assert test case inside the UI test case.

 

14. 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.

 

 

15. Print Log : 

  • This action is for Android, iOS, and Web.
    This action will print the parameter you give it in the detailed log (i.e.: Typing “Hello World” will print “Hello World” in the detailed logs)

 

 

16. Increase : 

  • This action is for Android, iOS, and Web.
    This action increases the value of an integer variable.

17. Select : 

  • This action is for Android, iOS, and Web.
    This action is used to select text from a single-element or multiple-element list with text and index.

 

 

18. Switch to iFrame : 

  • This action is only for Web.
  • This action is used to switch to iFrame on the web with the using frame ID and index.

 

 

 

19. Switch to Parent Frame : 

  • This action is only for Web.
  • This action is used to switch to Parent iFrame on the web.

 

20. Switch to Default Content : 

  • This action is only for Web.
  • This action is used to switch to Default Content on the web.

 

21. Switch to Tab : 

  • This action is only for Web.
  • This action is used to switch a tab on the browser.

 

22. Open New Tab : 

  • This action is only for Web.
  • This action is used to open a new blank tab on the browser.

 

23. Right Click : 

  • This action is only for Web.
  • This action is used to perform a mouse right-click on the element.

24. Double Click : 

  • This action is only for Web.
  • This action is used to perform a mouse double-click on the element.

25. Click and Hold : 

  • This action is only for Web.
  • This action is used to perform click and hold action on an element.

26. Type Encrypted : 

  • This action is for Android, iOS, and Web.
    This action is used to type text in the text fields in encrypted format. The auto-hide keyboard feature can be set to true or false.

  • Use the link below to convert your password or sensitive access data to an encrypted format for use with TC.

  • Example : https://{_YOUR_DOMAIN_}.testgrid.io/hide-me

 

 

27. Hover : 

  • This action is only for Web.
    This action is used to hover an element.

 

 

28. Write to CSV File :

  • This action is only for Web.
    This action is used to write text in CSV. You can use select action or element or the text.

29. Declare : 

  • This action is for Android, iOS, and Web.
    This action is used to declare elements while writing test cases.

 

30. Take Full Screenshot :

  • This action is only for Web.
    This action allows you to take a full screenshot.

 

31. Press Key : 

  • This action is only for Web.
  • This action allows you to use the keyboard keys to press.

32. Dismiss Alert : 

  • This action is for Android, iOS.
    This action is used to dismiss an alert popup using the default value while writing test cases.

 

33. Pull Down To Refresh : 

  • This action is for Android, iOS.
    This action can do a pull to refresh by swiping down from mid of the screen to the bottom of the screen using a specific element.

 

34. Check Ad with Id : 

  • This action is for Android, iOS.
    This action can check any ad with ID using an element.

 

35. Test Functions : 

  • Test Function is a set of commands that performs a specific action. You can create a Test Function for 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 the Update button.

 

 

36. 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

 

 

As simple as that! Happy Testing 😇

 

 

Table of Contents