With Capybara, how do I switch to the new window for links with “_blank” targets?

后端 未结 15 1985
花落未央
花落未央 2020-12-02 09:54

Perhaps this isn\'t actually the issue I\'m experiencing, but it seems that when I \"click_link\" a link with target=\"_blank\", the session keeps the focus on the current w

15条回答
  •  春和景丽
    2020-12-02 10:25

    I had this issue when opening links in an gmail window: I fixed it like this:

    Given /^(?:|I )click the "([^"]*)" link in email message$/ do |field|
    
      # var alllinks = document.getElementsByTagName("a");
      # for (alllinksi=0; alllinksi

提交回复
热议问题