Webdriver student project
Background information: WebDriver is a tool that's used for automatically testing web applications. It has also been adapted for automating web browsers while running tests. This project aims to create a server that will receive connections from WebDriver clients and execute commands to improve our test automation abilities.
Initial step: Build Servo, then email the mozilla.dev.servo mailing list introducing your group. Make a new crate (aka library) that will be responsible for running a server and interacting with the protocol (see components/devtools_traits for an example of a minimal crate). Add a run_server
function that takes a port number, and call it using the result of parsing a --webdriver
command line argument from the code in components/servo/lib.rs
. Use the code that starts a devtools server for reference (see components/devtools/lib.rs
and components/servo/lib.rs
).
Subsequent steps:
- Import the webdriver-rust library by modifying the appropriate
Cargo.toml
and start a server from therun_server
function added previously. Use a stub implementation of theWebDriverHandler
that only includes as much code as is necessary to make it compile. - Process the
NewSession
/DeleteSession
command by creating the necessary state and storing it in a hashtable in the newwebdriver
crate. - Process the Get command by sending a message to the script task to initiate a load of the given URL.
- Process the
ExecuteAsyncScript
command by instructing the script task to execute the given JavaScript, usinghandle_evaluate_js
incomponents/script/devtools.rs
as a model. - Process the
ExecuteScript
command usingExecuteAsyncScript
as a basis. - Process the
TakeScreenshot
command by instructing the compositor to output a screenshot (seecomposite
incomponents/compositing/compositor.rs
.