Skip to content

Instantly share code, notes, and snippets.

@mul14
Forked from prashanthrajagopal/selenium_curl.sh
Created December 4, 2016 02:27
Show Gist options
  • Save mul14/045f1a8fae0ca0e2edc6e15c877cb000 to your computer and use it in GitHub Desktop.
Save mul14/045f1a8fae0ca0e2edc6e15c877cb000 to your computer and use it in GitHub Desktop.
Run Selenium test via curl
s_id=`curl -X POST http://127.0.0.1:4444/wd/hub/session -d '{"desiredCapabilities":{"browserName":"firefox","platform":"MAC"}}'|awk -F'"' '{print $6}'`
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/url -d '{"url":"http://www.google.com"}'
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element -d '{"using":"id","value":"gbqfq"}'
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element/0/value -d {"value":["selenium"]}
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element -d '{"using":"id","value":"gbqfb"}'
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element/1/click
curl -X DELETE http://127.0.0.1:4444/wd/hub/session/$s_id/window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment