Comments (4)
Please show the rust code you're using for the connection as well
from thirtyfour.
from thirtyfour.
There's no image attached. Please just paste the code as text
from thirtyfour.
I've tried with selenium docker images like this:
docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.9.1-20230508
Then connecting like this works:
let caps = DesiredCapabilities::chrome();
let driver = WebDriver::new("http://localhost:4444", caps).await?;
When I tried with the debian image like your dockerfile I get this:
0: error creating new session: webdriver server gave non-conformant response: Object {"error": String("unknown error"), "message": String("unknown error: Chrome failed to start: exited abnormally.\n (unknown error: DevToolsActivePort file doesn't exist)\n (The process started from chrome location /usr/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)"), "stacktrace": String("#0 0x55b68ab4b2c3 <unknown>\n#1 0x55b68a86fca8 <unknown>\n#2 0x55b68a899e3b <unknown>\n#3 0x55b68a895bc8 <unknown>\n#4 0x55b68a8dc4be <unknown>\n#5 0x55b68a8d3eb3 <unknown>\n#6 0x55b68a8a0d7e <unknown>\n#7 0x55b68a8a2112 <unknown>\n#8 0x55b68ab19bf6 <unknown>\n#9 0x55b68ab1d93d <unknown>\n#10 0x55b68ab1d3d6 <unknown>\n#11 0x55b68ab1dde5 <unknown>\n#12 0x55b68ab245bb <unknown>\n#13 0x55b68ab1e166 <unknown>\n#14 0x55b68aaf3a96 <unknown>\n#15 0x55b68ab37a25 <unknown>\n#16 0x55b68ab37bce <unknown>\n#17 0x55b68ab4581f <unknown>\n#18 0x7f79442c3ea7 start_thread\n"), "data": Null}
So I googled and it turns out you need the --no-sandbox
option enabled.
So this code works (which is roughly equivalent to the python code you posted):
let mut caps = DesiredCapabilities::chrome();
caps.set_no_sandbox().unwrap();
caps.set_disable_dev_shm_usage().unwrap();
caps.set_headless().unwrap();
let driver = WebDriver::new("http://localhost:9515", caps).await?;
from thirtyfour.
Related Issues (20)
- `#shadow-root` doesn't work on Firefox with geckodriver HOT 1
- Connection refused when using containers HOT 4
- How to use selenium-manager in my code? HOT 2
- thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: received unknown error (no such frame) for NOT_FOUND status code' HOT 4
- How can I set the user-agent for Chromedriver? HOT 3
- Is there a way to use wait_until or something like it to way for a specific ID to be available ? HOT 2
- wait until element to disappear HOT 6
- Chrome Options example erroring HOT 2
- Does `query` work on child elements? HOT 3
- Cannot interact with WebElement HOT 1
- How to trigger onchange event without submitting the form? HOT 2
- How to set PageLoadStrategy::None in DesiredCapabilities::chrome()? HOT 1
- Running the Test without Existing Browser (HtmlUnitDriver) HOT 1
- Add cdp type from auto_generate_cdp crate HOT 2
- How to handle file picker? HOT 4
- How to capture the Chromium's requests and responses traffic using thirtyfour HOT 5
- Maintenance Status
- Device Farm incompatibility - with workaround
- Chromedriver - http incompatibility with hyper HOT 3
- Incompatible with Selenoid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thirtyfour.