SOAP UI Open Source Load Tests- How to Iterate the file path in the XML when we run a load test?

156 Views Asked by At

I am trying to run a load test against a documents upload webservice. Attached is the XML that i used for the load test.

The webservice is used to save the documents to a server.

The problem is, we need to provide a file path in the XML from which the soapui fetches the documents and upload into the server.

When we provide a static file path (i.e the document path), then then the document is getting locked when the load test are triggered. Because when the number of thread increases, different user are trying to access the same document at the same time.

As a alternative solution, i created a groovy script to iterate the filepath (created nearly 100 files and iterated the file name in the groovy script). But this doesn't seems to be reliable when the threads increases 50 and above. I am still getting the file locked error in the database (response from the webservice) when I run the load tests. Because for 50 users 100 documents is not enough ( if the file size is 5 mb, its taking time to complete the previous response) and hence i am getting file lock error still.

Is this the right way to do the load test?

Is there any way we could easily do this?

I am new to SOAP UI and any help would be appreciated...

SOAP UI Project Screenshot

Groovy Script

//read data from the text file and pass into the parameter
File listDocumentPath = new File("C:/D_LoadTests/InputParameters/DocumentPath.txt")
File listDocumentName = new File("C:/D_LoadTests/InputParameters/DocumentName.txt")

//read lines
List lineDocumentPath = listDocumentPath.readLines()
List lineDocumentName = listDocumentName.readLines()

//calculate the length of the line

//int pathrowsize = lineDocumentPath.size()
//int namerowsize = lineDocumentName.size()

def randDocPath = Math.abs(new Random().nextInt() % 20)
def randDocName = Math.abs(new Random().nextInt() % 100)

log.info lineDocumentPath.getAt(randDocPath)
log.info lineDocumentName.getAt(randDocName)

testRunner.testCase.testSteps["Properties"].setPropertyValue("DocumentPath", lineDocumentPath.getAt(randDocPath))
testRunner.testCase.testSteps["Properties"].setPropertyValue("DocumentName", lineDocumentName.getAt(randDocName))

XML Document Path: <DOCUMENT_PATH><![CDATA[\HXS33679\DocAccess\Autoprofiling\LoadTest\DM_Files\01_USProfileForm\${Properties#DocumentPath}\1MBFiles\${Properties#DocumentName}]]></DOCUMENT_PATH>

DataFileSample DataFileSharepath

0

There are 0 best solutions below