最近我让我的Ubuntu Jenkins服务器运行无头硒测试很可爱,今天它不再捕获屏幕截图了。
我的配置适用于我的开发笔记本电脑,快乐地截取屏幕截图。不幸的是,这意味着调试和断点更难,因为它只在Jenkins作业上失败
堆栈跟踪在这里:
Traceback (most recent call last):
File "/var/lib/jenkins/jobs/Build Podunk from master/workspace/podunk/platform/tests/ui/test_create_task_new.py", line 29, in test_task_form
self.wait_for_page_header(tc.RECORD_CREATE_TASK_PAGE_HEADER)
File "/var/lib/jenkins/jobs/Build Podunk from master/workspace/podunk/platform/tests/ui/__init__.py", line 176, in wait_for_page_header
self.take_screenshot('wait_for_page_header')
File "/var/lib/jenkins/jobs/Build Podunk from master/workspace/podunk/platform/tests/ui/__init__.py", line 141, in take_screenshot
self.get_screenshot_as_file(path)
File "/var/lib/jenkins/jobs/Build Podunk from master/workspace/podunk/platform/tests/ui/__init__.py", line 105, in get_screenshot_as_file
png64 = self.selenium.get_screenshot_as_base64()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 787, in get_screenshot_as_base64
return self.execute(Command.SCREENSHOT)['value']
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 201, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 181, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: Could not convert screenshot to base64 - Error: Invalid base64 data: data:,
Stacktrace:
at FirefoxDriver.prototype.screenshot (file:///tmp/tmpd1IiNV/extensions/fxdriver@googlecode.com/components/driver-component.js:10863)
at DelayedCommand.prototype.executeInternal_/h (file:///tmp/tmpd1IiNV/extensions/fxdriver@googlecode.com/components/command-processor.js:12534)
at DelayedCommand.prototype.executeInternal_ (file:///tmp/tmpd1IiNV/extensions/fxdriver@googlecode.com/components/command-processor.js:12539)
at DelayedCommand.prototype.execute/< (file:///tmp/tmpd1IiNV/extensions/fxdriver@googlecode.com/components/command-processor.js:12481)
我不能指出我的Jenkins设置中的配置更改,但会感谢有人可以给予的任何帮助