Forum Discussion

phanisrikar's avatar
phanisrikar
Contributor
14 years ago

[Resolved] External JARs in groovy script (soapUI Runner)

Hi,

I am testing the REST webservices having the oauth authentication as wrapper. I have the groovy script test step in the soap testcase which will generate the required authorization headers.

When I am trying to execute the test case using loadui, it is failing at the first step itself which will generate the oauth header.

Do we have any known issues with loadui while executing the java code using the groovy script.

or else do we have any other way to pass the header paramerters to the REST request in soapui with out having an additional step?

need urgent help.

Thanks
Phani
  • Hi,

    It sounds like you maybe haven't synchronized your script correctly. Does the TestCase run fine as a soapUI load test?

    Also, which version are you using?

    Regards

    Henrik
    SmartBear Software
  • How to know whether they are synchronised properly or not ? and even in the soap ui load test is not working.

    But I could able to run the test case from soapui successfully with out any issue.

    I am using SOAPUI Pro 4.0 and LoadUI 1.5

    Thanks,
    Phani
  • phanisrikar wrote:
    [...] even in the soap ui load test is not working.

    phanisrikar wrote:
    I am using SOAPUI Pro 4.0 [...]

    This sounds like a case for the soapUI Pro support (they may help with scripting, but they won't write the scripts for you).
    phanisrikar wrote:
    How to know whether they are synchronised properly or not ?

    A general rule in all programming/scripting is that multiple threads shouldn't access the same variable at the same time. To avoid this, you need synchronization -- which e.g. can be achieved with semaphores. I encourage you to read more on this topic on the web.

    Regards

    Henrik
    SmartBear Software
  • Let me explain my test case:

    1. GenerateHeader
    2. CreateRecord
    3. GenerateHeadertoRead
    4. ReadRecord
    5. GenerateHeaderToDelete
    6. DeleteRecord

    Ideally, one virtual user has to execute the steps sequentially and the variable which I have used to store the header values are different(I am not using the same variable) also I think every virtual user will get a copy of test case so there wont be any overlapping / overridding of variable values by different virtual user.

    Since I have some kind of java code involved in generating the headers, Is there any issue in running the code which encodes some parameters ?

    Please help

    Thanks
    Phani
  • Do we have any solution for this?

    Actually I could able to load test the scenario from SOAPUI pro successfully, but when imported to loadui its failing at first step itself.. Is there any compatibility issues in executing the java code from loadui ? any version problem ? or java path has to be given ?

    Please need help.

    Also, I thought of trying the same scenario with loadui2.0 beta 1 but failed at the installation of software itself ? Application error same as the below post
    viewtopic.php?f=10&t=12630

    Thanks,
    Phani
  • phanisrikar wrote:
    Also, I thought of trying the same scenario with loadui2.0 beta 1 but failed at the installation of software itself ? Application error same as the below post
    viewtopic.php?f=10&t=12630

    Did you also try the solution that I posted for that problem in the same topic? It can also be found here.

    phanisrikar wrote:
    Actually I could able to load test the scenario from SOAPUI pro successfully, but when imported to loadui its failing at first step itself.. Is there any compatibility issues in executing the java code from loadui ? any version problem ? or java path has to be given ?

    So now you got it to work in soapUI Pro as a load test? Great!

    Did you connect a Table Log component to the failures output of the soapUI Runner?


    Regards

    Henrik
    SmartBear Software
  • Thanks for the quick response

    Yah, I tried the solution posted, but got the same error.
    viewtopic.php?f=10&t=12630

    So I have uninstalled the loadui2.0 and followed the same procedure and this time reinstalled the load1.5 and that worked fine.

    and regarding the current post, yah I could able to load test the scenario from soapui pro.

    In loadUI, I have connected the Table log and could not any log in in the table log as it is failing at step 1, where some kind of code involved to generate the oauth header values required to invoke the REST services. There are some encoding packages being imported. I think there is some issue in importing the java packages.

    Please have a look at the error log file attached

    Thanks,
    Phani
  • phanisrikar wrote:
    Yah, I tried the solution posted, but got the same error.
    viewtopic.php?f=10&t=12630

    Could we set up a short screen sharing session? We really want this to work for you.

    phanisrikar wrote:
    and regarding the current post, yah I could able to load test the scenario from soapui pro.

    [...]

    Please have a look at the error log file attached

    The error ConnectException: Connection refused: connect suggests that the soapUI Runner can not access one of the URLs in a REST Request.

    The error
    unable to resolve class org.apache.http.message.BasicNameValuePair
    @ line 6, column 1.
    import org.apache.http.message.BasicNameValuePair;
    suggests that you are referring to a third party library in soapUI. In soapUI, external libraries are put in SOAPUI_LOCATION\bin\ext. In loadUI, you need to place the same libraries in [loadUI home]\ext, e.g. c:\program files\eviware\loadUI 1.5\ext (you may have to create the ext directory yourself).

    Regards

    /Henrik
  • Thanks Henrik

    Its working now, there are multiple jar files under c:\program files\eviware\loadUI 1.5\ext directory which is supporting the class I have used, So I have removed the duplicates and left the necessary jar files in the directory.

    Regarding the Load2.0, now its installed properly and could able to open as well.
    Problem is the older version of Java. So, uninstalled the java completely and installed the latest java version 1.7.0_03 and reinstalled the Loadui 2.0, then it worked.

    viewtopic.php?f=10&t=12630

    Thanks & regards,
    Phani