Forum Discussion

punter's avatar
punter
Contributor
8 years ago

i have a scenario where in i want to run the test case created in my standalone soapui from eclipse

is it possible to achieve ?as i need to take screen shots of run test case like below  

 

  • steveKubik's avatar
    steveKubik
    Occasional Contributor

    Hi,

           I am looking for help to create Test Case in SOAP UI from Eclipse. Would you please give some sample code .

     

    Thanks

    Steve

    • punter's avatar
      punter
      Contributor

      Hi Steve,

       

      With below code created in junit i am abe to create test case.

       

      But do not know why tes case are not reflecting in soap gui?

       

      import com.eviware.soapui.model.workspace.Workspace;
      import com.eviware.soapui.support.SoapUIException;
      import com.eviware.soapui.support.action.SoapUIAction;
      import com.eviware.soapui.model.project.ProjectFactoryRegistry;
      import org.apache.xmlbeans.*;
      public class Helloo extends javafx.application.Application
      {
      @SuppressWarnings({ "unchecked", "deprecation" })
      test
      public void testSoapUI() throws IOException, InterruptedException {

      System.out.println("Hello Wrld");




      try {

      WsdlProject project = new WsdlProject();
      boolean createRequests = true;
      project.importWsdl("http://api.bing.net/search.wsdl", createRequests);
      project.setName("p");
      System.out.println(""+project.getPath());

      WsdlInterface[] inter = WsdlInterfaceFactory.importWsdl(project, "http://api.bing.net/search.wsdl", true);

      project.addNewTestSuite("ram").addNewTestCase("case1");
      TestSuite testSuite = project.getTestSuiteByName( "ram" );
      TestCase testCase = testSuite.getTestCaseByName( "case1" );

      TestRunner runner = testCase.run( new PropertiesMap(), false );

      } catch (Exception e) {
      e.printStackTrace();
      }


      }

       

      @Override
      public void start(Stage primaryStage) throws Exception {
      // TODO Auto-generated method stub

      }

      }

      • punter's avatar
        punter
        Contributor

        Hello ,is there any one who can help me in achieving  the above scenario discussed?