Switch Action (Specific to Xamarin.Forms Switch Controls)

Applies to TestComplete 14.93, last modified on September 21, 2021

Description

Switch controls in Xamarin.Forms applications can take two states: On or Off. Use this action to specify the desired state of the control.

The action compares the current state of the control and the desired state specified via the input parameter: if the state mismatches, the action performs a single touch over the control; otherwise, it performs no action.

Note: To obtain the current state of the control, use its wState property.

Declaration

TestObj.Switch(State)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
State [in]    Required    Variant    
Result None

Applies To

The method is applied to the following object:

View Mode

This method is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Parameters

The method has the following parameter:

State

Specifies the state to be set.

Possible values:

Value Description
True or "On" The control is on.
False or "Off" The control is off.

Result Value

None.

See Also

Testing Xamarin.Forms Applications (Legacy)
List of Xamarin.Forms Controls

Highlight search results