SeeTest Client - ElementListSelect
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 .
ElementListSelect (ListLocator, ElementLocator, Index, Click)
Note: This command will work only on instrumented applications. for more information see application preparation.
Description
Select an element within a list (first making the element visible)
Parameters
- ListLocator: List locator
- ElementLocator: Element locator (NOTE: this variable does not support XPath queries)
- Index: Element index
- Click: If TRUE then click once found
Usage
Scenario: In the following example we will use the EriBank application to select an element from the country list.
Step 1: Login to the EriBank application.
Step 2: Click the Make Payment button.
Step 3: Click Select button.
The country list will be displayed on the screen.
Step 4: Set the elementListSelect command properties.
How to find the list locator Native properties?
Usually, it can be found behind its components properties:
-
Click on one of the list'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 - You will climb up the tree hierarchy of components.
We have found the list locator identifier. We will use accessibilityLabel=conutryView as the identifier.
Note the icon on the tree hierarchy for the list/table which you can use to get the table property.
Step 5: Get the Element's Native id (The option you want to pick on the list)
In this example, we will search for Brazil
Command's properties:
To find what we are looking for.
- ListLocator: "accessibilityLabel=conutryView"
- ElementLocator: "text=Brazil"
- Index: "0"
- Click: "TRUE"
It will now select 'Brazil' (If you do not want to click on it, just set the Click property to False).
Code Examples
Command is available on all code languages: UFT (QTP), TestComplete, RFT, C#, Python, Perl, etc.
Java Example
client.elementListSelect("accessibilityLabel=conutryView","text=Brazil", 0, true)
C# Example Expand source
client.elementListSelect("accessibilityLabel=conutryView", "text=Brazil", 0, true)
VBScript Example Expand source
client.elementListSelect"accessibilityLabel=conutryView", "text=Brazil", 0, true
Report
Python Example Expand source
self.client.elementListSelect("accessibilityLabel=conutryView", "text=Brazil", 0, True)
Perl Example Expand source
$client->elementListSelect("accessibilityLabel=conutryView","text=Brazil", 0, 1)