Silk Mobile

Table of Contents (Homepage)

HybridGetHtml

HybridGetHtml(WebViewLocator, Index)

images/images/os-icons/os_ios_150x150.png

images/images/os-icons/os_android_150x150.png

images/images/os-icons/os_windows_150x150.png

Description

Saves the Html content from a webview into a string

Parameters

  • WebViewLocator - WebView locator string like id=web or empty for the first WebView in page

  • Index - Element index

Usage

Scenario : In the following example I will get the HTML of the webview inside the main window of EriBank application (the Balance section is a web part inside the application).

images/download/attachments/3309902/5.jpg

Command usage: This command is used in case of interest in the HTML data of the page that is being tested. the HTML content will be saved into a string.

Parameters:

  • WebViewLocator - WebView locator string like id=web or empty for the first WebView in page - will be set to id=balanceWebView

  • Index - Element index - will be set to 0

Code Examples

Java Example
String str0 = client.hybridGetHtml("id=balanceWebView", 0);
C# Example
String str0 = client.hybridGetHtml("id=balanceWebView", 0);
VBScript Example
str0 = client.HybridGetHtml ( "id=balanceWebView", 0 )
Report
Python Example
var0 = self.client.hybridGetHtml("id=balanceWebView", 0)
Perl Example
my $str0 = $client->hybridGetHtml("id=balanceWebView", 0);