webdriver should not panic on invalid argument
Gentoli opened this issue · comments
Nick commented
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
Jon Gjengset commented
Ah, yes, that panic is over here:
Line 585 in 761a68c
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?
Steve Pryde commented
@jonhoo yep that sounds good to me
Jon Gjengset commented
@Gentoli I'm a little short on spare time these days, but happy to look at a PR if you have a chance!