Vrtgs / thirtyfour

Selenium WebDriver client for Rust, for automated testing of websites
Other
1.02k stars 72 forks source link

How to set PageLoadStrategy::None in DesiredCapabilities::chrome()? #199

Closed phw42 closed 5 months ago

phw42 commented 6 months ago

Discussed in https://github.com/stevepryde/thirtyfour/discussions/194

Originally posted by **KirDontsov** February 17, 2024 All of this works: let _ = caps.add_chrome_arg("enable-automation"); let _ = caps.add_chrome_arg("--no-sandbox"); let _ = caps.add_chrome_arg("--disable-extensions"); let _ = caps.add_chrome_arg("--dns-prefetch-disable"); let _ = caps.add_chrome_arg("--disable-gpu"); All of this not works let _ = caps.add_chrome_option("pageLoadStrategy", "NONE"); unexpected webdriver error; webdriver returned error: invalid argument: cannot parse capability: goog:chromeOptions from invalid argument: unrecognized chrome option: pageLoadStrategy let _ = caps.set_version("103"); unexpected webdriver error; webdriver returned error: invalid argument: unrecognized capability: version
stevepryde commented 5 months ago

Resolved in v0.32.0. See the answer to the discussion (pasted below):

--

There's a dedicated method for this:

caps.set_page_load_strategy(PageLoadStrategy::None)?;

Docs here