How to switch to parent tab to the new tab and open a new URL on Chrome Browser?
I want to access a new URL after opening the new tab so I have written the code as below but I am able to open the new tab and the system is opening the second URL in the parent window but not on the second tab?
getDriver().get("http://www.google.com");
String EsatwindowHandle = getDriver().getWindowHandle();
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_T);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_T);
Thread.sleep(5000);
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyRelease(KeyEvent.VK_TAB);
getDriver().get("https://in.yahoo.com");