Skip to content

Commit 501987c

Browse files
aboksOndraM
authored andcommitted
Fix ChromeDriver::start() causes 'mixed' W3c mode
The `new static` within ChromeDriver::start() creates a RemoteWebDriver that is not W3C compatible by default (due to the default for RemoteWebDriver's 3rd constructor arg). The command executor it uses assumes W3C compatibility by default though. This causes strange bugs, where commands are created assuming non-compliance, but translated by the command executor as if they were W3C compliant. By using the logic already present in RemoteWebDriver::create(), ChromeDriver now detects whether the sesson it started is in W3C compatible mode and updates the flags both on itself and on its executor.
1 parent 53b023c commit 501987c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Chrome/ChromeDriver.php

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ public function startSession(DesiredCapabilities $desired_capabilities)
3939
]
4040
);
4141
$response = $this->executor->execute($command);
42+
$value = $response->getValue();
43+
44+
if (!$this->isW3cCompliant = isset($value['capabilities'])) {
45+
$this->executor->disableW3cCompliance();
46+
}
47+
4248
$this->sessionID = $response->getSessionID();
4349
}
4450

0 commit comments

Comments
 (0)