水豚 +硒
当我使用 Selenium 运行测试时,我的一步失败了,页面在浏览器中看起来像这样:
Internal Server Error
can't convert nil into String
WEBrick/1.3.1 (Ruby/1.9.2/2010-08-18) at 127.0.0.1:50752
当我用 culerity 运行它时,我得到输出:
Broken pipe (Errno::EPIPE)
/Users/yuval/.rvm/gems/ruby-1.9.2-p0/gems/culerity-0.2.15/lib/culerity/remote_object_proxy.rb:47:in `write'
etc...
当我在没有 js 驱动程序的情况下运行它时,它不会失败完全没有这一点(相反,它在使用 js 时失败,这就是为什么我尝试使用 js 驱动程序运行它)。
有什么想法吗?
When I run my tests using Selenium, my one step fails and the page looks like this in the browser:
Internal Server Error
can't convert nil into String
WEBrick/1.3.1 (Ruby/1.9.2/2010-08-18) at 127.0.0.1:50752
When I run it with culerity instead, I get the output:
Broken pipe (Errno::EPIPE)
/Users/yuval/.rvm/gems/ruby-1.9.2-p0/gems/culerity-0.2.15/lib/culerity/remote_object_proxy.rb:47:in `write'
etc...
When I run it without a js driver, it doesn't fail at that point at all (instead, it fails at a point when js is used, which is why I'm trying to run it with a js driver).
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚遇到同样的问题,但找到了解决方案。
如果您尝试在开发模式下使用“http://127.0.0.1:3000”而不是“http://localhost:3000”打开浏览器,您应该面临同样的问题。
就我而言,问题是由于在我的视图文件中使用的“request.domain”而引起的,如果请求以类似IP的格式给出,即“http://127.0.0.1:50752”,则返回nil。
因此,如果您认为辅助方法中的某个地方有类似的内容,
您可以将其更改为使用辅助方法,如下所示:
和如下辅助方法:
这是对我有用的最简单的解决方案。也许,你也有类似的事情。
I just faced te same problem, but found a solution.
If you try to open your browser with "http://127.0.0.1:3000" in development mode, instead of "http://localhost:3000", you should face the same problem.
In my case the problem was caused, because in my View file I used "request.domain" that returns nil if request is given in IP-like format, i.e. "http://127.0.0.1:50752".
Therefore, if somewhere in your view of helper methods you have something like this
you can change it to using helper method, like that:
And helper like following:
That's the easiest solution that worked for me. Perhaps, you have something similar.