25.3 Opkey Mobility Keywords
Mobile_GetVisibleTextsOnScreen
This keyword gives all visible Texts of an application visible on Mobile screen.
This keyword is mostly used in a situation where a user wants to know all visible Text visible on Mobile Screen. On executing this keyword all visible Texts of the application displayed on mobile Screen are displayed as Output.
Input Arguments
Object Input Arguments |
Required? |
Object |
no |
Data Input Arguments |
Required? |
Data Input |
no |
Error Conditions
Conditions |
Message |
Debug Info |
No Text Present |
No Text Found |
Example
If you want to get all visible Texts of an application Present on Mobile Screen.
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Keyword Mobile_GetVisibleTextsOnScreen
Output
Learn more about Astro on the Go || Log in || Login with || Sign up || Skip |
All Visible Text of Application present on Mobile Screen are displayed as Output on Execution Result. |
Blank |
If there is no text visible of application on mobile screen. |
Mobile_GetObjectHeight
This keyword returns the Height value of the specified object. This keyword is used in a situation where the user wants to know The Height of Object.
Input Arguments
Object Input Arguments |
Object Required |
Description |
Any Web Element |
Yes |
This Keyword takes one object input argument. You can choose web element whose value you want to get from your Object Repository Tip: You can use OpKey Spy to add web element to Object Repository |
This keyword does not require any data input.
Output
Returns Object Height Value |
If the keyword passes successfully |
Blank |
If object is not provided |
Example
If you want to get the Height value of an object, here is how you will use this keyword –
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Keyword Mobile_GetObjectHeight To Find Height of Astro ID Text Box .
-
Map the object from OR to get the object height.
Error conditions
Conditions |
Message |
Debug Info |
Invalid object |
Done |
–Blank– |
Blank object |
Argument Data Missing |
Data not provided for argument: ‘Object’. |
Mobile_GetObjectWidth
This keyword returns the width value of the specified object. This keyword is used in a situation where the user wants to know The Width of Object.
Input Arguments
Object Input Arguments |
Object Required |
Description |
Any Web Element |
Yes |
This Keyword takes one object input argument. You can choose web element whose value you want to get from your Object Repository Tip: You can use OpKey Spy to add web element to Object Repository |
This keyword does not require any data input.
Output
Returns Object Width Value |
If the keyword passes successfully |
Blank |
If object is not provided |
Example
If you want to get the Height value of an object, here is how you will use this keyword –
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Keyword Mobile_GetObjectWidth To Find Height of Astro ID Text Box.
-
Map the object from OR to get the object height.
Error conditions
Conditions |
Message |
Debug Info |
Invalid object |
Done |
–Blank– |
Blank object |
Argument Data Missing |
Data not provided for argument: ‘Object’. |
Mobile_GetSeekBarValue
This keyword returns the current Seek Bar or Progress Bar value for the specified object. This keyword is used in the below mention situations where user wants to know the Position of seekbar for android Video or Audio player.
Seek Bar allows the user to change the value using touch event/draggable thumb/left right arrow keys. The user can increase the value by dragging the thumb right or by pressing the right arrow key. Similarly, the user can decrease the value by dragging the thumb left or by pressing the left arrow key.
Input Arguments
Object Input Arguments |
Object Required |
Description |
Any Web Element |
Yes |
This Keyword takes one object input argument. You can choose web element whose value you want to get from your Object Repository. Tip: You can use OpKey Spy to add web element to Object Repository |
This keyword does not require any data input.
Output
Returns Integer Type |
If the keyword passes successfully |
Blank |
If object is not provided |
Example
If you want to get the Seek Bar value of an object, here is how you will use this keyword –
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Keyword Mobile_GetSeekarValue to Find the seek bar value of given object.
-
Map the object from OR to get the object height.
Error conditions
Conditions |
Message |
Debug Info |
Invalid object |
||
Blank object |
Argument Data Missing |
Data not provided for argument: ‘Object’. |
Mobile_GetSeekBarMaxValue
This keyword returns the SeekBar or Progress Bar Maximum value for the specified object. This keyword is used in the situations where user wants to know the maximum value of clip length. max attribute in SeekBar define the maximum it can take.
An example of SeekBar is your device’s brightness control and volume control.
Input Arguments
Object Input Arguments |
Object Required |
Description |
Any Web Element |
Yes |
This Keyword takes one object input argument. You can choose web element whose value you want to get from your Object Repository. Tip: You can use OpKey Spy to add web element to Object Repository |
This keyword does not require any data input.
Output
Returns Integer Type |
If the keyword passes successfully |
Blank |
If object is not provided |
Example
If you want to get the SeekBarMax value of an object, here is how you will use this keyword –
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Keyword Mobile_GetSeekarMaxValue to Find the seek bar Max value of given object.
-
Map the object from OR to get the object height.
Error conditions
Conditions |
Message |
Debug Info |
Invalid object |
||
Blank object |
Argument Data Missing |
Data not provided for argument: ‘Object’. |
Mobile_GetSeekBarMinValue
This keyword returns the SeekBar or Progress Bar Minimum value for the specified object. This keyword is used in the situations where user wants to know the Minimum value of clip length.
An example of SeekBar is your device’s brightness control and volume control.
Input Arguments
Object Input Arguments |
Object Required |
Description |
Any Web Element |
Yes |
This Keyword takes one object input argument. You can choose web element whose value you want to get from your Object Repository Tip: You can use OpKey Spy to add web element to Object Repository |
This keyword does not require any data input.
Output
Returns Integer Type |
If the keyword passes successfully |
Blank |
If object is not provided |
Example
If you want to get the SeekBar Min value of an object, here is how you will use this keyword –
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Keyword Mobile_GetSeekarMinValue to Find the seek bar Min value of given object.
-
Map the object from OR to get the seek bar Min value.
Error conditions
Conditions |
Message |
Debug Info |
Invalid object |
||
Blank object |
Argument Data Missing |
Data not provided for argument: ‘Object’. |
Mobile_VerifySeekBarValue
This Keyword is used to verify value of Seekbar for object taken in object Input Argument and Value given in data Input Argument is correct or incorrect with the actual value of Seekbar and accordingly true or False is displayed in output of Execution Result.
This keyword is used in the situations where user wants to verify seekbar value entered by user in TC for an object is same as that was extracted by using keyword Mobile_GetSeekbarVlaue.
Input Arguments
Object Input Arguments |
Object Required |
Description |
SeekBar element |
Yes |
This Keyword takes one object input argument. You can choose edit box to be verified from your Object Repository Tip: You can use OpKey Spy to add edit box to Object Repository |
Data Input Arguments |
Data Required |
Description |
Expected Value |
Yes |
Specify the value to be verified |
Output
True |
If the Expected and Actual value are equal |
False |
If Actual Value and Expected Value are different |
Example
In the example above, if you want to verify SeekBar value, here is how you will use this keyword –
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Keyword Mobile_GetSeekbarValue to find the actual seekbar value of given object.
-
Map the object from OR to get the Actual value of SeekBar.
-
Use Keyword Mobile_VerifyseekbarValue to verify the actual value of given object with the Expected value entered in DataInputArgument.
Error conditions
Conditions |
Message |
Debug Info |
Valid object, Invalid data |
Verification Failed |
Actual Value x Expected Value y |
Invalid object, Valid data |
||
Blank object, Valid data |
||
Blank object and No data |
Argument Data Missing |
Data not provided for argument: ‘Object’. |
Mobile_VerifySeekBarMaxValue
This Keyword is used to verify maximum value of Seekbar. This Keyword is used in a situation where user wants to verify Maximum value of seekbar entered by user in DataInputArgument is correct or Incorrect with the Actual Maximum length of Seekbar.
Input Arguments
Object Input Arguments |
Object Required |
Description |
SeekBar element |
Yes |
This Keyword takes one object input argument. You can choose edit box to be verified from your Object Repository Tip: You can use OpKey Spy to add edit box to Object Repository |
Data Input Arguments |
Data Required |
Description |
Expected Value |
Yes |
Specify the value to be verified |
Output
True |
If the Expected and Actual value are equal |
False |
If Actual Value and Expected Value are different |
Example
In the example above, if you want to verify SeekBar Maxvalue, here is how you will use this keyword –
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Keyword Mobile_GetSeekbarMaxValue to find the actual seekbar value of given object.
-
Map the object from OR to get the Actual value of SeekBar.
-
Use Keyword Mobile_VerifyseekbarMaxValue to verify the actual value of given object with the Expected value entered in DataInputArgument.
Error conditions
Conditions |
Message |
Debug Info |
Valid object, Invalid data |
Verification Failed |
Actual Value x Expected Value y |
Invalid object, Valid data |
||
Blank object, Valid data |
. |
|
Blank object and No data |
Argument Data Missing |
Data not provided for argument: ‘Object’. |
Mobile_VerifySeekBarMinValue
This Keyword is used to verify minimum value of Seekbar. This Keyword is used in a situation where user wants to verify Minimum value of seekbar entered by user in DataInputArgument is correct or Incorrect with the Actual Minimum value of Seekbar.
Input Arguments
Object Input Arguments |
Object Required |
Description |
SeekBar element |
Yes |
This Keyword takes one object input argument. You can choose edit box to be verified from your Object Repository Tip: You can use OpKey Spy to add edit box to Object Repository |
Data Input Arguments |
Data Required |
Description |
Expected Value |
Yes |
Specify the value to be verified |
Output
True |
If the Expected and Actual value are equal |
False |
If Actual Value and Expected Value are different |
Example
In the example above, if you want to verify SeekBar Maxvalue, here is how you will use this keyword –
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Keyword Mobile_GetSeekbarMinValue to find the actual seekbar value of given object.
-
Map the object from OR to get the Actual value of SeekBar.
-
Use Keyword Mobile_VerifyseekbarMinValue to verify the actual value of given object with the Expected value entered in DataInputArgument.
Error conditions
Conditions |
Message |
Debug Info |
Valid object, Invalid data |
Verification Failed |
Actual Value x Expected Value y |
Invalid object, Valid data |
||
Blank object, Valid data |
. |
|
Blank object and No data |
Argument Data Missing |
Data not provided for argument: ‘Object’. |
Mobile_VerifyTextOnScreen
This Keyword takes text as DataInput Argument and verifies whether Text is present on mobile screen or Not, and Returns output as True or False accordingly.
This keyword is mostly used in a situations where user wants to verify Text is visible on Mobile Screen or Not.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Data Required |
Description |
Expected Value |
Yes |
Specify the value to be verified |
Output
True |
If the Expected and Actual value are equal |
False |
If Actual Value and Expected Value are different |
Example
If you want to verify Text of an application Present on Mobile Screen.
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Keyword Mobile_VerifyTextOnScreen and enter Text in DataInputArgument.
Error conditions
Conditions |
Message |
Debug Info |
Invalid Text |
Verification failed |
Fail |
Blank Text |
Argument Data Invalid |
Mobile_RunADBCommand
This keyword is used to run the adb command. It takes ADB command as Data Input Argument.The adb command facilitates a variety of device actions, such as installing and debugging apps.
To use adb with a device connected over USB, you must enable USB debugging in the device system settings, under Developer options.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Data Required |
Description |
ADB Commands |
Yes |
Enter ADB Command |
Output
Event Performed |
If correct ADB command is entered |
Example
If you want to Run ADB command Mobile_RunADBCommand.
-
Use Mobile_LaunchAndroidApplication and Give Device name and application Name Respectively in Data Input Argument.
-
Use Mobile_RunADBCommand and Enter Command in Data Input Argument under Provide Data Field
-
To Press Home Button of connected device Enter ADB Command as Shell input Keyevent3.
Error conditions
Conditions |
Message |
Debug Info |
Invalid Command |
Done |
|
Blank |
Done |
Mobile_Done
This keyword clicks on Done key on mobile device keyboard. This keyword is mostly used in situations where you want to access the mobile device keyboard Done key for moving from one field to another.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and Application not selected |
Example
If user wants to click on Done key on the Mobile Device Keyboard without recording it, use Mobile_Done keyword.
Mobile_Enter
This keyword clicks on Enter key on mobile device keyboard. This keyword is mostly used in situations where you want to access the mobile device keyboard’s Enter key for moving from one line to another.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and Application not selected |
Example
If user wants to click on Enter key on the Mobile Device Keyboard without recording it, use Mobile_Enter keyword.
Mobile_Go
This keyword clicks on Go Key on mobile device keyboard. This keyword is mostly used in situations where you want to redirect to the next page or you want to move from one field to another.
It depends upon the functionality of the application.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and Application not selected |
Example
If user wants to click on Go key on the Mobile Device Keyboard without recording it, use Mobile_Go keyword.
Mobile_Next
This keyword clicks on Next Key on mobile device keyboard. This keyword is mostly used in situations where you want to move from one field to another.
It depends upon the functionality of the application.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and Application not selected |
Example
If user wants to click on Next key on the Mobile Device Keyboard without recording it, use Mobile_Next keyword.
Mobile_ClickByText
This keyword is used to click on the matching text. It takes Text to be clicked, index number(index no starts from 0) and Contains Text (By Default false) as Data Input Argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Description |
Text |
Yes |
* It is of String type. * It takes Text to be clicked. |
Index |
Yes |
* It is of Integer type. * It takes the index no. of the Text to be clicked and if no index no is given, it will take 0 index no. * Index number specifies the index at which the text is present. * It starts from 0 if the Text present on screen is not repeatable. |
Contains Text |
Yes |
* It is of Boolean type. * By default it is false. * If you want to click on a text by giving partial text in the Text Argument, then you have to change Contains Text argument to True. * If you want to click on a Text by giving exactly the same text in the Text Argument, then you have to keep Contains Text argument as False. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Blank Text |
Argument Data Missing |
—- |
Invalid Text |
Text Not Found |
Fail |
Wrong Index is given |
Text Not Found |
Fail |
Device and Application not selected |
Example
CASE I: If you want to click on LOG IN button, then use Mobile_ClickByText. keyword.
In this case, LOG IN button will be clicked.
CASE II: If you want to click on SIGN UP button by changing the Contains Text argument, the use Mobile_ClickByText keyword.
In this case, SIGN UP button will be clicked.
Mobile_CloseAndUninstall
This keyword is used for Closing and then Uninstalling the mobile application from the mobile device.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
If device and application is not selected. |
Mobile_LaunchAndroidApplication
This keyword is used to Install and Launch any android mobile application. If the android application is already installed on the mobile device, it will uninstall the android application and then install and launch the application.
Input Arguments
Object Input Arguments |
Required? |
Object |
no |
Data Input Arguments |
Required? |
Description |
Device |
Yes |
It takes the Android Mobile Device on which a particular script should be run. |
Application |
Yes |
It takes the Android Application which is to be installed and launched on Android Mobile Device. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and Application is not selected |
Argument Data Missing |
Data not provided for argument: ‘Device’ & ‘Application’ |
Device Selected, Application not Selected. |
Argument Data Missing |
Data not provided for argument: ‘Application’ |
Device not Selected, Application Selected. |
Argument Data Missing |
Data not provided for argument: ‘Device’ |
Wrong Device Selected, Application Selected |
Example
Mobile_LaunchApplication
This keyword is used to Launch the already installed mobile application that the user wants to Launch. If the mobile application is already installed on the mobile device, it will directly launch the application without uninstalling it.
If the mobile application is not present on the Mobile Device, it will install the application and then launch the mobile application.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Description |
Device |
Yes |
It takes Mobile Device on which a particular script should be run. |
Application |
Yes |
It takes Application which is to be launched on Mobile Device. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and Application is not selected |
Argument Data Missing |
Data not provided for argument: ‘Device’ & ‘Application’ |
Device Selected, Application not Selected. |
Argument Data Missing |
Data not provided for argument: ‘Application’ |
Device not Selected, Application Selected. |
Argument Data Missing |
Data not provided for argument: ‘Device’ |
Wrong Device Selected, Application Selected |
Example
Mobile_CloseApplication
This keyword is used for Closing and then Uninstalling the mobile application from the mobile device. It doesn’t take any object/data input argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
If device and application is not selected. |
Mobile_LongPress
This keyword is used to LongPress on the objects that are Long-Clickable. It takes object to be long-clicked as Object Input Argument and duration (in Seconds) as Data Input Argument.
By default it will long-click/press the object for 3 seconds.
Input Arguments
Object Input Arguments |
Required? |
Description |
Object |
Yes |
It takes the object that is long-clickable. |
Data Input Arguments |
Required? |
Description |
Duration |
Yes |
* It is of Integer type. * It takes the time in seconds. * If the Duration argument is kept empty, By default it will long-click/press the object for 3 seconds. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Object and duration not provided. |
Argument Data Missing |
Data not provided for argument: ‘Object’ |
Object not given, Duration given |
Argument Data Missing |
Data not provided for argument: ‘Object’ |
Invalid Object, Valid Duration |
Object Not Found |
—- |
Application and Device not selected |
Example
The above highlighted object is long-clickable. If you want to LongPress this object, use Mobile_LongPress keyword.
* Provide the Valid Object which is Long-Clickable as Object Input Argument.
* Provide the Duration in seconds (by default it will long-press the valid object for 3 seconds) for the valid object which is Long-Clickable as Data Input Argument.
Mobile_SwitchBluetooth
This keyword is used to Switch ON or OFF the Mobile device Bluetooth. It takes status (ON or OFF | on or off) as Data Input Argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Description |
Status |
Yes |
* It is of String type. * It takes ON|OFF|on|off as Status argument to Switch ON/ OFF Mobile Device Bluetooth. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Status not given |
Argument Data Missing |
—- |
Invalid Status |
Argument Data Invalid |
—- |
If bluetooth is already ON and user ON it again |
Bluetooth is already ON |
—- |
If bluetooth is already OFF and user OFF it again |
Bluetooth is already OFF |
—- |
Device and Application not selected. |
Example
CASE I: If you want to switch on Mobile Device Bluetooth, use Mobile_SwitchBluetooth keyword with Status = ON|on.
CASE II: If you want to switch off Mobile Device’s Bluetooth, use Mobile_SwitchBluetooth keyword with Status = OFF|off.
Mobile_SwitchWifi
This keyword is used to Switch ON or OFF the Mobile device Wifi. It takes status (ON or OFF | on or off) as Data Input Argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Description |
Status |
Yes |
* It is of String type. * It takes ON|OFF|on|off as Status argument to Switch ON/ OFF Mobile Device Wifi. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Status not given |
Argument Data Missing |
—- |
Invalid Status |
Argument Data Invalid |
—- |
If Wifi is already ON and user ON it again |
Wifi is already ON |
—- |
If Wifi is already OFF and user OFF it again |
Wifi is already OFF |
—- |
Device and Application not selected. |
Example
CASE I: If you want to switch on Mobile Device Wifi, use Mobile_SwitchWifi keyword with Status = ON|on.
CASE II: If you want to switch OFF Mobile Device Wifi, use Mobile_SwitchWifi keyword with Status = OFF|of.
Mobile_SwitchAirplaneMode
This keyword is used to Switch ON or OFF the Mobile device Airplane Mode. It takes Value (ON|OFF or on|off) as Data Input Argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Description |
Status |
Yes |
* It is of String type. * It takes ON|OFF|on|off as Value argument to Switch ON/OFF Mobile Device Airplane Mode. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Value not given |
Argument Data Missing |
—- |
Invalid Value |
Argument Data Invalid |
—- |
If AirplaneMode is already ON and user ON it again |
Airplane Mode is already ON |
—- |
If AirplaneMode is already OFF and user OFF it again |
Airplane Mode is already OFF |
—- |
Device and Application not selected. |
Example
CASE I: If you want to switch on Mobile Device Airplane Mode, use Mobile_SwitchAirplaneMode keyword with Status = ON|on|On.
CASE II: If you want to switch off Mobile Device Airplane Mode, use Mobile_SwitchAirplaneMode keyword with Status = OFF|off|Of.
Mobile_SwitchMobileData
This keyword is used to Switch ON or OFF the Mobile device mobile data. It takes Value (ON|OFF or on|off) as Data Input Argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Description |
Status |
Yes |
* It is of String type. * It takes ON|OFF|on|off as Value argument to Switch ON/OFF Mobile Device mobile data. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Value not given |
Argument Data Missing |
—- |
Invalid Value |
Argument Data Invalid |
—- |
If Mobile Data is already ON and user ON it again |
Mobile Data is already ON |
—- |
If Mobile Data is already OFF and user OFF it again |
Mobile Data is already OFF |
—- |
Device and Application not selected. |
Example
CASE I: If you want to switch on Mobile Device Mobile Data, use Mobile_SwitchMobileData keyword with Status = ON|on|On.
CASE II: If you want to switch off Mobile Device Mobile Data, use Mobile_SwitchMobileData keyword with Status = OFF|off|Of.
Mobile_SwipeTowards
This keyword is used to Swipe in different directions on the mobile screen. It takes direction ( left|right|up|down or LEFT|RIGHT|UP|DOWN or Left|Right|Up|Down ) as Data Input Argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Description |
Direction |
Yes |
* It is of String type. * It takes Direction argument which is used to perform swipe actions on the Mobile Device. * Direction can be up|UP or down|DOWN or left|LEFT or right|Right. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Direction not given |
Argument Data Missing |
—- |
Invalid Direction |
Argument Data Invalid |
—- |
Device and Application not selected. |
Example
CASE I: If you want to Swipe upwards on Mobile Device, use Mobile_SwipeTowards keyword with Direction = UP|up|Up.
CASE II: If you want to Swipe downwards on Mobile Device, use Mobile_SwipeTowards keyword with Direction = DOWN|down|Down.
CASE III: If you want to Swipe left on Mobile Device, use Mobile_SwipeTowards keyword with Direction = LEFT|left|Left.
CASE IV: If you want to Swipe right on Mobile Device, use Mobile_SwipeTowards keyword with Direction = RIGHT|right|Right.
Mobile_SwipeOnObject
This keyword is used to Swipe on particular object of an Application. It takes object as Object Input Argument and Direction ( left|right|up|down or LEFT|RIGHT|UP|DOWN) as Data Input Argument.
Input Arguments
Object Input Arguments |
Required? |
Description |
Object |
Yes |
It takes the object on which swipe actions need to be performed. |
Data Input Arguments |
Required? |
Description |
Direction |
Yes |
* It is of String type. * It takes Direction argument which is used to perform swipe actions on the Mobile Device. * Direction can be up|UP or down|DOWN or left|LEFT or right|Right. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Object not given, Direction not given |
Argument Data Missing |
Data not provided for argument: ‘Object’ & ‘Direction’ |
Object not given, Direction given |
Argument Data Missing |
Data not provided for argument: ‘Object’ |
Object given, Direction not given |
Argument Data Missing |
Data not provided for argument: ‘Direction’ |
Invalid Object given, Direction given |
Object Not Found |
—- |
Invalid Object given, Direction not given |
Object Not Found |
—- |
Device and Application not selected. |
Example
If you want to Swipe on the above highlighted object, use Mobile_SwipeOnObject Keyword by giving the object to be swiped and direction.
Direction can be Left|Right|Up|Down.
Mobile_SwipeToText
This keyword is used to Swipe to a particular Text. It takes Text to be swiped, index number (index number starts from 0) and Contains Text (By Default false) as Data Input Argument.
This keyword is used in situations where the text is not visible on the screen.
It swipes only in upwards or downwards direction.
Input Arguments
Object Input Arguments |
Required? |
Object |
no |
Data Input Arguments |
Required? |
Description |
Text |
Yes |
* It is of String type. *It takes Text upto which swipe action (Up/down) needs to be performed. |
Index |
Yes |
* It is of Integer type. * It takes the index no. of the Text to be swiped and if no index no is given, it will take 0 index no. * Index number specifies the index at which the text is present. * It starts from 0 if the Text present on screen is not repeatable. |
Contains Text |
Yes |
* It is of Boolean type. * By default it is false. * If you want to Swipe to text by giving partial text in the Text Argument, then you have to change Contains Text argument to True. * If you want to Swipe to text by giving exactly the same text in the Text Argument, then you have to keep Contains Text argument as False. |
Error Conditions
Conditions |
Message |
Debug Info |
Blank Text |
Argument Data Missing |
—- |
Invalid Text |
Text Not Found |
Fail |
Wrong Index is given |
Text Not Found |
Fail |
Device and Application not selected |
Example
CASE I: If the above highlighted text “Smartlight” is not visible on the screen and user wants to Swipe to the text Smartlight, then use Mobile_SwipeToText keyword.
In this case, user will be able to swipe to the text “Smartlight”
CASE II: If the above highlighted text “Lucid dreaming” is not visible on the screen and user wants to Swipe to the text “Lucid dreaming” by only entering partial characters, then use Mobile_SwipeToText keyword.
In this case, user will be able to swipe to the text “Lucid dreaming”
Mobile_SwipeToObject
This keyword is used to Swipe to a particular Object. It takes the object to be swiped as Object Input Argument. This keyword is used in situations where the object is not visible on the screen.
It swipes only in upwards or downwards direction.
Input Arguments
Object Input Arguments |
Required? |
Description |
Object |
Yes |
* It takes the object upto which swipe actions (up/down) needs to be performed. |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Object not given |
Argument Data Missing |
Data not provided for argument: ‘Object’ |
Wrong Object is given |
Object Not Found |
—- |
Device and Application not selected. |
Example
CASE I: If the above highlighted object “Smartlight” is not visible on the screen and user wants to Swipe to the object Smartlight, then use Mobile_SwipeToObject keyword.
In this case, user will be able to Swipe to the Object “Smartlight”
Mobile_SelectByText
This keyword is used to select/click the matching text. It takes Text to be select/clicked as Data Input Argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Description |
Text |
Yes |
* It is of String type. *It takes Text to be clicked/selected. |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Blank Text |
Argument Data Missing |
—- |
Invalid Text |
Text Not Found |
Fail |
Device and Application not selected |
Example
CASE I: If you want to click/select LOG IN button, then use Mobile_SelectByText keyword.
In this case, LOG IN button will be selected/clicked.
Mobile_RelaunchCurrentApplication
This keyword is used to relaunch the current application which is open in the background or present on the device which is minimised for some reason. This keyword relaunches that application which was given in the Mobile_LaunchAndroidApplication or Mobile_LaunchApplication keyword.
Note: Make sure that you will use Mobile_LaunchAndroidApplication or Mobile_LaunchApplication keyword before Mobile_RelaunchCurrentApplication keyword.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and application not selected. |
Example
If you want to restore/relaunch above highlighted “Sleep Application”, then:
* Make sure that you will use Mobile_LaunchAndroidApplication or Mobile_LaunchApplication keyword before Mobile_RelaunchCurrentApplication keyword.
* Add Mobile_RelaunchCurrentApplication keyword.
* The above “Sleep Application” which is minimised for some reason will be Relaunched.
Mobile_MediaNext
This keyword is used to click on next button in Android Media Player. This keyword is used in situations where user wants to change or move to the next audio or video in the Android Media Player.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and application not selected. |
Example
If you want to go to the next audio or video in the Android Media Player without recording it, use Mobile_MediaNext Keyword.
Mobile_MediaPrevious
This keyword is used to click on Previous button in Android Media Player. This keyword is used in situations where user wants to change or move to the previous audio or video in the Android Media Player.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and application not selected. |
Example
If you want to go back to the Previous audio or video in the Android Media Player without recording it, use Mobile_MediaPrevious Keyword.
Mobile_MediaPause
This keyword is used to click on Pause button in Android Media Player. This keyword is used in situations where user wants to Pause any audio or video in the Android Media Player.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and application not selected. |
Example
If you want to Pause any audio or video in the Android Media Player without recording it, use Mobile_MediaPause Keyword.
Mobile_MediaPlay
This keyword is used to click on Play button in Android Media Player. This keyword is used in situations where user wants to Play any audio or video in the Android Media Player.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and application not selected. |
Example
If you want to Play any audio or video in the Android Media Player without recording it, use Mobile_MediaPlay Keyword.
Mobile_VolumeDown
This keyword is used to decrease the media volume in any Android Mobile Device. It doesn’t take any object/data input argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and application not selected. |
Example
If you want to decrease the above-highlighted media volume in any Android Mobile Device without recording it, use Mobile_VoulumeDown Keyword.
Mobile_VolumeUp
This keyword is used to increase the media volume in any Android Mobile Device. It doesn’t take any object/data input argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and application not selected. |
Example
If you want to increase the above highlighted media volume in any Android Mobile Device without recording it, use Mobile_VoulumeUp Keyword.
Mobile_VolumeMute
This keyword is used to mute the media volume in any Android Mobile Device. This keyword is used to increase the media volume in any Android Mobile Device. It doesn’t take any object/data input argument.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and application not selected. |
Example
If you want to mute the above-highlighted media volume in any Android Mobile Device without recording it, use Mobile_VoulumeMute Keyword.
Mobile_MediaForward
This keyword is used to click on forward button in Android Media Player. This keyword is used in situations where user wants to forward any audio or video in the Android Media Player.
Input Arguments
Object Input Arguments |
Required? |
Object |
No |
Data Input Arguments |
Required? |
Data Input |
No |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
Device and application not selected. |
Example
LoadOpKeyMobility
This keyword is used to load the OpKey Mobility plugin at runtime during the Test Execution. This keyword is generally used when you have a Test Case which has all Generic keywords along with few Mobility keywords which are OpKey Mobility specific. This keyword is doesn’t take any object or data input argument.
Scenario:
Suppose there is a Test Case which has both web & mobile test steps. In such case, you need to load both plugins (web & OpKey Mobility plugins) at runtime so that they can be used for executing respective test steps, as required.
You need to add this keyword (LoadOpKeyMobility) with a test step, save the test case and then click on Run Now. It will take few moments to load the required plugins (as per the added test steps). There will be a popup message regarding the loaded plugins which will be used for executing the test case.
Input Arguments
Object Input Arguments |
Required? |
Object |
no |
Data Input Arguments |
Required? |
Data Input |
no |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
When keyword “LoadOpKeyMobility” is not added to the Test Step. |
Plugin Not Loaded (-9902100) DESCRIPTION: A plugin was not loaded at the execution site. This might happen if the plugin was used in authoring a test but was not installed on the machine where the actual execution took place. Even an installed plugin might fail if its dependencies are not properly installed. |
Oops! Seems like ‘OpKeyMobility’ is not added in your package or not installed with the agent. Kindly contact OpKey Support Team at support@opkey.com for assistance. |
Example
LoadAppium
This keyword is used to load the Appium plugin at runtime during the Test Execution. This keyword is generally used when you have a Test Case which has all Generic keywords along with few Appium keywords which are Appium specific. This keyword is doesn’t take any object or data input argument.
Scenario:
Suppose there is a Test Case which has both web & mobile test steps. In such case, you need to load both plugins (web & Appium plugins) at runtime so that they can be used for executing respective test steps, as required.
You need to add this keyword (LoadAppium) with a test step, save the test case and then click on Run Now. It will take few moments to load the required plugins (as per the added test steps). There will be a popup message regarding the loaded plugins which will be used for executing the test case.
Input Arguments
Object Input Arguments |
Required? |
Object |
no |
Data Input Arguments |
Required? |
Data Input |
no |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
When keyword “LoadAppium” is not added to the Test Step. |
Oops! Seems like ‘OpKeyMobility’ is not added in your package or not installed with the agent. Kindly contact OpKey Support Team at support@opkey.com for assistance. |
Oops! Seems like ‘Appium’ is not added in your package or not installed with the agent. Kindly contact OpKey Support Team at support@opkey.com for assistance. |
Example
Mobile_SwitchGPS
This keyword is used to switch the status of the locally connected mobile device. It ensures the GPS status of the connected mobile device as per the given status ON or OFF.
Scenario:
Suppose the current status of the connected mobile device is ON and you have provided OFF then it will GPS status OFF. If the current status of the connected mobile device is ON and you have provided ON as data input argument then it will check current status and verify Yes as current GPS status is ON.
If the current status of the connected mobile device is OFF and you have provided ON then it will GPS status ON. If the current status of the connected mobile device is OFF and you have provided FF as data input argument then it will check current status and verify Yes as current GPS status is OFF.
Input Arguments
Object Input Arguments |
Required? |
Object |
no |
Data Input Arguments |
Required? |
Data Input |
Yes (ON/OFF) |
Output
True |
If the keyword passes successfully |
False |
If there is an error |
Error Conditions
Conditions |
Message |
Debug Info |
When data input argument is Not Given (i.e. Blank) |
Argument Data Missing (-13200) |
One or more of the arguments have not been provided a value. |
Example