Forum Discussion
I tried but its not working, as mentioned i kept http://( '${#TestCase#TEST URL}' ) in the Request URL
my sample url looks like below:
https//testsample.com//testingurl_f21ae8be36da/fa3f1ff5-93e1-4468-bf43-6541c317b6e8'%20
below is the error i am getting
2020-05-28 23:14:30.087 - Error getting response; java.net.URISyntaxException: Illegal character in authority at index 7: http://( 'https//testsample.com//testingurl_f21ae8be36da/fa3f1ff5-93e1-4468-bf43-6541c317b6e8'%20)
When i tried giving the url in the request url i am getting below error
{
"message" : "You must specify only one folder in the url for POST requests."
}
So please let me know how to achieve this.
Isn't url forming incorrect by just looking at it?
http://( '${#TestCase#TEST URL}' ) -> change it to ${#TestCase#TEST URL}
- doubtsreadyapi4 years agoContributor
- nmrao4 years agoChampion Level 3Hope you have assigned the value for the custom property. Haven't you?
- doubtsreadyapi4 years agoContributor
- doubtsreadyapi4 years agoContributor
Hi nmrao
Yes i have assigned the value for the custom property and now i am getting the response as.
{
"message" : "You must specify only one folder in the url for POST requests."
} - nmrao4 years agoChampion Level 3
Thank for trying.
But you should try it out on your own instead of just try what is mentioned.
From the error message it is clear that what you are hitting is not a file url, instead a directory.
Your question is to download a file. Isn't it?
Even you could try the your in your browser. And see.
Automation is important, but priority is to understand how things work manually and find the right way to achieve and then think of automating it. Thank you. - doubtsreadyapi4 years agoContributor
Hi nmrao
Thanks for the update, When i try manually hitting the url in browser, it downloads the excel file under downloads folder. i have already tried this manually before.
So, Please let me know whether we can achieve it using readyAPi?
Thanks
- nmrao4 years agoChampion Level 3
I am member like you, explore the problems, see what works and suggest some solutions as part of that in spare time.
You may feel free to check with SmartBear customer support. - richie4 years agoCommunity HeroHi doubtsreadyapi,
Just a quick update. From your description what youre asking is entirely achievable in ReadyAPI!.
It appears that the dynamically generated URL you are building differs from the URL you are submitting in the browser.
1. Grab the URL you are submitting in the browser, plug it into a url decoder to remove the percent encoding (via https://www.url-encode-decode.com)
2. Submit the request in ReadyAPI!, go to the RAW tab and grab the URL that is generated. Plug this into the html encoder/decoder and decode to remove the percent encoding
3. Compare the browser URL which works against the one submitted in ReadyAPI! and tske note of the differences.
4. Update the config in ReadyAPI! so that the dynamically generated URL matches the format/pattern of the browser URL
Ta
Rich - nmrao4 years agoChampion Level 3
By the way, I can see the file downloaded in the temp directory(check attachments tab below response editor) when this is tried.
Note, Download Resources checkbox ticked.
Explore what you are doing differently.
- doubtsreadyapi4 years agoContributor
Thanks for the Information, I done get with the dynamic URL, with the HTTP method, Now i am getting the raw response as below, but i am not seeing any attachments tab under response, I am not sure where the file got downloaded. Do you have any idea where the file got downloaded?
and i dont see any difference the url which i am posting in the browser and the dynamic url. only thing before i was doing POST request. for HTTP Request
HTTP/1.1 200 OK
Server: gunicorn/20.0.4
Date: Mon, 01 Jun 2020 05:34:41 GMT
Connection: close
Content-Disposition: attachment; filename=testing_AutoAPI_Dev_7505_20200601.xlsm
Content-Length: 338158
Content-Type: application/vnd.ms-excel.sheet.macroEnabled.12
Last-Modified: Mon, 01 Jun 2020 05:24:47 GMT
Cache-Control: public, max-age=43200
Expires: Mon, 01 Jun 2020 17:34:41 GMT
ETag: "1590989087.1710029-338158-1402026568"
Access-Control-Expose-Headers: Content-Disposition
Access-Control-Allow-Origin: *
Related Content
- 3 months agokadir