How to open link in new tab

自作多情 提交于 2019-12-12 05:09:54

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/18273307/how-to-open-link-in-new-tab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!