WebUi.sendKeys(findTestObject(‘object’), Keys.chord(Keys.CONTROL, ‘T’))
And don’t forget to add import org.openqa.selenium.Keys as Keys
Don’t know if it will work, but you can also do it using js f.e. js.executeScript(‘window.open();’)
Than just WebUI.switchToWindowIndex(window + 1)
(where ‘window’ is int window = WebUI.getWindowIndex() whitch gives you an index of your current tab opened)
Regards
Different question should be in separate topic on forum.
SandKeys can couse a problem sometimes - i read on the forum about that.
I see 2 solutions to that:
Use runScript with JS code openning new tab.
Click an element/link on page witch open something in new tab and then work on this new tab. You can add open command then so it will open adress in thid new tab.
For me it works but it’s open new window and then new tab not just new tab in current window. I have to let open pop-ups in this new window. If you run this code and it’s open new window llok at address bar of ypur browser there should be a meesage that it want to open pop-up, just click on it and let it always open popup.
With runScript it opens two new google.com tabs, but when i use addScript i opens just one new tab.