SeeTestAutomation- ElementGetProperty
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
Note: This command will work only on instrumented applications. for more information see application preparation.
ElementGetProperty(Zone, Element, Index, Property)
Description
Command to get a property of an element. Can retrieve all properties of the elements that are showing on the object spy as also controllers.
Parameters
Supported properties:
All available properties from the object spy.
Additional supported properties:
- index: For android and iOS pickers to get the element in the picker in the provided index.
- date: Works on Android and iOS date picker, to get the date value.
- datetime: Works on iOS date time picker, to get the date and time value
- time: Works on Android or iOS time picker, to get the time value.
- slide: Works on Android or iOS slider to get the slider value.
- text: Works on Android or iOS picker to get the specific selected text in the picker.
- on: Works on Android or iOS switch to get its value (true or false)
- InnerHTML: Works on Android or iOS. Gets the inner HTML code.
- enabled: Check if a button is enabled or disabled. Works on Android or iOS buttons.
- checked: Check if a checkbox is checked or not. Works on Android or iOS buttons.
Usage
Scenario 1: date pickers
In the following example we will get the selected date from 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.
Result:
Scenario2: Sliders
In the following example we will get the selected value from a slider 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).
Step 2: Set the command's properties to get the selected value in the slider.
Result:
Scenario 3: Switches
In the following example we will check if a button is on or off 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)
Step 2: Set the command's properties to get the selected value in the slider.
Result:
Code Examples
Java Example
String str0 = client.elementGetProperty("NATIVE", "class=UIDatePicker", 0, "date");
C# Example Expand source
string str0 = client.ElementGetProperty("NATIVE", "class=UIDatePicker", 0, "date");
VBScript Example Expand source
str0 = client.ElementGetProperty ( "NATIVE", "class=UIDatePicker", 0, "date" )
Report
Python Example Expand source
var0 = self.client.elementGetProperty("NATIVE", "class=UIDatePicker", 0, "date")
Perl Example Expand source
my $str0 = $client->elementGetProperty("NATIVE", "class=UIDatePicker", 0, "date");