Controlling new tab to operate using Watir? (Ruby)
问题 I'm using watir for automated testing and after running through some tables, a chart then gets opened up in a new tab. But watir doesn't seem to recognise the new current tab and continues to search through the original browser tab. Is there any way of telling watir which tab you want to be using? 回答1: Watir does not care if a new page opens in a new window or in a new tab, so use window switching API to switch to the new tab: browser.window(:title => "annoying popup").use do browser.button(