user2689342
user2689342

Reputation: 1

How to open link in new tab

Selenium IDE : I am trying to open a link in new tab using controlkey or contextmenu and both commands did not work.
USING CONTROLKEY : 1). verify element present 2)controlkeydown() 3) click link 4) controlkeyup(). when executed, it displays the error unknown command (control key().

USING CONETXTMENU : 1 ) Verify element present 2) contextmenu target link=linkname 3) click target = link

Upvotes: 0

Views: 6955

Answers (2)

JacekM
JacekM

Reputation: 4099

How about extracting href attribute from link and using it to open a new window with separate command?

|storeAttribute | SOME_LOCATOR@href | mylink |

|openWindow | ${mylink} | |

EDIT: more specific example

|open | http://twitter.com | |

|storeAttribute | link=About@href | mylink |

|openWindow | ${mylink} | |

This opens Twitter's About page in new window.

Upvotes: 2

Samit Badle
Samit Badle

Reputation: 86

My advise to you will be to not test this. Both of the items you are trying to test are features of the browser itself and not of the web application. So if your aim is to test the web application, you are not adding any value by testing the browser.

Upvotes: 1

Related Questions