-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
when if connectExisting passed to driver then args shouldn't include websocketPort #509
Conversation
I am not sure if it is a good idea to just omit the parameter. I would be open to throw a better error message to help the user understand why both parameters can not be set together. |
I pushed new version of fix |
How is this now different from the current behavior? In both cases it would fail with an error warning saying that these two parameters can not be used together, right? |
No, if 2 parameters are given at the same time, an error is given, but if 2 parameters are not given, it automatically assigns 0 to the websocketPort. The problem was that even if connectExisting was given, geckodriver was crashing because 0 was assigned to the websocketPort. This is a throws an error for existing browser connection: const geckoDri = await start({
connectExisting:true,
websocketPort: 5961,
marionettePort: 5960,
port: 5959,
}); Or (problem is here): const geckoDri = await start({
connectExisting:true,
marionettePort: 5960,
port: 5959,
}); It is a right usage for new browser launching: const geckoDri = await start({
websocketPort: 5961,
marionettePort: 5960,
port: 5959,
}) If you connecting to existing browser, library shouldnt pass automatically websocketPort 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying and providing the patch
LGTM 👍
a4acdea
into
webdriverio-community:main
Hey b68h4 👋 Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. Please make sure to check your spam folder as well. If you have any questions, feel free to reach out to us at [email protected] or in the contributing channel on Discord. We are looking forward to more contributions from you in the future 🙌 Have a nice day, |
./geckodriver: error: the argument '--websocket-port <PORT>' cannot be used with '--connect-existing'
If connectExisting and websocketPort passed same time to geckodriver cause crash because driver can't initialize websocket socket on existing browser
It's a minimal fix. I'm open to typo commits or other suggestions