Running Gradle script on Bamboo

I came across this issue while running Geb tests using Gradle build script on Bamboo CI.

The firefox browser would fail with error:

” org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: cannot open display: 1.0

I followed a lot of forums and blog posts for resolution but none of them worked.

The real problem turn out to be the way we need to pass environment variables using “Inline Script” in Bamboo.

chmod a+x gradlew

su - root -c "export DISPLAY=localhost:1.0; ./gradlew firefoxTest"

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s