使用Selenium IDE Firefox插件的屏幕截图 [英] Screenshots using Selenium IDE Firefox plugin

查看:840
本文介绍了使用Selenium IDE Firefox插件的屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Selenium IDE Firefox插件,我想采取自动截图。
测试脚本包含两行:

 命令:open;目标:http://www.google.com 
命令:captureEntirePageScreenshotAndWait

日志显示:

  [info]执行:| open | http://www.google.com | | 
[info]执行:| captureEntirePageScreenshotAndWait | | |
[error]意外的异常:[Exception ...组件返回失败代码: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 3045data:no]。 toString - >函数toString(){[native code]},message - >组件返回的失败代码:0x80520001(NS_ERROR_FILE_UNRECOGNIZED_PATH)[nsILocalFile.initWithPath],结果 - > 2152857601,名称 - > NS_ERROR_FILE_UNRECOGNIZED_PATH,文件名 - > chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js,lineNumber - > 3045,columnNumber - > 0,内部 - > null,data - > null,位置 - > JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js ::< TOP_LEVEL> :: line 3045

如何获取截图?

解决方案

正确设置文件路径解决了这个问题。路径需要设置如下:

(Windows:)

 命令:captureEntirePageScreenshotAndWait;目标:D:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ / p> 

 命令:captureEntirePageScreenshotAndWait;对象:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\屏幕截图必须存在。


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?

解决方案

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.

这篇关于使用Selenium IDE Firefox插件的屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆