SetPosition Action (TrackBar and Slider Controls)

Applies to TestComplete 15.63, last modified on April 10, 2024
This method is not supported in web tests (including cross-platform web tests) that use XPath expressions and CSS selectors to locate web elements. This method can be only used in tests that locate web objects by using internal identification properties provided by TestComplete.

Description

Sets the logical position of the slider.

Declaration

TestObj.SetPosition(Position, EndPosition)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Position [in]    Required    Integer/Double    
EndPosition [in]    Required    Integer/Double    
Result None

Applies To

The method is applied to the following objects:

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 parameters:

Note: The parameters of the JQuery UI Slider and AngularUI Slider control’s SetPosition method take Double values. The parameters of the YUI Dual Thumb Slider control’s SetPosition method take Integer values.

Position

A value that specifies the slider’s logical position.

EndPosition

A value that specifies the slider’s ending logical position.

Note: The default parameter value of the JQuery UI Slider control is 0.

Result Value

None.

Remarks

If the value of the Position parameter or the value of the EndPosition parameter is greater than the wMax property value (or less than the wMin property value), an error message is posted to the test log and the slider's current position and ending position are set to wMax (or wMin).

If the EndPosition parameter value is less than the Position parameter, an error message is posted to the test log and the slider's ending position is set according to the slider's current position and the minimum distance allowed between sliders (specified by the wMinRange value).

See Also

wMax Property (TrackBar and Slider Controls)
wMin Property (TrackBar and Slider Controls)
wPosition Property (TrackBar and Slider Controls)

Highlight search results