[🐛 Bug]: PySelenium doesn't support a named pipe as a log file
See original GitHub issueWhat happened?
As part of OpenWPM we use Selenium to drive multiple Firefox browsers in parallel.
To capture, enrich and redirect the browser’s logging output, we use named pipes that look like normal log files to Selenium.
However pipes don’t support seeking so the need to be opened with w
and not with a+
as the firefox.Service
currently does. We have previously monkeypatched this but that approach has led to us breaking every time a new Selenium release comes out. A newer approach that tries to call firefox.Service.__init__
and open the log_file
afterwards doesn’t work at all, so I wanted to check if there was an appetite to address this issue upstream.
How can we reproduce the issue?
import os
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.service import Service
pipe_name = "selenium_pipe.log"
os.mkfifo(pipe_name, 0o600)
service=Service(executable_path="firefox",log_path=pipe_name)
driver = Firefox(
service=service
)
driver.get("https://example.com")
Relevant log output
File "/home/vringar/selenium_mvp/demo.py", line 9, in <module>
service=Service(executable_path="firefox",log_path=pipe_name)
File "/home/stefan/.conda/envs/openwpm/lib/python3.10/site-packages/selenium/webdriver/firefox/service.py", line 50, in __init__
log_file = open(log_path, "a+") if log_path else None
io.UnsupportedOperation: File or stream is not seekable.
Operating System
Linux
Selenium version
Python 4.1.0
What are the browser(s) and version(s) where you see this issue?
Firefox 100
What are the browser driver(s) and version(s) where you see this issue?
GeckoDriver 0.30.0
Are you using Selenium Grid?
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Broken pipe error selenium webdriver, when there is a gap ...
This bug originates from newly added support in v 0.21 of Keep-Alive feature. However, the default timeout from geckodriver in 0.21 is set ......
Read more >Chrome Driver Issue while executing Selenium Tests
Hi all, I am executing some Selenium tests and I am getting the below error now.It was working fine until yesterday with same...
Read more >Common Error Messages - Sauce Labs Documentation
The most common causes for this error are either unresponsive JavaScript in your app, or a bug in Selenium/Appium. A less common, but...
Read more >Robot Framework User Guide
The official RPA support was added in Robot Framework 3.1. This User Guide still talks mainly about creating tests, test data, and test...
Read more >Local testing errors and troubleshooting | BrowserStack Docs
... Local Testing with BrowserStack, you may encounter the following error: ... Key set in the test script and the BrowserStack Local binary...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @vringar seems ok to me, we could expose the
mode
to the user too to simplify the solution but your proposal seems ok to me tooDone
I have done that in the PR. Should I do it here as well?