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

webdriver should not panic on invalid argument #175

Open
Gentoli opened this issue Jul 8, 2022 · 3 comments
Open

webdriver should not panic on invalid argument #175

Gentoli opened this issue Jul 8, 2022 · 3 comments

Comments

@Gentoli
Copy link

Gentoli commented Jul 8, 2022

thread 'main' panicked at 'unexpected webdriver error; webdriver returned error: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir', C:\Users\<>\.cargo\registry\src\github.com-1ecc6299db9ec823\fantoccini-0.19.1\src\session.rs:585:17

example:

    let mut caps = DesiredCapabilities::chrome();
    caps.set_binary(r"C:\Program Files\Google\Chrome Beta\Application\chrome.exe")?;
    caps.add_chrome_arg(r"--user-data-dir=C:\Users\<>\IdeaProjects\<>\chrome\userdata")?;
    caps.add_chrome_arg("--profile-directory=profile1")?;
    caps.add_chrome_arg("--ignore-certificate-errors")?;

    WebDriver::new("http://localhost:9515", caps).await

version: 0.19.1

@jonhoo
Copy link
Owner

jonhoo commented Jul 14, 2022

Ah, yes, that panic is over here:

panic!("unexpected webdriver error; {}", e);

It's specifically to deal with cases where we get an error from the webdriver host that doesn't conform to the standard as far as we know. It may make sense to just add an error variant specifically for that that we can then propagate instead. cc @stevepryde — what do you think?

@stevepryde
Copy link
Contributor

@jonhoo yep that sounds good to me

@jonhoo
Copy link
Owner

jonhoo commented Jul 14, 2022

@Gentoli I'm a little short on spare time these days, but happy to look at a PR if you have a chance!

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

3 participants