Keys Method (iOSDevice Object)

Applies to TestComplete 14.30, last modified on November 21, 2019

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

Highlight search results