Forum Discussion

Shanki's avatar
Shanki
Regular Visitor
9 years ago

Problem with overriding the endpoint of a dependent project via command line

 

Hi,

 

I am using Ready API version 1.3.1

I have few test cases in several different projects running fine on the Dev server.
I am trying to run the same set of test cases on the Test server but via command line.

Some of my test cases in Project A call another test case from a different project (say., Project) B via a groovy script.
Below is the structure for instance:
Login:
  LoginTestSuite:
       LoginTestCase:

Profiles:
   ProfilesTestSuite:
       ProfilesTestCase: --> Calls LoginTestCase from Login Project via a groovy script

I did not have any problem when I executed the test case via the SoapUI GUI.

I am using the below script to run the test case from command line.
/opt/SmartBear/ReadyAPI-1.3.1/bin/testrunner.sh  -FPDF -R"Project Report" -ehttp://172.22.221.30:8080/emi -sProfilesTestSuite -cProfilesTestCase -I -r -GResponseSLA=10000 emi_profiles.xml
All my project.xmls are in the same location from where I am running the script. I am using the "-e"option to override the endpoint to point to the Test server.

In my groovy script I have given the location of where it needs to look for the project.xml of the test case which I am running from a different project (Login Project).

//Below is my groovy script:

import com.eviware.soapui.support.types.StringToObjectMap
import com.eviware.soapui.model.project.ProjectFactoryRegistry

import com.eviware.soapui.impl.wsdl.WsdlProjectFactory


// get workspace

def workspace = testRunner.testCase.testSuite.project.workspace

def project
if (workspace == null)

  project = ProjectFactoryRegistry.getProjectFactory(WsdlProjectFactory.WSDL_TYPE).createNew("emi_logon.xml")

else

  project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("Login")


def myTestSuite = project.getTestSuiteByName("LoginTestSuite")

// get test case

def myTestCase = myTestSuite.getTestCaseByName("LoginTestCase")

//run testcase

def contextMap = new StringToObjectMap( context )

myTestCase.run(contextMap,false);

The problem that I am facing is that, the "-e" option in the command line overrides the endpoint in the project.xml given in the command line (emi_profiles.xml) but does not override the project provided in the groovy script(emi_logon.xml).
So what happens is, when I run the script from command line, it says connection is refused to the Dev server which the project in the groovy script is pointing to.
Is there a way to override the endpoint of the project defined in the groovy script as well?

Your help is much appreciated!

 

No RepliesBe the first to reply