1

In an automatic test using selenium, I want to start edge and execute various operations automatically. However, the following error is returned when the test is executed. For a moment, the edge stands up, but it quickly disappears. I'd like to write code that doesn't get an error and the browser doesn't disappear after the test is complete. Can someone help me?

error message

[3556:12704:0223/163858.678:ERROR:edge_auth_errors.cc(387)] EDGE_IDENTITY: Get Default OS Account failed: Error: Primary Error: kImplicitSignInFailure, Secondary Error: kAccountProviderFetchError, Platform error: 0, Error string:

from selenium import webdriver
edge = webdriver.Edge(executable_path="C:\Python37\msedgedriver.exe")
edge.get("https://www.google.co.jp/")
  • I run your code and reproduce the error but the browser runs well, it doesn't disappear. Which version of Edge, Edge WebDriver and selenium are you using? After executing which line of code does the browser disappear? For the error, I think you can just ignore it. You can refer to the answer of [this thread](https://stackoverflow.com/questions/69919930/selenium-edge-python-errors-auto-close-edge-browser-after-test-execution) for more information. – Yu Zhou Feb 24 '22 at 06:42
  • Thanks for trying! Edge version is 96.0.1054.62. WebDriver is for Edge 96.0.1054.62. Selenium version is 3.141.0. Python version is 3.7. As you say, browser disappears after executing. – 櫻井 達也 Feb 24 '22 at 10:51

1 Answers1

0

I use Edge and WebDriver version 98.0.1108.62, Selenium version 4.1.1 and Python version 3.9.5. Could you please try to update your Edge, Edge WebDriver and Selenium to the latest versions and try again?

Selenium 3 needs Selenium Tools for Microsoft Edge, but Selenium 4 doesn't need. You can refer to this doc about how to use Selenium 4 to automate Edge.

Sample code:

from selenium import webdriver
from selenium.webdriver.edge.service import Service

ser = Service("C:\\Python37\\msedgedriver.exe")  # Here you specify the path of Edge WebDriver
driver = webdriver.Edge(service = ser)
driver.get("https://www.google.co.jp/")

For the error you mentioned, I think you can just ignore it and refer to the answer of this thread for more information.

Yu Zhou
  • 11,532
  • 1
  • 8
  • 22