Forum Discussion

pelumalai's avatar
pelumalai
New Contributor
8 years ago

While running Soapui pro testcases from java code, how to set and get testcase properties?

I tried following code

 

          WsdlTestSuite testSuite = project.getTestSuiteByName( "ts1" );
          WsdlTestCase testCase = testSuite.getTestCaseByName( "changeToUpperCase" );
          PropertiesMap prop = new PropertiesMap();
          prop.put("input", "hello");
          prop.put("output", "");
         
          TestRunner runner = testCase.run( prop, false );
          System.out.println("result :: " + runner.getStatus() + prop.get("output"));
         

On execution, the soapui script will set 'output' property to 'HELLO'

But prop.get("output") didnt returned any value from the script

  • Got it working now :) used

     

    testCase.setPropertyValue("input", "hello");

  • pelumalai's avatar
    pelumalai
    New Contributor

    Got it working now :) used

     

    testCase.setPropertyValue("input", "hello");