Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium runs indefinitely when adding add_experimental_option('debuggerAddress',address) #108

Open
danepadley opened this issue Jun 2, 2023 · 0 comments

Comments

@danepadley
Copy link

Running selenium == 4.9.1 on windows machine.

The code that I'm running:
chrome_options = Options()
chrome_options.add_argument(r"--user-data-dir=C:\Users\user.name\AppData\Local\Google\Chrome\User Data")
chrome_options.add_argument(r'--profile-directory=Default')
chrome_options.add_experimental_option('debuggerAddress', 'localhost:9014')
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()),options=chrome_options)

If I run the code above without the experimental options I have no issues, but will have to close any opened Chrome windows. When I run with the experimental option, it will work 50% of the time. The other 50% of the time the script will run indefinitely and doesn't throw any errors.

I have tried adding
os.environ["DBUS_SESSION_BUS_ADDRESS"] = "/dev/null"
But this didn't change anything.

When I look at the port, I can see that the chromedriver is running, but it doesn't open the chrome tab and keeps running indefinitely.

When I run it with the trace printing to the command prompt, after around 5 minutes it stops at this:
--- modulename: client, funcname: begin
client.py(312): if self.headers is not None:
client.py(317): while True:
client.py(318): version, status, reason = self._read_status()
--- modulename: client, funcname: _read_status
client.py(279): line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
--- modulename: socket, funcname: readinto
socket.py(700): self._checkClosed()
socket.py(701): self._checkReadable()
--- modulename: socket, funcname: readable
socket.py(734): if self.closed:
socket.py(736): return self._reading
socket.py(702): if self._timeout_occurred:
socket.py(704): while True:
socket.py(705): try:
socket.py(706): return self._sock.recv_into(b)

I have included a link to the full trace output if that helps.
selenium_issue.txt

Expected behaviour
Have selenium open at debugger address everytime with no issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant