Forum Discussion
troyyerJP parameterize environment base url if required.
For example: define ${#Project#QA} under SOAP Services or REST Services, and add custom properties.
SOAP Services or REST Services:
${#Project#QA}
Custom Properties
If it is dynamically retrieved, then update project properties in your subsequent steps.
Thanks,
/Aaron
- troyyerJP4 years agoContributor
Hi Aaron,
Sorry, I didn't quite understand the steps of what I need to do or change. Here are my current steps I've performed for this.
I've gone into the Configure Environments section
Currently my QA environment has a Soap Endpoint called SoapBinding, which is the Salesforce Soap Service API
if I click the + symbol and try to add a new endpoint for SoapBinding to be a parameter ${SFProperties#serverUrl} the value now gets updated
however this is not the right endpoint for logging into Salesforce (needs to point to test.salesforce.com)
if i go to the API section of the project, and I try to add/update an Environment, then the same behaviour occurs (the end point gets replaced with the Parameter
If i am just Testing Salesforce API alone, changing the environment login user to the Salesforce Environment being tested is fine, however I have to now add in our external API dependencies as part of my test flow. In my existing project with the External APIs, I have set up the Environment groups for the APIs in ReadyAPI, but now when I merge in the steps for Salesforce, I'm not able to proceed as expected. Also im trying to set it up with as little configuration for someone non technical to repoint the test to suit the environment they are working on (which the Environment drop down greatly helps with)
- aaronpliu4 years agoFrequent Contributor
Don't need to add env in endpoint.
Since you configure different test environment, each env has a different base url, right? you just need to configure your base url of environment (i.e. QA, Dev) in Custom properties
Dev=https://abc/456
And then reference them in SOAP Services or REST Services. like ${#Project#QA} or ${#Project#Dev}.
When you switch environment, the base url will be changed to follow your selection. because only 1 env is activated.
Thanks,
/Aaron
- troyyerJP4 years agoContributor
Hi aaronpliu ,
Thanks for the further suggestion. I feel I have understood what you mentioned so the end state is that in the API section I would update the end points to have the Custom Property as the below screen
I have previously tried this and I can't hardcode the url in this manner. The first call to Salesforce is to test.salesforce.com. I would supply my login corresponding to the Sandbox i want to log into and once authenticated, Salesforce supplies back the URL for the environment under test.
for example
SIT I would navigate to "test.salesforce.com" and use my login id of troyyerJP@salesforce.com.sit, and then Salesforce would would create a session for the SIT environment sit.salesforce.com . the SIT url endpoint is supplied back to me by salesforce from the login api response data.
Stage I would navigate to "test.salesforce.com" and use my login id of troyyerJP@salesforce.com.prep and then Salesforce would create a session for the Stage environment prep.salesforce.com . the Stage url endpoint is supplied back to me from salesforce from the login api response data
I can't hardcode the sit url custom property to sit.salesforce.com as when we refresh the environments we could be assigned a new sandbox for the environment so the suggested process to login is to start from test.salesforce.com and use the ServerUrl supplied back in the login response.
As mentioned we have multiple APIs so we need to configure them in the Environments feature where I can set it once and other non-technical testers can select the environment they want to test in.
Related Content
- 11 months ago
- 2 years ago
Recent Discussions
- 17 hours ago
- 17 days ago