0

I have a set of 60 testcases in a project in SoapUI that I want to run concurrently. Each testcase needs to use a value to work. The values are stored in an external file (spreadsheet or textfile). Each testcase needs to get a value from this file and use it. However when I run the testsuite, multiple tests are picking up the same value however only one value can be used for a test (same value cannot be used in more than 1 test at the same time). I would like the external file to be accessed by one testcase at a time in soapUI. Does this involve locking or some sort of queueing system or what groovyscript could I use? thanks

  • How do they pick up different values? Do they write to the file as well? – tim_yates Dec 05 '13 at 11:48
  • i have a groovy script at the start of each testcase which reads the file line by line, takes a value and puts it into a property at the testcase level. Once a value is picked up i have it scripted so that it adds "USED" to the end of that value in the file so that if another test then reads the file it will ignore any values that have "USED" at the end of them because they are in use in another test. The problem I'm facing is at the start of kicking off all the tests because they access the file at the same time so the same value could get picked up by 2 tests for example – user3069990 Dec 05 '13 at 11:54
  • Have you tried a synchronized static method for reading the value, updating the file and returning the value? – tim_yates Dec 05 '13 at 12:06
  • I'm fairly new to groovy so not sure how to write that? – user3069990 Dec 05 '13 at 12:12
  • Actually that probably wouldn't work as I assume that you mean you've just got some code in each step. – tim_yates Dec 05 '13 at 12:15
  • Is there no way in SoapUI to create a dummy webservice that just returns the ids in order (one at a time) when called? – tim_yates Dec 05 '13 at 14:58

1 Answers1

0

I can't figure out how to get this to work with your external file, but I can think of another way only using SoapUI. Here's my suggestion for a solution:

  1. Create a new TestCase containing only a DataGen TestStep.
  2. Configure it so that it generates the numbers you want.
  3. Change its mode to "READ", so that it will generate a new value every time the test step is run.
  4. Now, wherever you want one of these values, instead of accessing your external file, add a Run TestCase TestStep to run your new DataGen test case, and make sure to return the generated number as a property. Use it where you need the generated number.

As I'm typing this, I just realized this only works with the pro version of SoapUI. If you don't have a license you can get a trial from the website.

ArianJafari
  • 96
  • 1
  • 6