我启动网格服务 - java -jar selenium-server-standalone-2.42.1.jar -role hub 我启动phantomjs - phantomjs --webdriver = --webdriver-selenium-grid-hub = {hubip / port}
我运行phpunit,输出是: RuntimeException:在'http:// {hubip / port} / selenium-server / driver /'
访问Selenium Server时响应无效 org.openqa.grid.common.exception.GridException: Error forwarding the new session The server returned an error : Unknown Command -
{"headers":
{"Accept":"*/*","Accept-Encoding":"gzip,deflate","Connection":"Keep-Alive","Content-Length":"67","Content-Type":"application/x-www-form-urlencoded; charset=utf-8","Host":"","User-Agent":"Apache-HttpClient/4.3.2 (java 1.5)"},
"httpVersion":"1.1","method":"POST","post":"cmd=getNewBrowserSession&1=phantomjs&2=;","url":"/","urlParsed":
{"anchor":"","query":"","file":"","directory":"/","path":"/","relative":"/","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/","queryKey":{},"chunks":[""]}
}
我可以让firefox正常工作,所以我认为前两个命令可以正常工作。
phantomjs版本也是1.9.7