Key words |
Usage description |
Close Application |
Close the currently open app application, which does not need to receive any parameters, but the keyword is used if an app application has been opened. |
Close All applications |
Close all app application that are currently open, and the keyword does not need to receive any parameters. |
Background App |
Let the current app application run in the background, this keyword receives a parameter [time of the background run], example:
|
Capture Page screenshot |
Gets the current page, if no parameters are passed to the keyword, it will be named Appium-screenshot-<counter>.png by default and saved to Robotframework's run log directory. When a case fails to run, it is often necessary to save to assist locating and analyzing. |
Set Appium Timeout |
Sets the time-out period for Appium, which receives a parameter [time-out duration, in seconds] |
Get Appium Timeout |
Gets the time-out period used by different keywords. |
Go back |
Returns to the browser's previous action step, equivalent to the browser's Back button function. |
Go to Ur |
Opens a URL address on the default browser that receives a parameter [url to open] |
Hide Keyboard |
To hide the keyboard of the current operating device, it is important to note that when this keyword is executed on an Android phone, you can use ' key_name ' to press a specific key when performing on an iOS phone. |
Input Password |
This keyword is basically the same as the input text keyword, except that the input password is not recorded in the log when the keyword is used. |
Input Value |
This keyword only applies to iOS devices and can receive two parameters [locator | text] |
Lock |
Lock your phone device |
Long Press |
This keyword is used to simulate a long press of an element of the app interface that receives a parameter [locator] |
Long Press KeyCode |
This keyword is used to simulate long pressing a key on a mobile device, receiving two parameters [KeyCode | metastate=none], note that the keyword is only available on Android devices |
Press KeyCode |
This keyword applies only to Android devices and simulates the operation of keystrokes on the keyboard. The keyword receives two parameters [KeyCode | metastate=none], such as the analog CTRL or ALT key. |
Pull File |
This keyword is used to pull a file from the phone device, which receives two parameters [path | decode=false],path parameter refers to the path of the file on the device, the decode parameter refers to whether to decode according to Base64, the default is False. |
Pull Folder |
This keyword is similar to the pull file keyword usage, which receives two parameters [path | decode=false],path parameter refers to the path of the file on the device, the decode parameter refers to whether it is decoded according to Base64, and the default is False. |
Push File |
The feature of this keyword, in contrast to the pull file keyword, is used to upload a file to a mobile device, which receives three parameters [path | data | Encode=false],path parameter refers to the path of the device, and the DAT parameter refers to the file to be passed to the device. The decode parameter refers to whether the code is encoded according to Base64, and the default is False. |
Remove Application |
The keyword is used to remove application on the device, which receives a parameter [application_id], as an example:
Remove Application |
Com.example.calculator |
|
Register Keyword to Run on Failure |
This keyword is used to implement which keyword is required when a case execution fails. Example:
Register Keyword to Run on Failure |
Log Source |
|
Scroll |
This keyword simulates the screen scrolling or sliding, which receives two parameters [Start_locator | end_locator], which simulates sliding from one element to another. |
Scroll to |
This keyword is similar to the scroll keyword. But the keyword receives only one parameter [locator] |
Shake |
This keyword is used to simulate shaking a mobile device. |
Swipe |
Analog phone slide, swipe from one point to another, the keyword receives 5 parameters [start_x | start_y | end_x | end_y | duration=1000], when sliding, the position of the point is in the form of coordinates. |
Tap |
This keyword simulates clicking on a screen element and receiving a parameter [locator] |
Zoom |
This keyword is used to magnify an element and receive three parameters [Locator | percent=200% | steps=1], the first parameter is the way to position the element, the second parameter is the magnification percentage, and if you do not pass in the parameter, the default magnification is twice times. |