When I open new tab on IE, I can't handle this. How to handle new IE tab and navigate to the url?
I use Ctrl+T
When I open new tab on IE, I can't handle this. How to handle new IE tab and navigate to the url?
I use Ctrl+T
You can use:
driver.switchTo().window()
Using JavaScriptExecutor
is generally not recommended.
You should have a look at this question and try Turning on Compatibility Mode.
Also, have a look at this answer for general info on using Selenium with IE.
Hope this helps!
Try with JavaScript executor,
JavascriptExecutor js = (JavascriptExecutor) driverInstance;
js.executeScript("window.open(arguments[0], 'blank')", null):
Try to refer line of code may help to switch tabs.
//Switching between tabs using CTRL + tab keys.
driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL +"\t");
//Switch to current selected tab's content.
driver.switchTo().defaultContent();
for more information you can refer links below.
(1) How To Open Tab And Switching Between Tabs In Selenium WebDriver