Skip to content

Instantly share code, notes, and snippets.

@olekhy
Forked from prashanthrajagopal/selenium_curl.sh
Created May 8, 2018 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olekhy/50d697f688b1f27136bcb8b33a366079 to your computer and use it in GitHub Desktop.
Save olekhy/50d697f688b1f27136bcb8b33a366079 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