Silk Mobile

Table of Contents (Homepage)

IsElementBlank

boolean IsElementBlank( Zone, Element, Index, ColorGroups )

images/images/os-icons/os_ios_150x150.png

images/images/os-icons/os_android_150x150.png

images/images/os-icons/os_windows_150x150.png

images/images/os-icons/os_blackberry_150x150.png

images/images/os-icons/os_symbian02_150x150.png

images/images/os-icons/os_windows_mobile_150x150.png

Description

Boolean command to check if a given element contains an image or if it is blank.

  • TRUE: if blank

  • FALSE: if not.

Parameters

  • Zone: Select Zone

  • Element: Identifier of the element.

  • Index: Element or text index

  • ColorGroups: Number of colors found in the picture. usually an image will have many color groups, but a blank object with 'X' in the middle will have 2 - 3 color groups.

Usage

Scenario: The following scenario demonstrates how to use this command:

  1. On the login page of eribank application, while the Username text field is empty, we will use the command to check that is blank or contains some values in the edit field.

    images/download/attachments/2689274/2.jpg
  2. In this example, we have filled the text in the Username text field. Now, we will use the same command to check whether it has text or blank.
    images/download/attachments/2689274/3.jpg rr

Code Examples

Java Example
if(client.isElementBlank("NATIVE", "xpath=//*[@id='usernameTextField']", 0, 10)){
// If statement
}
C# Example
if(client.IsElementBlank("NATIVE", "xpath=//*[@id='usernameTextField']", 0, 10))
{
// If statement
}
VBScript Example
If StrComp (client.IsElementBlank ( "NATIVE", "xpath=//*[@id='usernameTextField']", 0, 10 ), "True") = 0 Then
Report
'If statement
Else
Report
End If
Python Example
if(self.client.isElementBlank("NATIVE", "xpath=//*[@id='usernameTextField']", 0, 10)):
# If statement
pass
Perl Example
if($client->isElementBlank("NATIVE", "xpath=//*[\@id='usernameTextField']", 0, 10)){
# If statement
}