selenium-rc 无法连接到远程服务器

发布于 2024-09-10 17:13:41 字数 309 浏览 14 评论 0原文

我昨天遇到了一个奇怪的问题。我使用 selenium-rc 和 C# 来编写测试脚本。昨天,我第一次开始收到错误“无法连接到远程服务器”。它似乎随机出现在代码的任何部分。例如,错误是在语句 selenium.setspeed(2000); 处触发的。在另一个脚本中,它在断言语句处触发。如果问题是关于与 selenium 服务器的连接,那么为什么它会执行其他 selenium 命令并仅在某些特定语句处抛出错误。如果您需要有关该错误的更多具体信息,请告诉我。

以前有人处理过类似的错误吗?任何这方面的帮助将不胜感激。

谢谢和问候,
瓦米普

I've run into a weird problem yesterday. I am using selenium-rc along with C# to write test scripts. For the first time, yesterday, I started getting the error "Unable to connect to remote server". It seems to occur randomly at any part of code. e.g. The error is triggered at the statement selenium.setspeed(2000);. In another script, it triggered at an assert statement. If the problem was regarding connection to selenium server, then why would it execute other selenium commands and throw the error at some specific statements only. Please let me know if you need more specific information regarding the error.

Has anyone dealt with similar errors before?? Any help in this direction would be appreciated.

Thanks and Regards,
Vamyip

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

絕版丫頭 2024-09-17 17:13:42

有时,由于页面加载,会出现看似随机的 Selenium 错误。例如,单击导致页面转换的内容,然后再次单击。根据页面加载的速度,如果第二次单击操作突然发生,那么当有一些加载时,您可能会遇到错误。如果第二个命令是 waitForPageToLoad(),甚至可能会发生这种情况。解决方案通常是在所有可能导致转换的操作之后立即建立一个短暂的睡眠。

在这些情况下抛出的错误通常有些模糊和误导性。如果您运行并在几个页面中收到此错误,您可以跟踪每次失败之前发送的上一个命令吗? (在这种情况下,您在 selenium.setspeed() 之前调用了什么?)

Sometimes seemingly random Selenium errors will arise due to page load. For instance, clicking on something that causes a page transition and then clicking again. Depending on how fast the page loads, you might encounter an error when there is some load if that second click action jumps the gun. This can even happen if the second command is a waitForPageToLoad(). The solution is often to just build in a short sleep immediately after all actions that can cause transitions.

The errors that get thrown in these situations are often somewhat vague and misleading. If you run and get this error in a handful of pages, can you track the previous command sent before each failure? (what did you call right before selenium.setspeed() in this instance?)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文