Jquery 单击不使用Cucumber Phantomjs的方法

Jquery 单击不使用Cucumber Phantomjs的方法,jquery,css,phantomjs,cucumber,capybara,Jquery,Css,Phantomjs,Cucumber,Capybara,最近我看到了一个wired问题,对于一个特定的CSS,.click方法不适用于phantomJS webdriver。使用铬合金可以很好地工作。我使用下面的代码通过SITEPRISM点击它 @page = someclass.new @page.wait_for_fld_element_rows(30) @page.fld_element_rows.first.click 我看到它可以在chrome和其他驱动程序中始终单击,但不能在phantomjs中单击。我正在为phantomjs使用以下配

最近我看到了一个wired问题,对于一个特定的CSS,.click方法不适用于phantomJS webdriver。使用铬合金可以很好地工作。我使用下面的代码通过SITEPRISM点击它

@page = someclass.new
@page.wait_for_fld_element_rows(30)
@page.fld_element_rows.first.click
我看到它可以在chrome和其他驱动程序中始终单击,但不能在phantomjs中单击。我正在为phantomjs使用以下配置:

Capybara::Selenium::Driver.new(app, :browser => :phantomjs,     
desired_capabilities: { 'phantomjs.cli.args' => ['--ignore-ssl-errors=yes'] 

PhantomJS1.9.x缺少许多现代JS框架所依赖的东西。当PhantomJS在其他浏览器中工作时,JS行为不会发生在PhantomJS上的常见原因是缺少Function.prototype.bind。你可以用多边形填充,但将PhantomJS升级到>=2.1.x确实是一个更好的主意,它比1.9.x版本更稳定,更接近现代浏览器。

这里有两件事你可以尝试:

1st) You can upgrade to phantomjs 2.1.1 (latest) as this is more stable version. 
或者


它给出了什么错误?什么版本的phantomjs?你没有对你正在使用的phantomjs版本做出回应,但我猜是1.9.x,它不支持现代浏览器的很多功能。尝试更新到phantomjs 2.1.xRight--1.9.8是一个古老的版本,不支持Function.prototype.bind,这是当今许多JS框架所依赖的。您可以在1.9.x中多填充它,但是更新到2.1.x确实是一个更好的主意,2.1.x本机支持它以及1.9.x分支中缺少的许多其他功能
2nd) Not-clicking Issue might happenned because of the ajax req. You can use retry with in rescue block and try to click again which may solve this issue.