Description
Select an element within a list (first making the element visible)
Note: This command will work only on instrumented applications
Parameters
Name | Value | Description |
---|---|---|
List locator | String | A String identifier of List locator |
Element locator | String | A String identifier of Element locator |
Index | Integer | Element Index |
Click | Boolean | True to select the element. |
Usage
The command can be used to select an element in a List.
Example
Consider the EriBank Application,
Step 1: Login to the EriBank application.
Step 2: Click the Make Payment button.
Step 3: Click Select button.
In the Seetest Automation mode open Open the Object Spy.
Now we need to find the list locator identifier.
Click the parent of the list element and note down the list locator identifier which is in this case "accessibility=conutryView".
Now we need to find the element identifier,
Click any element in the list and note down the Element identifier which is text=Greece.
Once this is done the following code cane be used to select the Element in the list locator.
Set Experitest Url
Please make sure you replace <EXPERITEST_URL> with appropriate URL in the code snippet below.
- For SeeTest cloud, EXPERITEST_URL needs to be https://cloud.seetest.io:443/wd/hub
- For Dedicated Experitest Lab, EXPERITEST_URL needs to be your own domain. e.g - https://company.experitest.com
DesiredCapabilities dc = new DesiredCapabilities(); driver = new AndroidDriver(new URL("<EXPERITEST_URL>"), dc); seetest = new SeeTestClient(driver); dc.setCapability(MobileCapabilityType.UDID, "deviceid"); ... ... seetest.elementListSelect("accessibilityLabel=conutryView","text=Greece", 0, true);