Gilad Shai
Gilad Shai

Reputation: 33

How to run UIAutomation using Jenkins?

I'm trying to combine Instruments UIAutomation with the CI by Jenkins.

In the Jenkins project's configurations I defined a call a script:

sh buildAndTest.sh

That all it does is to call the uitest

#!/bin/sh 
make uitest

uitest is defined inside Makefile, and it makes the call to Instruments:

/usr/bin/instruments -t pathToTemplate/MyTemplate.tracetemplate  pathToSimulator/Library/Application\ Support/iPhone\ Simulator/5.1/Applications/a_very_long_name/Main.app

This code works in the terminal and when I call "make uitest". It doesn't work when Jenkins executes the script, and the console outputs:

Instruments Usage Error : (null) make: * [uitest] Error 254 Build step 'Execute shell' marked build as failure Finished: FAILURE

Any ideas how to integrate these two?

Upvotes: 1

Views: 2579

Answers (3)

CZ54
CZ54

Reputation: 5588

I just made it and it was a bit painfull.

Step 1.1 : Build your app using Xcode Plugin with the simulator SDK

sdk

Step 1.2 : Define a readable build directory

enter image description here

Step 3 : Add a Shell build step with following line :

instruments -t ~/Desktop/test1.tracetemplate __YOUR_BUILD_PATH__/_YOUR_APP_.app

Works for me. Tell me if you have any trouble

Upvotes: 1

ExploringApple
ExploringApple

Reputation: 1484

Another reson could be you are giveing respective paths. Replace it with full qulified paths if any.

Upvotes: 0

Jason Swager
Jason Swager

Reputation: 6501

Ensure that the Jenkins slave agent is running as a user of the system AND that the system is logged into the desktop. If the desktop isn't visible, UI automation will fail.

Upvotes: 0

Related Questions