Gives the ability to create and run scripts that are based on the Native API methods available for the class of the element.
Gives the ability to create and run scripts that are based on the Native API methods available for the class of the element. |
Note: This command will work only on instrumented applications. |
Name | Value | Description |
---|---|---|
Zone | String with valid values as
| Select Zone |
Element | Integer | Select Element (should use xPath) |
Index | Integer | Element index |
Script | String | The Native API script that will run on the identified element |
Command be used to run scripts based on Native API call. See the example below.
Set Experitest Url Please make sure you replace <EXPERITEST_URL> with appropriate URL in the code snippet below.
|
Example
Consider a video element identified by id named 'video_view'.
If there is script to,
then this command can be used to execute the script such that all actions above can be performed.
DesiredCapabilities dc = new DesiredCapabilities(); driver = new AndroidDriver(new URL("<EXPERITEST_URL>"), dc); seetest = new SeeTestClient(driver); dc.setCapability(MobileCapabilityType.UDID, "<deviceid>"); ... ... // Run the script on the element identified by "xpath=//*[@id='video_view']" seetest.runNativeAPICall("NATIVE", "xpath=//*[@id='video_view']", 0, "view.pause(); var length = view.getDuration(); length = length*0.9; view.seekTo(length);"); |