Setting up attaching to iOS Apps on a device¶
Step 1: Instrument the App
This is explained at Notes on Testing iOS Apps in an iPhone or iPad in the Squish manual.
Step 2: Register an Attachable AUT
Before you can attach to a running instance of your application, the application has to be registered as an "Attachable AUT".
In the Squish IDE:
Open Edit
> Server Settings
> Manage AUTs...
> Attachable AUTs
to register an "Attachable AUT", for example with the name "MyApplicationAttachable", with the IP address (to see the IP address start the Settings
app, select Wi-Fi
and tap the blue arrow of the current Wi-Fi network) of the iOS device and the port number configured in your app when instrumenting it.
In command line:
(Replace "path/to", "ios_device_ip_address" and "app_port" accordingly.)
Recording a test case on an iOS App on a device¶
Create a test suite (when asked choose iOS as toolkit).
Create a test case in the test suite and select it.
Start the App on the device.
Start recording into the test case by choosing
Run
> Record Test Case. (When theRecord Settings
is shown, choose the attachable AUT specified above.Start interacting with your App.
End recording by clicking on the left most button in the
Control Bar
.
The resulting script should look similar to this (Python example):
Recording a snippet for an iOS App on a device¶
This is useful to insert script snippets into an existing script.
Select the desired test case.
Set a breakpoint on a test script line with a script command (breakpoints on empty lines or lines without a command will be ignored), for example the line with
snooze(1)
in this example:Start the App on the device.
Execute to the breakpoint ({Select test case, choose {Run}} >
Run Test Case
).Start snippet recording via
Run
>Record snippet...
(this will only be enabled when the input focus is inside the script editor window/pane).Start interacting with your App.
End recording by clicking on the left most button in the
Control Bar
.
The recorded snippet should have been inserted before the line with the breakpoint now.
Replay a test case with an iOS App on a device¶
Select the desired test case.
Start the App on the device.
Execute to the test case via {Run}} >
Run Test Case
).