I have a button that opens a link in a same window, but I need to open it in a separate tab by doing some scripting. I am working in Ruby and here is my code:
Given /^User clicks on the New User Link$/ do
page.driver.browser.switch_to.window (page.driver.browser.window_handles.last)
find(:xpath, "//*[@id='slideshow']/div[1]/div/a/img, ").click
end
This code won't work for me. Please let me know if you see anything wrong in this code.