如何在Capybara w /硒中使用ruby-debug [英] How do I use ruby-debug in Capybara w/ selenium

查看:192
本文介绍了如何在Capybara w /硒中使用ruby-debug的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有Capybara使用硒驱动程序,但是当我尝试在一个步骤中使用'debugger'不工作。

We have Capybara working with the selenium driver but when I try to use 'debugger' inside a step it doesn't quite work.

在调试控制台中输入page工作,但输入page.body挂起。

e.g. in the debug console entering 'page' works but entering 'page.body' hangs.

当试图使用akephalos驱动程序使用调试器时,我们也有奇怪。使用akephalos,我们不能输入调试提示...实际上我们可以,但你必须打几次键,一封信会随机出现在终端。做一个'Ctrl-C'让我们输入,但我们得到错误,如'DRB连接...的东西'(对不起没有确切的错误了。)

We also had weirdness when trying to use debugger with the akephalos driver. With akephalos we couldn't type in the debug prompt... well actually we could but you had to hit the key several times before a letter would randomly show up in the terminal. Doing a 'Ctrl-C' let us type but we got errors like 'DRb connection ...something' (sorry don't have the exact error anymore).

我认为问题是驱动程序像硒和akephalos运行测试和服务器在同一个进程,它困惑ruby-debug。我将尝试单独运行服务器(脚本/服务器测试),并使用Capybara.app_host ='http:// localhost:3000',看看是否会有所作为。我尝试使用akephalos,但没有得到任何地方,因为它只是启动另一个进程中的服务器。

I think the problem is that drivers like selenium and akephalos run the tests and a server in the same process and it confuses ruby-debug. I'm going to try running the server separately (script/server test) and use Capybara.app_host = 'http://localhost:3000' to see if that will make a difference. I tried that with akephalos but didn't get anywhere since it just launched another in-process server anyway.

有任何人使用ruby-debug与Capybara和硒?这是为其他人工作吗?我缺少明显的东西吗?

Is there anyone out there using ruby-debug with Capybara and selenium? Is this working for anyone else? Am I missing something obvious?

推荐答案

设置Capybara.app_host ='http:// localhost:3000',并在另一个进程中运行脚本/工作。

Setting Capybara.app_host = 'http://localhost:3000' and running script/server -e test in another process worked.

这篇关于如何在Capybara w /硒中使用ruby-debug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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