小编Jay*_*gat的帖子

屏幕截图异常:已截屏

这是PhantomJS Session的Stack Trace.它随机地做到这一点.我看到它说:Caused by: org.openqa.selenium.remote.ScreenshotException: Screen shot has been taken.该代码与Firefox浏览器完美配合,但无头无效.

我在这个问题上一直在做的谷歌搜索很少,但关于PhantomJS的网页没有截屏,我所做的只是试图点击一个元素.或者我误解了,实际发生的是PhantomJS正在拍摄失败的点击尝试的截图?

[ERROR - 2015-06-08T16:02:30.402Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1433779350383:262 in error
Exception in thread "main" org.openqa.selenium.NoSuchElementException: {"errorMessage":"Unable to find element with xpath'//*[@id=\"linput_806867695_10_9022592247_0\"]'","request":{"headers":{"Accept-Encoding":"gzip,deflate","Connection":"Keep-Alive","Content-Length":"78","Content-Type":"application/json; charset=utf-8","Host":"localhost:31177","User-Agent":"Apache-HttpClient/4.3.6 (java 1.5)"},"httpVersion":"1.1","method":"POST","post":"{\"using\":\"xpath\",\"value\":\"//*[@id\\u003d\\\"linput_806867695_10_9022592247_0\\\"]\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/828cd8e0-0df7-11e5-835a-03db015d40d4/element"}}
Command duration or timeout: 5.60 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'debserver', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'i386', os.version: '3.16.0-4-686-pae', …
Run Code Online (Sandbox Code Playgroud)

java selenium phantomjs screenshotexception

5
推荐指数
0
解决办法
4001
查看次数

标签 统计

java ×1

phantomjs ×1

screenshotexception ×1

selenium ×1