We are trying to run some Selenium tests using Selenium CI . We are using maven to build the project and using Selenium web driver.
I followed an Blog post in this link as a reference
When I run the maven project locally (without Bamboo) it worked fine. But when I tried to use it using a Bamboo agent in a windows server it gave an error.
org.openqa.selenium.WebDriverException: Failed to connect to binary
FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port
7055; process output follows:
Build info: version: '2.44.0',
revision: '76d78cf323ce037c5f92db6c1bba601c2ac43ad8',
time: '2014-10-23 13:11:40' System
info: host: 'M',
ip:'myIP',
os.name: 'Windows 7',
os.arch: 'amd64',
os.version: '6.1',
java.version: '1.8.0_11'
Driver info: driver.version: FirefoxDriver
Then I searched the error assuming it was an error cause by a plug in.
Few of them are:
But nothing worked.
Found an work around for the problem. I am posting that as an answer for anyone who will go through this situation. But I think there must be a better answer for this. Please post if you know a better way.
First (for us) this situation occurs only when we try to do the Selenium tests using Bamboo agent. Therefore if we look closely the agent is started by a service. So the process (Wrapper.exe) is running as it is run by the "SYSTEM". Therefore when the agent tries to run a program (in our case firefox.exe) that program will also started by the "SYSTEM".
But the "SYSTEM" is not the user who s logged in to the PC. So it cannot interact with the Desktop. Therefore this error occurs.
So what we have to do is run the agent process(Wrapper.exe) by my user, therefore when the agent starts another program such as firefox. It will be run as a process started by my user who can interact with the Desktop. When we do that, then the test runs like a charm!
As the work around what we did is this: Stop the service and run wrapper.exe using the "BambooAgent.bat" in "bamboo-agent-home\bin". You can do this by adding a shortcut of the bin file to the startup folder.
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