Keys Method (iOSDevice Object)

Applies to TestComplete 15.45, last modified on December 01, 2022
The information below concerns legacy mobile tests that work with mobile devices connected to the local computer. For new mobile tests, we recommend using the newer cloud-compatible approach.

Description

Types text in the active application and object on the connected iOS device.

Declaration

iOSDeviceObj.Keys(Keys)

iOSDeviceObj An expression, variable or parameter that specifies a reference to an iOSDevice object
Keys [in]    Required    String    
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

Keys

The text to type.

Result Value

None.

Example

This example shows how to use the Keys method to enter text on an iOS device:

JavaScript, JScript

function Test()
{
  // Specify the current device
  Mobile.SetCurrent("MyDevice");

  // Launch the tested application
  …

  // Simulate user actions
  …
  Mobile.Device().Keys("iddqd");
  …

}

Python

def Test():
  # Specify the current device
  Mobile.SetCurrent("MyDevice")
  # Launch the tested application
  # ...
  # Simulate user actions
  # ...
  Mobile.Device().Keys("iddqd")

VBScript

Sub Test

  ' Specify the current device
  Call Mobile.SetCurrent("MyDevice")

  ' Launch the tested application
  …

  ' Simulate user actions
  …
  Call Mobile.Device.Keys("iddqd")
  …

End Sub

DelphiScript

procedure Test;
begin
  // Specify the current device
  Mobile.SetCurrent('MyDevice');

  // Launch the tested application
  …

  // Simulate user actions
  …
  Mobile.Device.Keys('iddqd');
  …

end;

C++Script, C#Script

function Test()
{
  // Specify the current device
  Mobile["SetCurrent"]("MyDevice");

  // Launch the tested application
  …

  // Simulate user actions
  …
  Mobile["Device"]["Keys"]("iddqd");
  …

}

See Also

iOSDevice Object
Testing iOS Applications (Legacy)

Highlight search results