| external help file | Pup.dll-Help.xml |
|---|---|
| Module Name | Pup |
| online version | |
| schema | 2.0.0 |
Selects options in a dropdown/select element.
Select-PupElementOption -Element <PupElement> -Value <String[]> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Select-PupElementOption -Element <PupElement> -Text <String[]> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Select-PupElementOption -Element <PupElement> -Index <Int32[]> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Select-PupElementOption -Element <PupElement> [-List] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Selects one or more options in a select element by value, visible text, or index. Can also list all available options.
$select = Find-PupElements -Page $page -Selector "#country" -First
Select-PupElementOption -Element $select -List
Shows all options in the dropdown.
$select = Find-PupElements -Page $page -Selector "#country" -First
Select-PupElementOption -Element $select -Value "US"
Selects the option with value "US".
$select = Find-PupElements -Page $page -Selector "#role" -First
Select-PupElementOption -Element $select -Text "Administrator"
Selects the option showing "Administrator".
$select = Find-PupElements -Page $page -Selector "#permissions" -First
Select-PupElementOption -Element $select -Value "read", "write", "delete"
Selects multiple options in a multi-select element.
The select element to interact with
Type: PupElement
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseSelect option(s) by zero-based index
Type: Int32[]
Parameter Sets: ByIndex
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseList all available options in the select element
Type: SwitchParameter
Parameter Sets: ListOptions
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSelect option(s) by visible text
Type: String[]
Parameter Sets: ByText
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSelect option(s) by value attribute
Type: String[]
Parameter Sets: ByValue
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.