Article - Automating multiple applications with multiple Squish installations (iOS, Web)

Skip to end of metadata
Go to start of metadata

Overview

The information below describes the setup for Squish for iOS and Squish for Web, but the instructions are not limited to these Squish editions, but apply to all/most editions of Squish.

Basic setup

  • Install Squish for iOS.
  • Install Squish for Web.
  • Create a Squish for iOS test suite with the Squish for iOS IDE.
  • Create a Squish for Web test suite with the Squish for Web IDE.
  • (Squish 6.3 or earlier) share the objects.map file across both test suites (see Sharing an Object Map across test suites).
  • (Squish 6.4 or later) create a script file that contains the necessary common object names and place it in a global scripts dir, and import/source it the way other scripts are imported/sourced.
  • Decide which of the two test suites should be the main test suite. (The remainder of this article assumes a Squish for iOS test suite to be the main test suite.)

Recording

Recording in the iOS application

  • Start the Squish for iOS IDE.
  • Load the Squish for iOS test suite.
  • Record.

Example recording:

test.py

Recording in the Web application

  • Start the Squish for Web IDE.
  • Load the Squish for Web test suite.
  • Record.

Example recording:

test.py

This recording has to be integrated into the Squish for iOS test suite now, which is a simple copy & paste operation at first:

test.py

Then we add these lines (which are the equivalent of "startApplication()" but for the web browser):

So the resulting script looks like this:

test.py

As you can see we also modified one of the startApplication() lines and the waitForApplicationLaunch() lines to catch the return values, which are the application contexts of the iOS and web applications. We do this so that we are later able to switch between the application contexts, should it be required.

Replay

  • Start squishserver of Squish for Web on the same port as specified in the startApplication() call that starts the web browser (1234):
  • Start Squish for iOS IDE.
  • Load Squish for iOS test suite.
  • Execute Squish for iOS test suite.

You can switch between application contexts via setApplicationContext():

test.py

Further information

Example - Recording on other applications
Application Context
How to Test Multiple AUTs from a Single Test Script, Using ApplicationContext
How to Use ApplicationContext Objects
setApplicationContext()
currentApplicationContext()
applicationContextList()

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.