How to open a new tab in same browser using robot frame work

家住魔仙堡 提交于 2019-12-06 02:45:28
That1Guy

It's sloppy, but you can try:

from selenium.webdriver.common.keys import  Keys 

actions.key_down(Keys.CONTROL)
element.send_keys('t')
actions.key_up(Keys.CONTROL)

I'm not aware of a browser-agnostic method.

After opening a new tab you can change tabs by finding the window handle with driver.window_handles and switching to the appropriate handle: browser.switch_to_window(handle)

You can try

Execute Javascript    window.open('')
Get Window Titles
Select Window    title=undefined
Go To   ${URL}

This Code helps to Open New tab in the same browser and collect the Windows Title of all tabs in same browser. Based on the Window Title name , it identifies the Newly opened tab and launch the URL

YS Kumar

You can use an AutoIt Library For Simulating KeyStroke in Robot Frame Work

Import AutoItLibrary
Import Selinium2library

send  "^t"  Open the New Tab

same way simulate others

Ctrl+Tab – Switch to the next tab – in other words, the tab on the right. (Ctrl+Page Up also works, but not in Internet Explorer.)

Ctrl+Shift+Tab – Switch to the previous tab – in other words, the tab on the left. (Ctrl+Page Down also works, but not in Internet Explorer.)

Ctrl+W, Ctrl+F4 – Close the current tab.

Ctrl+Shift+T – Reopen the last closed tab

Mcvires

You can use the Javascript Keyword

Execute Javascript   window.open('NewTabUrl');

Example:

Execute Javascript   window.open('https://www.google.com');
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!