2

I am writing automated tests to verify that my website works as expected on Microsoft's Edge browser. As a part of my testing, I need to set focus on another window, and then reset the focus back onto the Edge browser.

With other browsers, I can use Set-WindowActive or SetForeGroundWindow, but neither of those work for Edge. For example, the following code works on any other browser, but does NOT work with MS Edge:

$IE = Get-Process iexplore
Select-Window $IE | Set-WindowActive

I believe this is because other browsers are desktop applications, but Edge uses the Metro app interface instead. How can I set focus on a Metro/Win10 style app using powershell?

Flopdong
  • 259
  • 1
  • 3
  • 15
  • Possible duplicate of [How to run a Metro-App from PowerShell on Windows 8?](http://stackoverflow.com/questions/10984786/how-to-run-a-metro-app-from-powershell-on-windows-8) – Paul Sweatte Aug 30 '16 at 21:33

0 Answers0