Forum Discussion

nurait's avatar
nurait
New Contributor
12 years ago

SoapUI Parallel execution for automation using jar

Hi Team,

First of all thanks for the wonderful freeware tool and your extended support

Please find the below scenario which stats our actual requirements and the issues we are facing currently.

Our Requirements :

In our automation project, our testCase's groovy scripts are invoking reusable java classes which are called from jars (Kept inside of soapui bin/ext/). Our requirement is that we need to run testSuites/testCases parallely, so then testcases/testSuites access the same jar concurrently and access its class files at the same time.

Our existing Issue :

While we are running testSuites/testCases in parallel mode (which is working fine in a sequential mode) we are getting java nullpointer exception in soapui error log and hence our execution Fails. Is that a problem of accessing the same jar concurrently from soapui bymeans of parrallel execution ?

Kindly let us know the possible solutions to overcome the above issue.
  • nmrao's avatar
    nmrao
    Champion Level 3

    invoking reusable java classes which are called from jars (Kept inside of soapui bin/ext/)


    I am not sure about locking. My bet here is to take a look the java class implementation and see if code is written thread safe or not and if there are any static variables are used, please pay attention to them.

    There are otherways of doing as well:
    1. you may directly provide a command in side groovy, as if you are running it on command line java call and this will not require to copy the jar files to specific location, and can be referred from where they are. And you can get the return code from the java to groovy back.
    for eg:
    $JAVA_HOME/bin/java -cp $CLASSPATH <your class name> arguments

    Below link will help you for the same.
    http://groovy.codehaus.org/Executing+Ex ... rom+Groovy

    2. You may also create your Instance variables of java class, and call methods of the same like you do in java.

    Regards,
    Rao.
  • nurait's avatar
    nurait
    New Contributor
    Hi,

    Thanks for your response, after changing the static reference methods into instance references acorss my classes in java am able to access the same jar parallely through test suites execution.

    Help needed on one more level :
    I also need to execute Testcases parallely from one test Suite in soapui.

    My Current approach :
    Am using Excel as a data source, and for each testSuite am having an Excel workbook to drive my execution and to get the execution status by means of jdbc/odbc connectivity thro' java classes (single jar). In the above requirement (Testcases parrallel execution from a Test Suite), my all testcases needs to concurrently update one single excel workbook(since we are maintaining one excel for every testSuite).
    In this situation my all testcases needs to access same jar class/same excel concurrently in soapui.

    My question :
    In my excel access class (jdbc connectivity,excel update java class) am closing recordset/stmt/jdbc connectivity finally. So is this a problem for my parralel access of the same excel thro' testcases parallel execution?

    Kindly suggest you thought/solution on the above situation.

    Regards
    nurait
  • nmrao's avatar
    nmrao
    Champion Level 3
    Haven't gone thru as such. It would be good to try out as you have all the artifacts ready with you and see if there is any stopper for you.
    You already understood the kind of issues you ran into and reason as well. You may use that wisely.