Forum Discussion

Slomo's avatar
Slomo
Occasional Visitor
11 months ago

Why readyAPI does not let me have multiple file content to create a file as an output?

Hello all,
After running my test steps, I want to create a file (adding another test step) with the previous test steps request and results as an output, but in the file content it does not let me have more than one data source from my test steps using 'get data'. It automatically rewrites the previous data if I want to add an additional data source to create the file as an output.
But if I copy the data sources individually and paste it on a word document, and then copy the whole thing and paste it there( in the file content) ; then it keeps the sources but after running the test it keeps on giving me an error saying ' (The file name, directory name, or volume label syntax is incorrect)

Appreciating your assistance in advance.

 

  • you can do multiple however the ReadyAPI UI doesnt let you do it quite nicely as whenever you want to use the "Get Data", it overwrites the existing value. So I would suggest a 2 step process. Keep a separate text editor open after before needing to use Get Data, copy the existing value from the field out to the text editor, use the Get Data feature, and then repaste back in the prior text value

    TestStep Request:
     ${Request Step#RawRequest}

    TestStep Response:
    ${Request Step#Response}

    i create a sample one on my ReadyAPI instance and the above was working for getting the data out

     

    for the file name, you should end it with a valid file format like 

    .txt

    i believe the Test Step would not have that mentioned

    also ensure that the file folder is present.

  • you can do multiple however the ReadyAPI UI doesnt let you do it quite nicely as whenever you want to use the "Get Data", it overwrites the existing value. So I would suggest a 2 step process. Keep a separate text editor open after before needing to use Get Data, copy the existing value from the field out to the text editor, use the Get Data feature, and then repaste back in the prior text value

    TestStep Request:
     ${Request Step#RawRequest}

    TestStep Response:
    ${Request Step#Response}

    i create a sample one on my ReadyAPI instance and the above was working for getting the data out

     

    for the file name, you should end it with a valid file format like 

    .txt

    i believe the Test Step would not have that mentioned

    also ensure that the file folder is present.

  • richie's avatar
    richie
    Community Hero

    Hey Slomo,

    I'm sorry, i must be really tired cos i've read, re-read and re-read again, but i just can't work out what you're actually getting at.  I'm sure we can resolve your issue if you can just clarify what you're trying to do.

    Can you add a couple more screenshots so we can see what you currently have?

    You mention a file, and taking the output/inputs and putting them together or something, but i just don't know what test steps you're talking about.

    Are you talking about REST steps? Are you talking about JSON or XML or something els  The screenshot you did provide....is that a Data Sink?  Are you using DataSource test steps?  I tried looking at your screenshot and tried finding the relevant test step in ReadyAPI! that has the identical design, but i couldn't match it, hence if you provide more screenshots and clarified your points a bit better....maybe even a screenshot of the test case hierarchy, that would help loads.

    NOTE REGARDING COPYING FROM WORD:  i didn't really understand but from your post it sounded like you manually copied some content into a word document and then copied and pasted that as a Request payload.  If you ever need to edit files do NOT use Word.  Word looks like it's just text, but in actual fact there's loads of invisible markup (relating to how the content appears in word....i.e. formatting, indenting, control characters like Line Feeds (<LF>), etc.).  If you copy and paste this from word you'll also copy and paste this extra stuff which will cause problems. 

    Instead of using Word, use a simple text editor like Notepad, Notepad++, etc, not something like Word.

    Ok, that's it.  As i say, if you can just clarify your points i'm sure we can help you out.

     

    Cheers,

    Rich