2013-08-05 109 views
0

我需要能够截取网页截图并将其保存到我的硬盘上的文件夹中。为此,我尝试使用captureEntirePageScreenshot,将我要用作目标的文件夹。selenium ide截图保存失败

<tr> 
<td>captureEntirePageScreenshot</td> 
<td>C:\Users\.....\Desktop\test</td> 
<td></td> 
    </tr> 

当我告诉它执行时,出现以下错误。注意:selenium上的基本URL和网页匹配。

[error] Unexpected Exception: [Exception... "Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIFileOutputStream.init]" nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js :: <TOP_LEVEL> :: line 2986" data: no]. QueryInterface -> function QueryInterface() { [native code] }, message -> Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIFileOutputStream.init], result -> 2152857621, name -> NS_ERROR_FILE_ACCESS_DENIED, filename -> chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js, lineNumber -> 2986, columnNumber -> 0, location -> JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js :: <TOP_LEVEL> :: line 2986, inner -> null, data -> null, initialize -> function initialize() { [native code] } 

如果有人能帮助我理解这一点并解决它,我将不胜感激。

+0

你有什么版本的Firefox以及哪个版本的IDE?这是否刚刚开始?它之前工作过吗? Firefox最近升级了吗?你在其他机器上遇到问题吗? – Arran

+0

firefox:22.0;硒:2.2.0;我不知道这是否刚刚开始,或者我的同事遇到类似的问题,因为我/我们现在不需要保存屏幕截图。最近的Firefox升级是上个月。 – Skulgren

+0

更正:我们应用的最新Firefox升级是在上个月完成的。 – Skulgren

回答

0

试试这个,让我知道它是否适合你的工作或没有,因为这对我来说

 <tr> 
<td>open</td> 
<td>http://docs.seleniumhq.org/download/</td> 
<td></td> 
     </tr> 
    <tr> 
<td>captureEntirePageScreenshot</td> 
<td>d:/title.png</td> 
<td></td> 
    </tr> 
+0

它没有。我收到了类似的错误消息: – Skulgren

+0

[错误]意外的异常:[Exception ...“组件返回失败代码:0x80004005(NS_ERROR_FAILURE)} [nsIFileOutputStream.init]”nsresult:“0x80004005(NS_ERROR_FAILURE)”位置: “JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js :: :: line 2986”data:no]。 – Skulgren

+0

消息 - >组件返回失败代码:0x80004005(NS_ERROR_FAILURE)[nsIFileOutputStream.init],QueryInterface - >函数QueryInterface(){[本机代码]},结果 - > 2147500037,名称 - > NS_ERROR_FAILURE,文件名 - > chrome:// selenium-ide/content/selenium-core/scripts/selenium-api.js,lineNumber - > 2986,columnNumber - > 0,location - > JS frame :: chrome:// selenium-ide/content/selenium-core/scripts /selenium-api.js :: ::第2986行,内部 - > null,数据 - > null,初始化 - >函数initialize(){[native code] – Skulgren

0

嗯,我使用的硒2.2.0做工精细,但我在Firefox 17.0.1和下面的命令适用于我。

captureEntirePageScreenshot | c:\selenium\test.jpg | 

请注意,它可以使用或不使用文件扩展名。你可能想用seleniumhq.org进行检查,看是否有与在Firefox 22

Klendathu

该命令
+0

值得一试,但仍然没有雪茄。不管怎么说,还是要谢谢你。 – Skulgren

0

尝试加倍后从\斜线中的文件路径\\一个报告的问题。

<tr> 
<td>captureEntirePageScreenshot</td> 
<td>C:\\Users\\.....\\Desktop\\test</td> 
<td></td> 
</tr> 

希望有帮助。

相关问题