-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
form-data Requests with files is not saving src when exported to collection #4320
Comments
@sivcan @shamasis @prashantagarwal |
Duplicate of #3740 ? |
@glenpike , the issues seems to be the same, but this was working perfectly fine before with the last version before 6. The src had the file name, like this:
and this would run perfectly through newman. But since version 6 there is no src attribute at all. |
Hi,
Yes, it's been around for a couple of months - if you import a file used for Newman, then re-export it, the 'src' attribute is dropped. It's annoying because we have to diff our file then re-insert all the missing ones. It's also annoying because importing it never affected the file chooser in Postman, so getting rid of it is either a bug or a dumb choice and it's still not fixed...
…On 12 March 2018 22:01:39 GMT+00:00, aksbenz ***@***.***> wrote:
@glenpike , the issues seems to be the same, but this was working
perfectly fine before with the last version before 6. The src had the
file name, like this:
```
"formdata": [{
"key": "document",
"value": null,
"type": "file",
"src": "SampleImage.jpg"
}
]
```
and this would run perfectly through newman.
But since version 6 there is no src attribute at all.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#4320 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
It an expected behaviour. We don't save the file path for security reasons. |
I Never mentioned the file path..... That is what I am talking about. Even that is not happening currently. On exporting the collection evem the file namr is gone, and the whole api tests for file upload become useless. Do you have any way to execute the file upload api requests through newman without manually going into a 5000 line json file and editing it ? |
@harryi3t Please link other issues to this thread. |
@harryi3t @a85 |
Ditto for @TomONeill's comment, but to add to the use-case we don't wish to use the src path in Postman, we just don't want it deleted when exporting a collection from Postman. We only use relative paths in src, but we don't use the files when we are actually using Postman - we've moved beyond these entries and are adding new tests, but every time we export, we have to then go through the diff, find all the 'nuked' entries and add them all back in. This is laborious and error prone. |
@TomONeill @glenpike I mean the relative path only. I have been thinking about the base path as a configuration option in Postman/newman so that the software knows where to determine what the path stored in the file is relative to. This will not be part of exported files and hence should not be a security issue. @shamasis @harryi3t Am I correct in my understanding here and if yes, can we make this change inside the app? We can just start with relative paths though. |
I'd suggest the base path can be worked around by using a Postman variable if necessary, so is not something that is needed?
|
That's a good idea. But, it will then need to be added and might just fit better if we keep the behavior as configuration for the runtime itself. Will consider this while implementing this. |
Would love to see a solution here. Based on other comments I will be looking into https://insomnia.rest/ for my next project |
I am facing this issue and would like to try and implement this workaround from @jonlay but I don't quite understand how to run the function and provide the "input"? Should I be adding and executing the function as part of the collection itself or should I be processing the collection file from Javascript externally and if so how do I get the input and write it back to the same collection file? |
This. I have a little Express server configured, which I run newman on, and have some configuration set up to parse the Postman file. Something like...
Won't run out of the box, but you should be able to get the gist! It's quite a custom approach to an annoying problem, but works for me in this situation because I already have to do a lot of parsing of fixtures and other data before running my tests. |
@jonlay thanks so much for getting back to me. Being somewhat a novice, I didn't realize it was as easy as using require! Thanks and lets hope we get a proper fix soon! |
Hello, @aksbenz and everyone who have been waiting for this feature. We are pleased to announce that you can test this feature out in our latest
We would request all people who have been waiting for this feature to test it out and give your valuable feedback. PS: Work on |
@saswatds that's great news. I'd like to add that this issue occurs not only on form-data but also on the binary type. Example collection JSON:
File |
Hi @Exodus, we have fixed if for both form data and binary body type 😃. Do test it out! |
Hello everyone, we have released v7.1.0 of our production app which has this fixed. Thanks. |
@saswatds does this new change support the ability to have a dynamic src path through variables set in the pre-request script? |
@bstep93 This change does not support the ability to have a dynamic src yet. Thanks |
@a85 Feature Request - Add the working directory in postman settings. Working Directory can be where the collections can be exported to easily and from where files used for file upload can be kept and referenced. This will help in manually changing the file name in the scripts exported for newman tests or when importing a collection updated by someone else. I am planning to commit the newman tests and test files to a repo and keep on updating them. The replacing part becomes an additional step everytime. Similarly while import, I have to set the file paths everytime. |
Hey @nanocent in the latest release of Postman App
Do test it out and your feedbacks are always valuable. |
does this fix resolve #4287 ? I dont see this referenced. I am currently using the postman app Version 7.5.0 . The data variables (from the data file) seem to work only on first run of the collection (in the collection runner). Subsequent runs using the retry button do not seem to be able to access the data variables from the data file (I am using csv) |
I came here from #4824 which is the same issue as #4287 that @sup-engineer mentions just above. #4824 and #4287 have been closed saying their issue will be fixed when #4320 is, but that is not the case. #4320 was fixed a four months ago and now there is no open issue regarding the Data File from the Runner screen issue. Should I open a new one? |
i am facing this issue when i run through jenkins how to handle this |
@GaneshUma I use a different CI toolset but run Postman collections with Newman. In the exported collection, we have set the
We run the collection from its location, so the I hope that helps. It's been a while since I looked closely at this aspect of Postman's behaviour. |
Thank you so much this issue is got resolved when I place the collection file and data file in node machine. |
App Details:
Issue Report:
On exporting a collection with form-data requests having files, src attribute should be populated with the file name.
src attribute is not present in exported collection.
Example:
"body": {
"mode": "formdata",
"formdata": [
{
"key": "document",
"description": "",
"type": "file"
}
]
}
Steps to reproduce the problem:
Temp.postman_collection.json.zip
The text was updated successfully, but these errors were encountered: