Forum Discussion

saras1's avatar
saras1
New Contributor
13 years ago

Help regarding groovy script with Xpath assertion

Hi,
I am new to SOAPUI and would really appreciate some help. My issue is :
I have a Xpath assertion that i configured and its working for 1 test step in a test suite.
Now, i want to write a groovy script that would insert the similar xpath assertion in all the 470 test steps in that test suite.

my xpath assertion is :
declare namespace ns1='http://*****************/schema/v1_0/complex';
declare namespace ns2='http://*********/schema/v1_0/trillium';
declare namespace ns3='http://***********/soap/v1_0/wtrillium';
//ns3:TrilliumAddress[1]

and in the expected response , i selected : select from current.

Is there a way that i can insert this xpath assertion to all the test steps dynamically?

4 Replies

  • saras1's avatar
    saras1
    New Contributor
    Hi Martin,
    Yes i want to write it using groovy script.
    Can you help me in that? I can give you the groovy script that i tried.
  • MartinSpamer's avatar
    MartinSpamer
    Frequent Contributor
    Have you tried my linked script ?

    It is a working script and should be quite easy to adapt to specific circumtances, but if you're having trouble feel free to make comments, ask questions and I will clarify.