-
Notifications
You must be signed in to change notification settings - Fork 0
REST API call
gcvfi edited this page Mar 12, 2020
·
7 revisions
Back to AIQ Commands | Home
Note: Draft content, work in progress, not yet reviewed or verified.
save _api{CURL("GET", end_point_url)} as var_response_body
save _api{CURL("POST", end_point_url, request_body)} as var_response_body
save _api{CURL("POST", request_header, request_body, end_point_url)} as var_response_body
save _api{CURL("PUT", end_point_url, request_body)} as var_response_body
| Test Step | Test Data |
|---|---|
| open website | https://www.google.com/ |
| save _api{CURL("POST", "https://reqbin.com/echo/post/json", "{'login':'login','password':'password'}")} as post_response | |
| Enter Search | ${post_response} |
| save _api{GET(CURL("POST", "https://reqbin.com/echo/post/json", "{'login':'login','password':'password'}"), "success")} as post_response_success | |
| Enter Search | ${post_response_success} |
| wait for 1 secs | |
| ... | ... |
| ... | ... |
jsonplaceholder_url = https://jsonplaceholder.typicode.com/posts
jsonplaceholder_body = {"userId": 1, "title": "foo", "body": "bar"}
| Test Step | Test Data |
|---|---|
| open website | https://www.google.com/ |
| save _api{CURL("POST", ${jsonplaceholder_url}, ${jsonplaceholder_body})} as jsonplaceholder_response | |
| Enter Search | ${jsonplaceholder_response} |
| wait for 1 secs | |
| ... | ... |
| ... | ... |
- Please note the change in position of URL parameter.
jsonplaceholder_url = https://jsonplaceholder.typicode.com/posts
jsonplaceholder_body = {"userId": 1, "title": "foo", "body": "bar"}
jsonplaceholder_headers = { "Content-type": "application/json; charset=UTF-8" }
| Test Step | Test Data |
|---|---|
| open website | https://www.google.com/ |
| save _api{CURL("POST", ${jsonplaceholder_headers}, ${jsonplaceholder_body}, ${jsonplaceholder_url} )} as jsonplaceholder_response | |
| Enter Search | ${jsonplaceholder_response} |
| wait for 1 secs | |
| ... | ... |
| ... | ... |
| Test Step | Test Data |
|---|---|
| open website | https://www.google.com/ |
| save it as post_emp_url | http://dummy.restapiexample.com/api/v1/create |
| save it as post_emp_json_data | {"name":"test","salary":"123","age":"23"} |
| save _api{CURL("POST", ${post_emp_url}, ${post_emp_json_data})} as post_emp_response | |
| Enter Search | ${post_emp_response.data.id} |
| wait 5 sec | |
| ... | ... |
| ... | ... |
- AIQ Commands wiki (new draft)
- AIQ User Guide wiki (new draft)
- Release Notes wiki (new draft)
- How to Guides