Forum Discussion

JoshuaSavage's avatar
JoshuaSavage
Copper Contributor
Nov 13, 2023

Edge v119 vs EdgeDriver v119 for Selenium

A couple weeks ago I was on version 118 for both Edge/Driver and my Selenium code worked. It would bring up Edge, log in the user, maximize the window, navigate, etc.

Last monday Edge was updated to version 119 and it no longer worked. I updated the Edge Driver to match. It still does not work. I get an error message:

 

"Run-Time error '23':

 

NoSuchWindowError

Window not found: no such window: target window already closed from unknown error: web view not found"

 

While the Edge window is still visibly open. I Dim MicroEdge as Object outside the Sub so that it stays open after the process completes. The code below used to work (with or without the .SetCapability part) but now gives the error on the .Window.Maximize line. I've tried skipping to getting a website and it gives the same error.

 

Set MicroEdge = CreateObject("Selenium.EdgeDriver")
With MicroEdge
On Error GoTo SiteHandler

.SetCapability "ms:edgeOptions", "{""excludeSwitches"":[""enable-automation""]}"
.Start
.Wait 1000
.Window.Maximize

 

Anyone else having the same issue or have a solution?

 

Update: If I take out the .SetCapability line and manually select a user at the right speed it will recognize the window and I can pull up a site/maximize the window. Doing this gives more opportunity for human error, and brings back an info bar that will cause problems with some sites as it shifts things down the page. If I leave it in it seems that it processes the user selection too quickly and VBA/Selenium loses track of the window and thinks it's closed.

3 Replies

    • JoshuaSavage's avatar
      JoshuaSavage
      Copper Contributor
      DaveBos
      Just what I put in the update.

      Set MicroEdge = CreateObject("Selenium.EdgeDriver")
      With MicroEdge
      On Error GoTo SiteHandler
      .Start
      .Wait 2000
      .SwitchToWindowByTitle ("New tab")
      .Wait 1000
      .Window.Maximize
      .Wait 500
      .Get insertsitehere

      Then in the site handler it has

      If Err.Number = 23 then
      .Wait 500
      Resume
      End If

      It's been pretty stable doing it that way but it's annoying to have to manually select the user again. It seems like when it uses the SetCapability options it passes too quickly and 'loses track' of the window. Big bummer as not having to select the user was very handy. None of the other things I've tried to include the user profile have worked so far.

Resources