Screenshots using Selenium IDE Firefox plugin

假装没事ソ 提交于 2019-12-18 04:19:10

问题


Using Selenium IDE Firefox plugin, I want to take automated screenshots. The test script contains of two lines:

Command: open; Target: http://www.google.com
Command: captureEntirePageScreenshotAndWait

The log shows:

[info] Executing: |open | http://www.google.com | |
[info] Executing: |captureEntirePageScreenshotAndWait | | | 
[error] Unexpected Exception: [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsILocalFile.initWithPath]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js :: <TOP_LEVEL> :: line 3045" data: no]. toString -> function toString() { [native code] }, message -> Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsILocalFile.initWithPath], result -> 2152857601, name -> NS_ERROR_FILE_UNRECOGNIZED_PATH, filename -> chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js, lineNumber -> 3045, columnNumber -> 0, inner -> null, data -> null, location -> JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js :: <TOP_LEVEL> :: line 3045

How to get screenshots?


回答1:


Setting the file path correctly solved it. The path needs to be set as follows:

(Windows:)

Command: captureEntirePageScreenshotAndWait; Target: D:\\Screenshots\\test.png

(Linux:)

Command: captureEntirePageScreenshotAndWait; Target: \\Screenshots\\test.png

In this example, the folder 'Screenshots' must exist.



来源:https://stackoverflow.com/questions/22300081/screenshots-using-selenium-ide-firefox-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!