1. 程式人生 > >phantomjs robot framework [Errno 9] Bad file descriptor

phantomjs robot framework [Errno 9] Bad file descriptor

前進

--- xingyunpi

phantomjs + robot framework 在docker裡面跑的時候,總是出錯,網上這樣的解決方案並不是很多,寫下來記錄一下,供他人蔘考.

錯誤提示:

[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: WebDriverException: Message: Variable Resource Not Found - {"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:33799","User-Agent":"Python http auth"},"httpVersion":"1.1","method":"GET","url":"/session/b092d610-77f7-11e7-bdc8-e7ce409f6da2/screenshot","urlParsed":{"anchor":"","query":"","file":"screenshot","directory":"/session/b092d610-77f7-11e7-bdc8-e7ce409f6da2/","path":"/session/b092d610-77f7-11e7-bdc8-e7ce409f6da2/screenshot","relative":"/session/b092d610-77f7-11e7-bdc8-e7ce409f6da2/screenshot","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/session/b092d610-77f7-11e7-bdc8-e7ce409f6da2/screenshot","queryKey":{},"chunks":["session","b092d610-77f7-11e7-bdc8-e7ce409f6da2","screenshot"]}} phone-invalid | FAIL | OSError: [Errno 9] Bad file descriptor

原因:

robot的腳本里寫了: close all browsers

解決:

Remove “close all browsers” in the test case scripts when using phantomjs as browser.