Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to run several Scripts continuously in Instruments (iOS) UI Automation?

Whenever I try to do UI Automation in Instruments (iPhone simulator) by Apple, I have several different scripts to run. The problem is that I need to sit back and run each script when the former one ends. I wonder then what's the use of Automation if still I need to sit and run each script after the other.

Can anyone tell me (or is there) a way to run more than one script with just one click? and don't need to run record button for every script?

like image 300
user2640933 Avatar asked Aug 01 '13 07:08

user2640933


2 Answers

I have the same problem. According to the official documentation: "You can create as many scripts as you like, but you can run only one at a time."

So what I tried to bundle all the scripts into one by importing them:

# import "test1.js"
# import "test2.js"

Save this as a separate script (e.g. "testAll.js") and run this one.

like image 190
Display Name Avatar answered Nov 08 '22 12:11

Display Name


YES !!! You can run a test suite with all your script. For example you can write a script for each screen in your app, and after created a test suite to run all the script or if you prefer only run a couple of this scripts. You need uses the sentencie #import “script1.js” for each scripts. Example:

//import all scripts that you need to include
#import "screen1.js"
#import "screen2.js"
#import "screen3.js"

function Main(){

// Tests:       
     TestScreen1(); // this method is on "screen1.js"
     TestScreen2(); // this method is on "screen2.js"
     TestScreen3(); // this method is on "screen3.js"

 };

// call to function Main 

Main();
like image 32
Fmartin Avatar answered Nov 08 '22 10:11

Fmartin