Rogers Jefrey L
Rogers Jefrey L

Reputation: 266

Opening a URL in a new tab using selenium-webdriver in IE

I am using selenium-webdriver to automate browser. I need to open a url in a new tab in selenium. I am currently able to open a new tab using

driver.find_element(:css,'body').send_keys [:control,'t']

But when i try to open an url in the opened tab using driver.get it does not work in ie9. It opens in the previous tab itself. This works fine in chrome and firefox, but not in ie9. Any suggestions please?

Upvotes: 0

Views: 2765

Answers (1)

bbbco
bbbco

Reputation: 1530

There is no current way to do so in WebDriver, but there is a sort of a hack that allows you to do it by injecting an anchor tag with the URL as the src into the DOM and telling WebDriver to click it.

You can refer to this post as I have detailed how to do it in Ruby (the previous example was in Java)

Upvotes: 1

Related Questions