Switch Action (Specific to Xamarin.Forms Switch Controls)

Applies to TestComplete 14.74, last modified on March 31, 2021


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.



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.


The method has the following parameter:


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


See Also

Testing Xamarin.Forms Applications
List of Xamarin.Forms Controls

Highlight search results