Note: Commands work only after application preparation.
ElementSetProperty(Zone, Element, Index, Property, Value)
|
|
|
|
|
Designed command to sets value of a controller such as date pickers, sliders, switches etc..
Zone - Select Zone
Element - Select Element (XPath is supported for the controller identifier)
Index - Element index
Property - Property (See below the supported properties)
Value - The value to be set
Supported properties:
NATIVE ZONE:
index: For pickers to selects the element in the provided index. The supported values are integers according to size of the picker
date: Works on Android and iOS date pickers to set the date value. The supported value format is dd.mm.yyyy: 12.09.2012
datetime: Works on iOS date time picker, to set the date and time value. The supported value format is dd.mm.yyyy hh.mm: 12.09.2012 13.05.
time: Works on Android or iOS time picker, to set the time value. The supported value format hh.mm:13.05
slide: Works on Android or iOS slider to set the slider value. You can set intervals like 0-10, 0-100, or 0-infinity.
text: Works on iOS picker to select specific text in the picker.
on: Works on Android and iOS switch to change the value. The supported value is boolean - true or false
placeholder: Works on iOS
checked: Works on Android or iOS check box. The supported value is boolean - true or false
WEB ZONE:
Property selection affects attributes of HTML elements. The inserted value is in javascript.
Note: String values are to be contained within quotation marks.
In the following example we will set a date to a picker using the UICatalog Test application.
Step 1: Get the picker's Native id.
How to find the picker's Native properties?
Usually it can be found behind its components properties:
Click on one of the picker's components.
Right-click on the component then click on 'Ignore' - this will remove its properties from the screen, and will let you see what's behind it.
Click again in the same place - the picker's properties will now show up (if not, continue ignoring until you find it).
Step 2:
Set the command's properties to get the selected date in the picker in the format
DD/MM/YYYY.
Result:
In the following example we will set the slider to a particular value using the UICatalog Test application.
Step 1: Get the slider's Native id
How to find the picker's Native properties?
Usually it can be found behind its components properties:
Click on one of the picker's components.
Right-click on the component then click on 'Ignore' - this will remove its properties from the screen, and will let you see what's behind it.
Click again in the same place - the picker's properties will now show up (if not, continue ignoring until you find it).
Set the command's properties to get the selected value in the slider in integers between 0-100.
Result:
In the following example we will change the state of a button using the UICatalog Test application.
Step 1: Get the button's Native id.
How to find the picker's Native properties?
Usually it can be found behind its components properties:
Click on one of the button's components.
Right-click on the component then click on 'Ignore' - this will remove its properties from the screen, and will let you see what's behind it.
Click again in the same place - the picker's properties will now show up (if not, continue ignoring until you find it)
Set the command's properties to get the selected value in the switch - boolean values of true/false.
Result:
String str1 = client.elementSetProperty("NATIVE", "xpath=//*[@class='UIDatePicker' and @hidden='false']", 0, "date", "true");string str1 = client.ElementSetProperty("NATIVE", "xpath=//*[@class='UIDatePicker' and @hidden='false']", 0, "date", "04.04.2015");String str1 = client.elementSetProperty("NATIVE", "xpath=//*[@class='UIDatePicker' and @hidden='false']", 0, "date", "04.04.2015");Reportvar1 = self.client.elementSetProperty("NATIVE", "xpath=//*[@class='UIDatePicker' and @hidden='false']", 0, "date", "04.04.2015")my $str1 = $client->elementSetProperty("NATIVE", "xpath=//*[\@class='UIDatePicker' and \@hidden='false']", 0, "date", "04.04.2015");