Capybara Ambiguity Resolution

前端 未结 9 1290
轮回少年
轮回少年 2020-12-23 13:59

How do I resolve ambiguity in Capybara? For some reason I need links with the same values in a page but I can\'t create a test since I get the error

Failure/         


        
9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-23 14:42

    The above solution works great but for those curious you can also use the following syntax.

    click_link(link_name, match: :first)
    

    You can find more information here:

    http://taimoorchangaizpucitian.wordpress.com/2013/09/06/capybara-click-link-different-cases-and-solutions/

提交回复
热议问题