When clicking on a button that opens a new window in the edge using selenium, the switch is not happening using the selenium switch to window command.
driver.switchTo().window(newWindow)
On click the new window opens as a new tab but the control comes back to the parent window and while trying to switch to the new window using the handle, it throws the exception:
Inside catch block org.openqa.selenium.InvalidArgumentException: invalid argument: 'handle' must be a string (Session info: MicrosoftEdge=87.0.664.41) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: '199-7-164-187', ip: '199.7.164.187', os.name: 'windows', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: unknown Command duration or timeout: 0 milliseconds