硒通过Capybara没有加载页面与jQuery dataTables 1.10.0 [英] Selenium through Capybara not loading page with jQuery dataTables 1.10.0

查看:174
本文介绍了硒通过Capybara没有加载页面与jQuery dataTables 1.10.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天通过 https://将jQuery 1.9.2升级到1.10.0 github.com/rweng/jquery-datatables-rails 宝石。我执行了所有的升级步骤,所有的工作现在在界面中按预期。我在Chrome和Firefox 30上都进行了测试。然后我去运行我们的规范,涵盖这些,并且capybara会随着数据表在页面上保持超时。我已经尝试了我可以想到的一切,试图让页面加载完整。通过浏览器进行测试时,我看不到测试日志中没有错误,也没有发生JavaScript错误。截图返回,因为表仍在加载。




  • 我可以做些什么来进一步调试为什么不加载页面? li>
  • 是否有一个常见的修复,因为刚刚从jQuery 1.9.2升级到1.10.0



<我弄清楚是什么导致了这个问题。我更新了我的javascript初始化为dataTable停止使用fnServerData和使用新的ajax:'whatever.txt'设置回来使用fnServerData和恢复逻辑背后使用旧的GET参数现在已经修复了。我仍然想知道是否可以用ajax方式修复水豚,因为正在传递的参数现在更有意义,更容易处理。



任何建议将会很棒。

解决方案

请参阅 https://github.com/jnicklas/capybara/issues/1467



问题是与长uri当使用GET请求时。如在评论中看到的那样,您可以使用thin作为服务器来解决问题,但我只是将我的请求更改为POST而不是GET,现在对我来说可以正常工作。


I upgraded our dataTables today from jQuery 1.9.2 to 1.10.0 through the https://github.com/rweng/jquery-datatables-rails gem. I performed all of the upgrade steps and everything works out now in the interface as expected. I tested this both on Chrome and Firefox 30. I then went to run our specs that cover those and capybara keeps timing out whenever it goes to the page with the dataTables on it. I have tried everything I can think of to try to get the page to load fully. I see no errors coming through the test log and no javascript errors when testing through the browser. The screenshot comes back as the table is still loading.

  • What can I do to further debug why the page isn't loading?
  • Is there a common fix as it just happened after upgrading from jQuery 1.9.2 to 1.10.0

I figured out exactly what was causing the issue. I updated my javascript initialization for the dataTable to stop using fnServerData and to use the new ajax: 'whatever.txt' Setting that back to use fnServerData and reverting the logic behind to use the old GET parameters has fixed it for now. I still want to figure out if it's possible to fix capybara with the ajax way as the params being passed now make a lot more sense and are easier to handle.

Any suggestions would be great.

解决方案

See the issue at https://github.com/jnicklas/capybara/issues/1467

The issue is with the long uri when using a GET request. As seen in the comments, you can use thin as the server to resolve the issue, but I simply just changed my request to a POST instead of a GET and now things work fine for me.

这篇关于硒通过Capybara没有加载页面与jQuery dataTables 1.10.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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