Forum Discussion

deepti11sharma's avatar
New Contributor
7 years ago

How to modify existing teststep in SoapUI test suit by reading data from file using java?

I have a scenario where I have a wsdl url.  I have created requests using java soap api and added those request to testsuit as a test Step.

Now I am have another requirement where I have to modify the request generated from wsdl and added to test suit as a test step by reading data from a File. Here is the code snippet.


      WsdlOperation op = wsdl.getOperationAt(i);
        String opName = op.getName();
        reqContent = op.createRequest(true);
        WsdlRequest req = op.addNewRequest(opName);
        TestStepConfig testStep

Config = WsdlTestRequestStepFactory.createConfig(op,opName);
        WsdlTestStep testStep=testCase.addTestStep(testStepConfig);



In rest of the code I am able to get the testSteps from test suits and I am able to read file data using java file API but I am not able to modify the test step data with data read from file.


here is the data in the TestStep:-


<soapenv:Envelope xmlns:soapenv="" xmlns:web="http://www.webserviceX.NET/">


Will appreciate If any one can help on this. This is a very urgent requirement from a Client to be implemented ASAP.



2 Replies

  • nmrao's avatar
    Champion Level 3
    You mean to say that you have a project with test suite -> test cases -> teststeps.

    And you have a request file for a certain test step and you want to update the project with above request from file?
    • deepti11sharma's avatar
      New Contributor

      Thanks rao for replying I figured out solution.




      Here content will be the modified xml you want to save in a request teststep.