admc / wd

A node.js client for webdriver/selenium 2.
Other
1.53k stars 404 forks source link

Support W3C get active element command #607

Closed rhysd closed 4 years ago

rhysd commented 4 years ago

/element/active requires POST method in JsonWireProtocol but W3C WebDriver spec requires GET method.

https://www.w3.org/TR/webdriver/#get-active-element

This patch checks remote WebDriver server speaks JWP or W3C on creating a session and remembers it. Then switch method of /element/active looking the flag.

rhysd commented 4 years ago

CI failure seems not related to changes by this PR:

[12:10:27] 'sc:start' errored after 1.03 min
[12:10:27] Error: Could not start Sauce Connect. Exit code 1 signal: null
    at ChildProcess.<anonymous> (/home/travis/build/admc/wd/node_modules/sauce-connect-launcher/lib/sauce-connect-launcher.js:561:12)
    at ChildProcess.emit (events.js:198:13)
    at ChildProcess.EventEmitter.emit (domain.js:466:23)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
admc commented 4 years ago

Thanks!