我們的 Jenkins pipline 會起一個 selenium/standalone-chrome 的 docker,用類似這樣的方式起:
docker run -d -p 4444:4444 selenium/standalone-chrome 每次跑完都會 stop 這個 container。
code 是類似這樣連 remote webdriver 的:
webdriver.Remote("http://localhost:4444/wd/hub",options=options) 其他專案的 docker compose 執行 selenium/standalone-chrome 後,用一樣的 code 都沒問題,但這次卻一直遇到以下的錯誤:
Execute case encounter an error: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) 還有一次是這樣的錯誤:
Execute case encounter an error: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) 後來才發現是因為 docker 還在啟動⋯⋯