Importing Script Files at Runtime
At the moment, we have two individual tests that we want to run one after the other. Embedding scripts in UI Automation’s editor is useful and convenient, but it’s not the best way to maintain our test scripts long-term. Instead we will have the Instruments trace document reference a master script on the file system. This script can then import other script files at runtime. Using these techniques, we’ll be able to run both our tests in the right order and still keep them separate.
Let’s construct this master script in place and then export it to a file. Create a blank script in the automation-script editor and type in these #import statements to tell the scripting engine that we want to pull other files into ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access