Problem with jenkins headless browser test
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 wit开发者_开发技巧h 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.
Looks like you have to be logged in for popup tests to work:
- http://groups.google.com/group/watir-general/browse_thread/thread/27561fa8429b36c/
- http://groups.google.com/group/watir-general/browse_thread/thread/c95462c2ecc93209/
(Tip: when searching watir-general, search for hudson, not jenkins.)
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
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.
精彩评论