我使用Rspec的和水豚的链接。如何点击图片为使用RSpec的和水豚
我如何写一个步骤,点击图片?我一直无法找到一个很好的方式让水豚看到图像作为链接。
感谢
HTML<a title="inGroups" href="/de/users/index/roles-list/serviceID/1112/inGroup/1">
<img border="0" alt="inGroups" src="/themes/system/images/icon/16/role_activate.png">
<a title="inGroups" href="/de/users/index/roles-list/serviceID/1114/inGroup/1">
<img border="0" alt="inGroups" src="/themes/system/images/icon/16/role_activate.png">
<a title="notInGroups" href="/de/users/index/roles-list/serviceID/1112/inGroup/0">
<img border="0" alt="notInGroups" src="/themes/system/images/icon/16/role_deactivate.png">
<a title="notInGroups" href="/de/users/index/roles-list/serviceID/1114/inGroup/0">
<img border="0" alt="notInGroups" src="/themes/system/images/icon/16/role_deactivate.png">
任何建议的
实例?
您正在使用哪种驱动程序?这听起来很合理,但'水豚:: ElementNotFound: 无法找到的XPath “一[包含(@ HREF, '1114 /内群/ 1')]” #(EVAL):2:'找到”' –
我只是编辑XPath来包括“//”前缀 - 尝试 –
真棒!男人,你又救了我......非常感谢:) –