Can someone help me with what is wrong with the below code. My intention is to be able to open a new tab in the browser. The script passes, but doesn't really open a new tab
require 'selenium-webdriver'
@browser = Selenium::WebDriver.for :chrome
@browser.navigate.to "http://www.google.com"
body = @browser.find_element(:tag_name => 'body')
body.send_keys(:control, 't')
p "total number of windows"
p @browser.window_handles.length
p "printing window ids"
@browser.window_handles.each do |window|
p window
end
@browser.quit