Set Device Orientation Operation

Applies to TestComplete 15.62, last modified on March 19, 2024

Description

The Set Device Orientation operation changes the orientation of a mobile device.

Requirements

This operation is available only if you have a license for the TestComplete Mobile module.

Scripting Analogue

The operation is an analogue of the Mobile.Device().Desktop.SetOrientation() scripting method.

Child Operations

The operation cannot have child operations.

Operation Parameters

The operation uses the following parameter:

Value

Integer. Specifies the target orientation of the mobile device. You can also use the following constants:

Value Constant Description
0 soPortrait Portrait orientation.
1 soLandscapeLeft Left (normal) landscape orientation.
2 soPortraitUpsideDown Upside down (reverse) portrait orientation.
3 soLandscapeRight Right (reverse) landscape orientation.

To modify the operation’s parameters:

  • Select the operation’s row in the test.

  • Select the Value cell and then click within it or press F2. This will activate the in-place editor.

  • Click the ellipsis button in the in-place editor. This will call a dialog similar to the one described above. In this dialog, you can specify parameter values.

  • You can also call this dialog by double-clicking the operation in the Keyword Test editor.

  • Click OK to close the dialog and apply the changes.

  • Press Enter to confirm the changes and close the in-place editor, or press Esc to close the editor discarding the changes.

Remarks

Android
  • This operation is asynchronous. This means that TestComplete continues running the test, no matter whether it has finished or not. For more information, see Possible Issues.

  • The operation locks the screen orientation until the ResetOrientation method is used.

General
  • After the screen orientation is changed, some objects may no longer be visible, or the object position in the object browser may be changed.

For information on testing mobile applications with TestComplete, see the topics of the Testing Mobile Applications section.

See Also

Mobile Category
Testing Mobile Applications
Testing iOS Applications - Overview (Legacy)
Simulating Screen Rotation (Legacy)

Highlight search results