cigstack
cigstack

Reputation: 51

Selenium Edge Python errors auto close Edge browser after test execution

I am trying to test selenium for a solution to auto log into a website but I cant even get Selenium to stay open. It does what it is supposed to do right now and then quits immediately without a driver.quit(). I get the following errors and I wish to understand what they mean:

DevTools listening on ws://127.0.0.1:51111/devtools/browser/111111fe-423z-111zz-1116-r0z2300086f7
[3420:22152:1110/151643.950: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:  

[3420:22152:1110/151644.757:ERROR:fallback_task_provider.cc(119)] Every renderer should have at least one task provided by a primary task provider. If a fallback task is shown, it is a bug. Please file a new bug and tag it as a dependency of crbug.com/739782.
[3420:22152:1110/151647.899:ERROR:fallback_task_provider.cc(119)] Every renderer should have at least one task provided by a primary task provider. If a fallback task is shown, it is a bug. Please file a new bug and tag it as a dependency of crbug.com/739782.
Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos
https://www.yahoo.com/

This is my code:

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

ser = Service("C:\\Users\\Desktop\\Projects\\auto_login\\msedgedriver.exe")
driver = webdriver.Edge(service = ser)
driver.get("http://yahoo.com")
print(driver.title)
print(driver.current_url)

Upvotes: 5

Views: 24203

Answers (4)

Richard Dominguez
Richard Dominguez

Reputation: 1

Maybe kindda late but updating the webdriver with the lastest version solved my issue:

[19204:19348:0902/234717.979:ERROR:edge_auth_errors.cc(523)] 


EDGE_IDENTITY: Get Default OS Account failed: Error: Primary Error: kImplicitSignInFailure, Secondary Error: kAccountProviderFetchError, Platform error: 0, Error string:

Upvotes: 0

Alain Duscher
Alain Duscher

Reputation: 1

I am using Selenium 4.6 with User-agent random

from selenium import webdriver
from selenium.webdriver.edge import service
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from fake_useragent import UserAgent
import os
os.system("cls")



def User():
    
    ua = UserAgent()
    return ua.random


edgeOption = webdriver.EdgeOptions()
edgeOption.add_argument(f'user-agent={User()}')
edgeOption.add_argument("start-maximized")
s=service.Service(r'msedgedriver.exe')
driver = webdriver.Edge(service=s, options=edgeOption)
driver.get("http://whatsmyuseragent.org/")
WebDriverWait(driver, 10)

user = driver.find_element(By.XPATH, "//div[@class='intro-body']/div[@class='container']/div[@class='row']/div[@class='col-md-8 col-md-offset-2'][1]/div[@class='user-agent']/p[@class='intro-text']").text
ip = driver.find_element(By.XPATH, "//div[@class='intro-body']/div[@class='container']/div[@class='row']/div[@class='col-md-8 col-md-offset-2'][2]/div[@class='ip-address']/p[@class='intro-text']").text

print(user)
print(ip)

Upvotes: 0

JerryD
JerryD

Reputation: 169

I found the following code would disable the "DevTools listening on ..." errors (warnings?).

from selenium import webdriver
from selenium.webdriver.edge.options import Options as EdgeOptions

options = EdgeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Edge(options=options)

I am using Selenium 4.5.0 and Edge driver Edge version 105. It is basically the same code used for disabling these types of messages on Chrome drivers.

Upvotes: 6

undetected Selenium
undetected Selenium

Reputation: 193108

The errors you are seeing:

[3420:22152:1110/151643.950: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:  

[3420:22152:1110/151644.757:ERROR:fallback_task_provider.cc(119)] Every renderer should have at least one task provided by a primary task provider. If a fallback task is shown, it is a bug. Please file a new bug and tag it as a dependency of crbug.com/739782.
[3420:22152:1110/151647.899:ERROR:fallback_task_provider.cc(119)] Every renderer should have at least one task provided by a primary task provider. If a fallback task is shown, it is a bug. Please file a new bug and tag it as a dependency of crbug.com/739782.

are the result of a generic bug due to Chrome spawned a child process & Task Manager compatibility which you can ignore as of now. For details check Issue 739782: [Task Manager] [Meta bug ☂️] Processes not shown in Task Manager.

Additionally, some specific python frameworks tends to close the browser automatically when all the lines of the program are executed successfully e.g. Python-Unittest and have no relation with the errors explained above.

Upvotes: 3

Related Questions