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.

Writable data source modes

LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
What do they each mean?
What do the different modes in the Writable data source mean? There is Setup mode: append and Standard mode: Overwrite or Append.

Say I want to keep a bunch of data from one test suite. Later in a second test suite, I want to iterate through all that data, act on it, and then delete it. It seems like I want to use setup mode, but then I'll have to manually reset the data every time they run.
Tagged:

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hi justink,


    Set-Up Mode means that the Writable DS will be populated by a Set-Up test rather than a Standard test. I agree that you will want to use a set-up test to populate the datasource. Why would you need to manually reset the data? I have attached an example (5.1 SP 2.0) that demonstrates a testcase like the one that you described, and there is no need to do anything other than run the test. [attachment=137:writableDSExample.tst]


    Please let me know whether you found this helpful.


    Sincerely,
    Jason
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hi Jason, that's definitely a good question. I forgot to mention that we are using Generic Test Suites instead of the built-in Set-up test and tear-down test functionality.

    I was trying to see if I could run only the set-up tests and the actual tests without running the tear-down tests. The reason is, I've had requests to see if we can examine the state of the application before the cleanup tests have been run. The built-in setup and teardown test suites don't let you run the suites individually (I can see why it is this way), so I've been using generic test suites.

    Is there a better solution to cope with this sort of thing?

    Oh and I am still curious about the behaviour of the different modes. The setup mode seems to reset the data at the beginning of the test suite, overwrite seems to reset ever test case, but I think an explanation from you would be better than guessing.

    Thanks!
    Justin
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hi Justin,


    I'd love to give you a full explanation of how these different modes work. Unfortunately, there are just too many different situations in which the same settings will work in different ways. Here are 3 general guidelines:

    1. Set-Up vs. Standard
    This determines from where the data source expects to receive its values. Set-Up means it will be populated by a Set-Up test and Standard means it will be populated by a regular test.

    2. Append vs. Overwrite
    This determines whether values will be written to a new row or whether any current values will be replaced by new values.

    3. How you run the test matters.
    If you select a single test and run it, you may see different behavior than when you run from the test suite level. This is the case that applies to the attached example. [attachment=138:justinkW...SExample.tst]



    In the example, the add operation of the Calculator WSDL is parameterized from the Integers Excel spreadsheet. The result value is then written to a writable DS in Standard Test Append Mode. Finally, a second add operation takes values from the writable DS as its x value.


    Here's how it works:
    1) If you run the first test, you can verify that it populates 3 rows of the datasource. Then, running the second test will use the three rows and leave the datasource empty.

    2) If you run the test suite containing the first test, you will see that only one row of the datasource is populated. This has to do with data source iteration in a scenario, and this behavior is quite useful and expected in some situations.


    Feel free to experiment with some other test configurations. For example, what if both tests in the example were in the same test suite? I hope that you are able to adapt this to your needs.


    Sincerely,
    Jason
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Let's try that attachment again.

    [attachment=139:example.tst]
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Thanks Jason, that makes sense now. I think we'll be using the set-up test append mode. This way, all of the etnries are added and the data is still reset when you run the highest test suite.

    Thanks for all your help Jason!

Tagged