-
Notifications
You must be signed in to change notification settings - Fork 89
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:
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:
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:
- https://github.com/SeleniumHQ/selenium/blob/master/java/server/src/org/openqa/selenium/remote/server/JsonHttpCommandHandler.java - this one will show you what classes correspond to what verb
- https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/remote/server/handler/WebDriverHandler.html - this one will show you the classes themselves (and ergo their actual argument structure).
- https://github.com/SeleniumHQ/selenium/tree/master/java/server/src/org/openqa/selenium/remote/server/handler - can also be helpful if it's got a special component to the URI that's needed
Otherwise, just "ape your betters" in general and copy/paste a similar method and alter the relevant bits.