Skip to content

How to add new methods from the WebDriver Spec

George S. Baugh edited this page Nov 29, 2017 · 1 revision

First, check here for the supported HTTP endpoints:

https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/remote/http/JsonHttpCommandCodec.java

Find the action there you want to implement, and add an entry to the mapping in Selenium::Remote::Commands

Next, figure out the "canonical" name to have the verb be:

https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/remote/DriverCommand.java

Set that as the name of the action you just created in Selenium::Remote::Commands.

When implementing the method in Selenium::Remote::Driver, if you aren't particularly sure of what kind of arguments it takes, consult these pages:

Otherwise, just "ape your betters" in general and copy/paste a similar method and alter the relevant bits.