Forum Discussion

InfusionQA's avatar
InfusionQA
New Contributor
12 years ago

Pass parameter value to namespace variable

Hi

I am new on this forum so I wanted to say hello

I am struggling with SoapUI test case. I ha couple of environments. My REST service returns response in form that I need to define namespace in assert section. I use only Xpath way. Sometimes namespace variable contain environment address. I wanted to make it smart and replace environment address from ${#Endpoint} variable. I wanted to do it like this:

declare namespace ns1='${#Endpoint}/resourceURL';
//ns1:Response[1]/ns1:d[1]/ns1:results[1]/ns1:e[1]/ns1:_id[1]

This fails What should I do ? I don't want to use script assertion.

1 Reply

  • kralston's avatar
    kralston
    Occasional Contributor
    I am trying a similar thing in a Transfer test step.

    In a previous version of SoapUI I did not have to include a namespace declaration. Since upgrading to 4.6.4 my generic Transfer XPaths are all failing without the namespace declaration.

    With multiple test environments I was reading in the endpoints, etc. from an external config file and loading them into Properties. Inside the config file I could specify the run environment and all worked nicely.

    I am looking for a way to use one or more properties to build the namespace declaration on the fly so that my tests will support multiple environments.