4
votes

We are testing some Watir tests and cucumber using Jenkins but we have run into a problem with inconsistent results. Our build failed because apparently the watir attach popup browser was failing(couldn't find the window with the title we produced).

We double checked this by going into the workspace folder and running cucumber manually inside it compared with running cucumber by starting a build with Jenkins.

The Jenkins build failed with the popups while running cucumber inside the workspace folder didn't fail anything. We are guessing that this is because the browser is headless and thus it has no address bar or title bar? Is this the reason?

If so, is there any way around this? How do we attach a popup from a headless browser?

I am using watir 1.8.1(the main one) and IE8 on windows.

3
I think providing watir gem name (there are a few of them) and version and browser (and version) could help. - Željko Filipin
@Zeljko updated the question with the proper gem version watir(1.8.1) and IE8 on windows - corroded
I remember seeing questions like this at watir-general (do not have the time to find an example now). - Željko Filipin
yeah ive been trying to use the watir search and all the guidelines for asking questions in the wait/support site but im afraid im out of luck. will timebox for another hour or so then i guess i'll ask in the mailing list after - corroded

3 Answers

2
votes
2
votes

I believe that Watir-Webdriver has better support for running headless than Watir does. Watir itself is really designed to automate the actual IE browser, and potentially some things may not work right if IE is not actually rendering the UI to a screen.

Watir-Webdriver supports IE, FF, Chrome, and Headless. See this entry from Alister Scott's Watirmelon blog where he gives an example of how to run it headless using htmlunit

1
votes

In Windows Start->run "services.msc", find the Jenkins service, rightclick -> properties, go to the Log On tab, click the checkbox "Allow service to interact with desktop"

Works fine for me on XP as long as I run them at night, otherwise it gets annoying.