selenium.captureEntirePageScreenshot 不起作用,但 selenium.captureScreenshot 起作用 [英] selenium.captureEntirePageScreenshot does not work but selenium.captureScreenshot works

查看:72
本文介绍了selenium.captureEntirePageScreenshot 不起作用,但 selenium.captureScreenshot 起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Eclipse 和 Selenium RC 通过 TestNG 运行 Selenium.我使用了命令:

I'm running Selenium with TestNG using Eclipse and Selenium RC. I used the command:

selenium.captureEntirePageScreenshot("\\test.png","");

但得到以下错误:

com.thoughtworks.selenium.SeleniumException: ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window.  The error message is: Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsILocalFile.initWithPath]



有人可以建议为什么会发生此错误吗?我已经尝试了以下方法:



Can someone please suggest why this error is occuring? I have already tried the following:

1)用background=#CCFFDD"替换"(字符串kwargs参数)

1)Replaced "" (String kwargs parameter) with "background=#CCFFDD"

2) 以 Chrome 模式在 Firefox 中运行

2)Running in Firefox in chrome mode

3) 将路径更改为以下值,但我仍然收到错误消息:"\test.jpg","c:\test.jpg","c:\test.png","c:\folder1\test.png", (folder1 存在)"c:\folder1\test.jpg",

3)Changed the path to the following values and I'm still getting the error: "\test.jpg", "c:\test.jpg", "c:\test.png", "c:\folder1\test.png", (folder1 exists) "c:\folder1\test.jpg",

4) 尝试过 - selenium.captureScreenshot("\test.png");它工作正常,但不能解决我的目的,我不想使用 awt.

4)Tried with - selenium.captureScreenshot("\test.png"); and it works fine but it does not solve my purpose and I dont want to use awt.

有人可以提出什么问题吗?

Can someone please suggest what could be wrong?

谢谢,
木根

推荐答案

对于任何可能关心的人,.在我不断摆弄代码并重新启动系统后,问题解决了.我开始知道 captureEntirePageScreenshot 仅适用于绝对路径,因此我确保我一直在尝试这样做.

To whomsoever it may concern,. the problem was solved after I kept fiddling with the code for a while and restarted my system. I came to know that captureEntirePageScreenshot works only on absolute paths so I made sure I kept trying with just that.

这篇关于selenium.captureEntirePageScreenshot 不起作用,但 selenium.captureScreenshot 起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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