Forum Discussion

AndyHughes's avatar
AndyHughes
Regular Contributor
8 years ago

Is it possible to delay the start of a test case?

I have a specific problem that I'm trying to get round in SoapUI NG. I have two tests. One contains a request (the response from which goes into a data sink), the second uses that data sink file as a data source. Trouble is, both tests need access to the same file at the same time. (It's a long running test and there is a significant amount of overlap). I don't think this is possible unless someone can tell me otherwise?

 

So to get round this I'm going to have to manipulate the data and split it up into a number of smaller files, but I need to be able to delay the start of test case number 2 in order that I don't run into the same problem of two tests wanting access to the same file at the same time. So I don't need a delay at the start of the test case, as by that time, my understanding is that the file has already been 'grabbed' and becomes inaccessible. I need to be able to stop it being 'grabbed' by the test case until it's actually needed. Hence this theory.

 

Help appreciated.

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    The best practice is that to have the test case independent.

    Do you think both can be part of single test case? Otherwise, use separate file for separate tests.
    • AndyHughes's avatar
      AndyHughes
      Regular Contributor

      Let me explain a little more.

      Both are long running tests so when the first one starts it grabs the data sink file and starts writing to it.

      Well before this test case ends, the second test case needs access to the file that is being written to.

      So for example the data sink may have 40 rows written to it so far, there are another 60 to go, but the second test case needs access now to that file to read out row number 1 for a different request but it can't access it because it's still being written to. This is how I understand data sinks work.

       

      But surely this cant be a problem never encountered before?