bcar
bcar

Reputation: 815

Jenkins And Launch Safari With Extensions

I'm running into issues where Jenkins will not launch safari with the installed extensions. When i take the same bash script and execute it via terminal (outside of jenkins) the script runs as expect.

The extension having issues is the Selenium Web Driver Safari Extension. When Safari loads i'm presented with prompt that the Extension has been migrated. All automated UI tests then fail of course.

I've google searched for my answer and browse stackoverlfow, but i can't figure it out.

  1. I have the certificate from apple dev applied on the system folder of my key chain
  2. The 2.45 Safari extension is installed and function
  3. the webdriver is instantiated with safari_opts.skip_extension_installation = true

    • OSX - 10.10.2
    • Jenkins - 1.606
    • Safari - 8.04

I'm struggling to figure out the problem. Any help is most appreciated.

Thanks!

Brian

Upvotes: 2

Views: 500

Answers (2)

Eric Ipsum
Eric Ipsum

Reputation: 745

yup, stanjer is right... i just add this answer to improve it.

go detail of this issue specially comment no " 71" .

https://code.google.com/p/selenium/issues/detail?id=7933

I use this code at the beginning of my shell script like below:

keychain="~/Library/Keychains/login.keychain"
security -v unlock-keychain -p ewew1221 ~/Library/Keychains/login.keychain 

if [ $? -ne 0 ];then
 echo "Cannot open keychain ${keychain}"
 exit 1
fi

ewew1221 is my password

Upvotes: 0

Stan
Stan

Reputation: 3461

As Jenkins is running a job in a clean environment, even if you have already added a keychain, it will ignore it. So, you should add a keychain as a build step. Something like:

security -v unlock-keychain -p <pass> ~/login.keychain

Upvotes: 2

Related Questions