Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在页面加载时使用水豚和selenium fire Ajax制作黄瓜_Ajax_Selenium_Cucumber_Bdd_Capybara - Fatal编程技术网

如何在页面加载时使用水豚和selenium fire Ajax制作黄瓜

如何在页面加载时使用水豚和selenium fire Ajax制作黄瓜,ajax,selenium,cucumber,bdd,capybara,Ajax,Selenium,Cucumber,Bdd,Capybara,以下是一个黄瓜故事: @javascript Scenario: Showing the page Given I am a logged in user And there is a member with a site And I go to the home page ..... 加载该主页后,在selenium运行测试浏览器的页面上会有一个通过AJAX填充的下拉列表 $(document).ready(function(){}) 未运行,因此我需要使用的下拉选择不

以下是一个黄瓜故事:

@javascript
Scenario: Showing the page
  Given I am a logged in user
  And there is a member with a site 
  And I go to the home page
  .....
加载该主页后,在selenium运行测试浏览器的页面上会有一个通过AJAX填充的下拉列表

$(document).ready(function(){}) 
未运行,因此我需要使用的下拉选择不存在。有没有办法通过一个步骤强制Selenium为页面加载触发javascript事件

加载页面时,通过AJAX检索有关成员的信息

或者类似的。我需要这个下拉框,但由于应用程序的其他部分使用了导航下拉框,但有时只会有这个额外的下拉框,所以在使用javascript加载它们之后,我无法真正改变这一点

有什么想法吗

编辑: 事实证明,我设置了一些错误的测试数据,这是失败的条件,所以它似乎像往常一样,库是好的,我犯了一个错误,所以似乎这将是好的