Skip to content

Commit 66414dd

Browse files
committed
Request w3c compliance from chrome driver
By default chromedriver is NOT compliant with the w3c spec. But one can request w3c compliance with a capability extension included in the new session command payload.
1 parent 75ccf17 commit 66414dd

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ extern crate serde;
1616
use serde::Serialize;
1717
use serde::de::DeserializeOwned;
1818

19+
#[macro_use]
1920
extern crate serde_json;
2021
pub use serde_json::Value as JsonValue;
2122

src/messages.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ pub struct NewSessionCmd {
4343
impl NewSessionCmd {
4444
pub fn new() -> Self {
4545
NewSessionCmd {
46-
capabilities: JsonValue::Object(Map::new()),
46+
capabilities: json!({
47+
"alwaysMatch": {
48+
// ask chrome to be w3c compliant
49+
"goog:chromeOptions": {
50+
"w3c": true
51+
}
52+
}
53+
}),
4754
desiredCapabilities: JsonValue::Object(Map::new()),
4855
}
4956
}

0 commit comments

Comments
 (0)