Forum Discussion

Karthick86's avatar
Karthick86
Occasional Contributor
14 years ago

How to Edit a SOAP Test Request

Hi,

I need to Edit the default SOAP request of a project with inputs from an excel sheet using groovy (Eclipse).

(i.e)I have to edit the SOAP request of : A projects -> X TestSuites -> Y TestCases -> Z TestSteps -> Target SOAP request

Currently I am parsing the whole project .XML file & inserting the inputs between the respective tags. I know this is not recommended & there must be a better way to do this.

Please let me know your suggestions.

Thanks,
Karthick.M

2 Replies

  • Karthick86's avatar
    Karthick86
    Occasional Contributor
    I have done this partially now using testrunner & xlmholder values.

    Now I am reading a excel sheet to get the tag & node values :

    Default SOAP Request:

    <urn:MessageID>?</urn:MessageID>
    <urn:IncludeSelector>?</urn:IncludeSelector>


    In excel I am setting MessageID = 123 & IncludeSelector = True

    println holder.getNodeValue ("//urn:MessageID")
    holder.setNodeValue ("//urn:"+Tag,"${NodeValue}")
    holder.updateProperty();
    println "holdervalue :"+holder.xml


    When I run this groovy script(Individual groovy script) it is updating the request in holder.xml. But the same is not getting updated in SOAPUI even if I reload the project.

    Can Anyone please tell me how to fix this?

    Thanks,
    Karthick.M
  • Karthick86's avatar
    Karthick86
    Occasional Contributor
    I got it.. Thanks..

    Request1.requestContent = holder.xml;


    Hope this helps someone..