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?
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.
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();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With