Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.4k
Control Servo using WebDriver
Bastien Orivel edited this pageSep 9, 2018 ·2 revisions
First, run an instance of Servo with the webdriver server enabled on a particular port (and optionally a particular resolution):
$ ./mach run --webdriver=7002 --resolution=400x300From another terminal window, use curl or wget to interact with the webdriver web server inside of Servo (requires that thejq utility is installed):
# Create a session for subsequent commands$ SESSIONID=$(curl -X POST -d "{}" http://localhost:7002/session | jq -r ".value.sessionId")# Load the desired URL$ curl -v -X POST -d '{"url": "http://example.org"}' http://localhost:7002/session/${SESSIONID}/url# Save a screenshot of the current content to a file$ curl -v http://localhost:7002/session/${SESSIONID}/screenshot | jq -r ".value" | base64 -d > test1.png