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.
- 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.)
- Start the Squish for iOS IDE.
- Load the Squish for iOS test suite.
- Start the Squish for Web IDE.
- Load the Squish for Web test suite.
This recording has to be integrated into the Squish for iOS test suite now, which is a simple copy & paste operation at first:
Then we add these lines (which are the equivalent of "startApplication()" but for the web browser):
So the resulting script looks like this:
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.
- 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():
Example - Recording on other applications
How to Test Multiple AUTs from a Single Test Script, Using ApplicationContext
How to Use ApplicationContext Objects