Header

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Mobile.DragAndDropToObject

This action drags the specified mobile object and drops on another specified mobile object. 
Input Parameters:

Parameter NaneParameter DescriptionMandatoryData Type
dragLocatorThe locator value of the mobile element you want to drag.YesString
dragLocatorTypeThe locator type of mobile element you want to drag.YesString
dropToLocatorThe locator value of the mobile element on which you want to drop.YesString
dropToLocatorTypeThe locator type of the mobile element on which you want to drop.YesString
Example:
Mobile.DragAndDropToObject  dragLocator    dragLocatorType    dropToLocator    dropToLocatorType

Mobile.CloseApp

This action closes the specified application or mobile browser.

This action does not have any parameter.

As the mobile app is closed, you cannot have any mobile action after the step containing this action.

Example:
Mobile.CloseApp

Mobile.HideKeyboard

This action hides the keyboard if present on the screen.

Parameters mentioned below are applicable for iOS only. 

For Android, parameters are not required and ignored if provided.

Input Parameters:

ParameterName

Parameter Description

Mandatory

Data Type

Strategy

Enter the strategy to hide the keyboard. Value for this parameter can be pressKeys and tapOutside.

No

String

KeyNameEnter the text that is displayed on the button of the keyboard you want to press to hide keyboard.NoString


Example:
Mobile.HideKeyboard                       "Tap_Outside"         "Done"

Mobile.OpenApp

This action launches native/hybrid mobile Android or iOS application on the mobile device (emulator or physical). If the app does not exist in the device, this action will take the APK/ IPA file path specified and install it on the device before launching it.

Input Parameters:

Parameter Name

Parameter Description

Mandatory

Data Type

Android APK Path / iOS IPA Path

Enter the absolute path of the apk/app/ipa file. This path should be accessible to the system where Appium server is installed.

No

String

Android Package / iOS BundleID

Enter the package name of the Android app or bundle ID of the iOS app.

Yes

String

Android Activity

Enter the activity name of the Android app. For iOS, enter as Dummy Activity Name.

Yes 

String

Example:

Mobile.OpenApp                         "D:\myapp.apk"            "com.app.package"                  "com.app.package.MainActivity"

Mobile.PressAt

This action clicks at the specified point on the device screen.

Parameter Name
Parameter Description
Mandatory
Data Type
XThe x-coordinate  value of the specified point on the screen.NoString
YThe y-coordinate value of the specified point on the screen.NoString

Example

Mobile.PressAt  "5"   "10"

Mobile.PressHomeButton

This action opens the home screen of the device. 

This action does not have any parameter.

Example:
Mobile.PressHomeButton

Mobile.PressRecentsButton

This action shows the recent application.

This action does not have any parameter.

Note: This action is not supported on the iOS platform.

Example:
Mobile.PressRecentsButton


Mobile.SwitchApp

This action launches new native/hybrid mobile Android or iOS application to which you want to switch from the already launched native/hybrid mobile application.

Input Parameters:

Parameter Name

Parameter Description

Mandatory

Package 

Package Name

Enter the package name of the Android app or bundle ID of the iOS app.

No

String

ActivityName

Enter the activity name of the Android app. For iOS, enter as Dummy Activity Name.

No

String

Example:

Mobile.SwitchApp               "com.app.package"                  "com.app.package.MainActivity"


SwitchWebExecutionPlatform

This action changes the current Web execution platform from Desktop to Mobile or from Mobile to Desktop. When used, web application test case will run on specified platform.

Input Parameters:

Parameter Name

Parameter Description

Mandatory

Data Type

Platform

Platform to run web application on. Supported platforms are "Desktop" and "Mobile".

Yes

 String

Example:

SwitchWebExecutionPlatform                        "Mobile"

Mobile.PressBackButton

This action taps back button on the Mobile device.

This action is supported for Android only. 

This action does not have any parameter.

Example:
Mobile.PressBackButton

Mobile.StoreWebViewHandle

This action stores the web view handle under the specified key. The key value can be retrieved using the key name.

Input Parameters:

ParameterName

Parameter Description

Mandatory

Data Type

key

Enter the key under which you want to store the web view handle.

Yes

String


Example:
Mobile.StoreWebViewHandle                       "Key"

Mobile.SelectWebView

This action selects the web view present in the current page hybrid app. If key is provided (by using StoreWebViewHandle action), system selects the webview specified in key. If key is not provided, default webview will be selected.

Input Parameters:

Parameter Name

Parameter Description

Mandatory

Data Type

Key

enter the key used in the action "StoreWebViewHandle".

No

String


Example:
Mobile.SelectWebView             "Key"

Mobile.SelectNativeContext

This action can be used to select native context from the hybrid app. 

This action does not have any parameter.

Example:
Mobile.SelectNativeContext

Mobile.SelectWebViewUsingURL

This action selects the web view using the URL or pattern specified in the parameters.

Input Parameters:

ParameterName

Parameter Description

Mandatory

Data Type

URL

Enter the URL to open.

No

String

IsURLPattern

Specify whether the URL is patterned or not.
Value of this parameter can be True or False.

NoString

Example:

Mobile.SelectWebviewUsingURL                      "www.google.com"                    "False"

Mobile.PressKeys

This action presses the specified keys using the mobile keyboard.

This action can be used when working with Android applications. 

Input Parameters:

Parameter Name

Parameter Description

Mandatory

Data Type

keyName

Enter the key to be pressed. For more information, click here.

Yes

String

modifierKeyName

Enter Modifier (Meta State) key to press. Generally used for combination of keys such as Shift, Ctrl, and so on. For more information, click here.

NoString


Example:

Mobile.Presskeys “F”

Mobile.Presskeys “CAP_LOCKED”


Mobile.Swipe

This action performs swipe based on the coordinates provided in the parameters.

Input Parameters:

ParameterName

Parameter Description

Mandatory

Data Type

startX

Enter the starting point in x-axis from where you want to start the swipe.

Yes

String

startYEnter the starting point in y-axis from where you want to start the swipe.YesString
endXEnter the starting point in x-axis from where you want to stop the swipe.YesString
endYEnter the starting point in y-axis from where you want to stop the swipe.Yes String

duration

Enter the duration seconds for the action to perform 

No

String

Example:

Mobile.Swipe                  "100"          "123"         "145"             "121"            "1"

Mobile.OpenNotification

A notification is a message at the device level against the application and stored in the notification panel.

This action pulls down the notification panel on Android and iOS device. It does not have any parameters.

Example:

Mobile.OpenNotification

Mobile.VerifyToast

A toast provides simple feedback about an operation in a small popup.

This action verifies whether the toast message matches the text provided in the action parameter. The match can either be a partial or an exact match. Currently, this action is supported only on the Android platform.

This parameter is mandatory.


Parameter NameParameter DescriptionMandatoryData Type

matchText

The toast message, which is expected to display.

Yes

String

Example:

Mobile.VerifyToast       "Success"

  • No labels