"SELECT" Command

image-20240223-115317.png Description: This command selects a value from a drop-down list defined by a locator or inline XPath using an index, value, etc.
Usage Scenario: Suppose we want to create a new community and select the type of the community to be “OPEN”.

Procedure: Define your locator or use inline XPath for the drop-down list where the HTML Tag is

<select class="form-control ng-pristine ng-valid ng-empty ng-touched" ng-model="ctrl.community.type" style=""><option value="? undefined:undefined ?"></option> <option value="OPEN">OPEN</option> <option value="CLOSED">CLOSED</option> </select>

and the XPath is

//label[contains(@for, 'type')]/ancestor::div/descendant::select

and select “By_Value” as the type. Then enter the Value “OPEN”. Your step will look like this:

Web Locator:

image-20240223-115320.png

Inline XPath:

image-20240223-115353.png

See the Test Library path: subject7_samples/subject7_intermediate_suite/subject7_new_community_and_delete_community

The video following video demonstrates how a value (OPEN) is selected when a Community is created as part of execution of “subject7_new_community_and_delete_community” test case in “subject7_samples” folder: