selenium.common.exceptions.WebDriverException: Message: unknown error: net::ERR_CONNECTION_REFUSED
Asked Answered
C

1

6

I am using Selenium. My application shows an error page. It throws the following error:

    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: net::ERR_CONNECTION_REFUSED
  (Session info: chrome=104.0.5112.102)
Stacktrace:

This is my code

    from selenium import webdriver 

driver = webdriver.Chrome('C:path/in/the/pc/chromedriver_win32/chromedriver.exe')    ## to initialize the webdriver to the Selenium 
driver.get('http://127.0.0.1:5000/base')

How can I resolve the above error?

Churchless answered 20/8, 2022 at 16:50 Comment(0)
B
5
driver.get('http://127.0.0.1:5000/base')

make sure 'http://127.0.0.1:5000/base' you can reach this with chrome, nothing wrong with your code just try another link.

driver.get('https://www.google.com/')

hope it can solve your problem

Balneal answered 20/8, 2022 at 17:2 Comment(5)
thanks Charles for your answer, it work with the google url but note my app urlChurchless
the problem is that the two file are in the same project so i can't run the app file and the test file together. however it's true that that link don't work wen the test is running so what i do ?Churchless
maybe you can try async but if you want to keep it simple just split your projectBalneal
how to do that you mean have two folder ?Churchless
Because in the tutorial it work just fine ven they are in the same folder and the app file won't runningChurchless

© 2022 - 2024 — McMap. All rights reserved.