Page tree
Skip to end of metadata
Go to start of metadata



HybridRunJavascript(WebViewLocator, Index, Script)

Supported in iOS Supported in Android

Description

Run Javascript in a WebView.

Parameters

  • WebViewLocator - WebView locator string like id=web or empty for the first WebView in page - will be Empty
  • SeeTestAutomation- Index - Element index - will be set to 0
  • Script - Javascript (if you would like the command to return a value - just enter result=<javascript>) - will be set to var result = document.cookie;

Usage

Scenario: In the following example I will save the web page cookies names into a string. 

Command usage: This command is useful for all special cases where standard SeeTestAutomation commands fail to work. In addition, by using this command, the user can access element and API that are not accessible in any other way.   

Code Examples

Java Example
String str0 = client.hybridRunJavascript("", 0, "var result = document.cookie;");
C# Example
String str0 = client.hybridRunJavascript("", 0, "var result = document.cookie;");
VBScript Example
str0 = client.HybridRunJavascript ( "", 0, "var result = document.cookie;" )
Report
Python Example
var0 = self.client.hybridRunJavascript("", 0, "var result = document.cookie;")
Perl Example
my $str0 = $client->hybridRunJavascript("", 0, "var result = document.cookie;");
  • No labels