Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Write File tool for written record of tests

LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
Hey guys I've been experimenting with the write file tool to keep a record of requests as a data export strategy. It's just easier to upload request/response data to my issue tracking software from an already written file instead of mme being a human database. Finding the test in my test suite clicking the traffice viewer, right click --> save as, right click --> save as then upload gets old after a few hundred bugs. Recently I was asked to dump the entire results to file so that we could keep a record to (SOX) and to provide data for those that don't use soatest.

However I can't figure out how to create a global write file tool which automatically propagates to all child test cases and picks up the name of the test case being run and then writes the data to a file. What i've resorted to is adding a single write file output for both req/resp for every test in my regression suite.

Is there a better way to do this?

Thanks in advance,

LeapTester
Tagged:

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    An alternative is to copy the traffic stream into a file. If you right click and go to Add Output->Both->Traffic Stream->File, then a FileStreamWriter will be added to the test. Then you can choose what file to use for saving the results.

    After the test is run, the request header, request SOAP envelope, response header, and response SOAP envelope will be copied into the file. If the test is run again using the same file, then the results will be appended in the file.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Thanks dude. I've tried that and it is a very useful tool. However I was looking for someway to add a single write file tool as a global object which would then be used by the test cases contained in the scope of the test suite. I have tst files with tests anywhere from 50 - 300 deep. That's a lot of right clicking...

    Guess i better get to it .

    Thanks again,


    LeapTester
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hey Cpark. I have a stupid question. The write file tool when applied at the test case level for either request or response gives you the option of appending the written data or (i'm assuming) overwriting the data if the append box is unchecked.

    However for the case where the "both" write file tool is used there is no option to append or overwrite. In operation the "both" write file tool only appends data to the file.

    Is there a way to overwrite a "both" write file tools output?


    Thanks,

    LeapTester
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    The Traffic Stream File Writer is limited to only appending to files. However, it is possible to overwrite to a file using a script and a Write File tool. I've attached an example test suite to this post.

    The file produced by this script will be different from the file produced by the File Writer tool. It will have the same request and response data. But in addition to that there will be some extra data like the endpoint, test name, response time, and a few other things. Also, there will be tags like Request HTTP Headers= to identify the data.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Sweet! Thanks dude.

    LeapTester
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    I've changed the script to give you more control over the output since you might not want the extra data in the output. You can comment out or delete the lines in the script for the data you don't want.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Can you provide a copy of this .TST file for version 4.1? We're in the middle of a HUGE release and won't be upgrading anytime soon.

    Thanks in advance,

    LeapTester
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    I made the example test suite again in 4.1. File is attached here.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Sorry, forgot to attach file.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hey CPark thanks for all you help with the JRE stuff. I have a quick question about the Target Name Wild cards in the write file tool. Can this be manipulated to create a filename automatically based on the Test Case name?

    currently the list of wildcards doesn't appear to draw from the test case name.

    Thanks,

    LeapTester
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    The script in my example test suite outputs the test name into the file. Unfortunately, there's no wild card for using the test name in the file name.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Sa'll good my man. If it really becomes important i'll post this as a feature request in the appropriate forum.

    thanks again,

    LeapTester
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    I made a feature request (PR 54094 ) for this feature.