![](https://learn.microsoft.com/media/logos/logo_edge.png)
Hi @RJ RD
I suggest that you use Selenium 4 alpha version which can be downloaded in this page. You also need to use the same version of Edge WebDriver as your Edge browser which can be downloaded in this page.
I use Selenium 4.0.0-alpha05 and the code below, it can work well:
System.setProperty("webdriver.edge.driver", "your_path_to_edge_webdriver\\msedgedriver.exe");
WebDriver driver = new EdgeDriver();
driver.get("https://www.somesite.com");
// Store the current window handle
String winHandleBefore = driver.getWindowHandle();
// Perform the click operation that opens new window
// Switch to new window opened
for(String winHandle : driver.getWindowHandles()){
driver.switchTo().window(winHandle);
}
// Perform some actions on new window
// Switch back to the first window
driver.switchTo().window(winHandleBefore);
Note: Please change the path and url in the code to your owns.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Regards,
Yu Zhou