(Click for image)我正在编写一个项目来编写测试登录功能的场景。由于某种原因,水豚不访问动态元素: 重现步骤: 1)访问Redfin.com(例如) 2)单击登录按钮 3)出现动态弹出对话框 4)单击“继续电子邮件“,然后尝试输入详细信息并点击提交。如何使用黄瓜和水豚处理动态元素
我找不到任何带有find(#)的元素,并且无法点击提交或输入详细信息。
另外我相信webapp是用React构建的。 请让我知道如何处理这个。
<div class="emailSignInButtonWrapper" style="position: relative;">
<button class="button Button tertiary emailSignInButton v3" type="button" tabindex="0" data-rf-test-name="submitButton">
<span>
<span class="signInText">Continue with Email</span>
</span>
</button>
我不知道如何代码的样子,一个例子会很好。然而,正如你所提到的,应用程序是用React编写的,我的第一个猜测是使用'js:true'切换到'Capybara.javascript_driver'。你可能会觉得这很有用。 https://github.com/teamcapybara/capybara#drivers – hyphenbash
@hyphenbash对于html代码,您可以访问(redfin.com网站), – user8673269
[切换到黄瓜,水豚的弹出窗口](https:// stackoverflow.com/questions/18983684/switch-to-popup-windows-in-cucumber-capybara) –