0

How to define multiple endpoints in the settings of robot

My expectation will be like this. Defining two urls in the settings

***Settings***
Library         REST                  ${API_URL_1}               URL_1
Library         REST                  ${API_URL_2}               URL_2

and it will called in the testcases as

*** Test Cases ***
Scenario-1
GET          ${URL_1}/getsomething
get the response to a variable (say: data)
POST        ${URL_2}/dosomething       ${data}

will that possible using restinstace library?

1 Answer 1

2

According with the Library documentation:

Sends a GET request to the endpoint.

The endpoint is joined with the URL given on library init (if any). If endpoint starts with http:// or https://, it is assumed an URL outside the tested API

That means, if you build your test like:

*** Test Cases ***
Scenario 1
   GET   http://URL_1/getsomething
   GET   http://URL_2/getsomething

Will connect you to different endpoints. Or you can store your URLs in variables and call the ones you want:

*** Variables ***
${URL_1}   http://myfirsturl
${URL_2}   http://myotherturl

*** Test Cases ***
Scenario 1
   GET   ${URL_1}/getsomething
   GET   ${URL_2}/getsomething
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.