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 statemen开发者_开发问答t 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,
VamyipSometimes 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?)
精彩评论