Selenium RC - selenium-browserbot.js 错误
我正在用 C# 编写一些自动化测试,当我尝试单击将提交对 Web 表单所做的更改的按钮时,会引发 JavaScript 错误。我收到的错误是:
An error has occured in the script on this page
Line: 2004
Char: 9
Error: Permission denied
Code: 0
URL: file:///C:/DOCUME~1/nkinney/LOCALS~1/Temp/customProfileDir6c0c7d7226cc463fbb1a7f6253c4df62/core/scripts/selenium-browserbot.js
测试完成后,如果我在 selenium 运行时手动单击按钮,仍然会显示错误。
硒中选择此按钮的行是:
selenium.Click("//input[contains(@id, 'SubmitBtn')]");
我也尝试过提交。
应显示一个弹出窗口,要求用户确认他们想要进行更改。在显示弹出窗口之前和 Selenium“单击”按钮之后抛出此错误。
任何建议将不胜感激。
I'm writing some automated tests in C# and a JavaScript error is thrown when I try to click on a button that will submit changes made to a web form. The error I am recieving is:
An error has occured in the script on this page
Line: 2004
Char: 9
Error: Permission denied
Code: 0
URL: file:///C:/DOCUME~1/nkinney/LOCALS~1/Temp/customProfileDir6c0c7d7226cc463fbb1a7f6253c4df62/core/scripts/selenium-browserbot.js
Once the test is finished, the error will still be displayed if I manually click on the button while selenium is running.
The line in selenium to select this button is:
selenium.Click("//input[contains(@id, 'SubmitBtn')]");
I've also tried submit.
A pop-up should be displayed asking the user to confirm they want to make the changes. This error is thrown before the pop-up is displayed and after Selenium 'clicks' on the button.
Any advise would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
经过进一步调查,我发现 Selenium 无法使用自定义模式对话框。也就是说,我认为我无法在当前版本中使用 Selenium 来自动化 UI 测试。感谢所有看过这篇文章的人。
After further investigation, I found that Selenium is unable to work with custom modal dialog boxes. That said, I don't think I will be able to use Selenium to automate UI testing in our current release. Thanks to anyone who looked at this post.
来自 Selenium 常见问题解答
您是否可以选择查看测试是否在其他浏览器(Firefox、Chrome)中运行?
这里也有一个非常相似的答案: How do I test modaldialogs with Selenium ?
From the Selenium FAQ
Do you have the option of seeing if the test runs in another browser (Firefox, Chrome)?
A very similar answer is also here: How do I test modal dialogs with Selenium?