Forum Discussion

vijaydi's avatar
vijaydi
Contributor
12 years ago

copy and paste the XML in Request1 to Request2 using Groovy

Hi Friends,

I have the below test stepts in my project.

- Request1 (SoapRequest)
- Request2 (SoapRequest)

Using groovy script I would like to copy the XML in Request1 to Request2.

Would appreciate if you could help me here.

Thank you.

2 Replies

  • jmistrik's avatar
    jmistrik
    Occasional Contributor
    try:


    TestStep ts = testRunner.testCase.getTestStepByName("Test Step1")
    TestStep ts2 = testRunner.testCase.getTestStepByName("Test Step2")

    String content = ts.getHttpRequest().getRequestContent()
    ts2.getHttpRequest().setRequestContent(content)
  • Thnaks jmistrik :-) This is exactly what I was looking for.

    Thanks again.