Forum Discussion

Ascendum_Soluti's avatar
Ascendum_Soluti
Occasional Contributor
13 years ago

Using SoapUI Parameters in an XPath Statement

I am using a Datasource test step with a datasource type of XML. I am trying to select specific children nodes predicated on a,SoapUI parameter (${PreviousStep#Field1}). When I code the Row and Column XPaths, they look like:

Row = //Level1/Level2[Field1=${PreviousStep#Field1}]/Level3

  • Column = Field2

    When this code is run, I receive an XPath syntax error.

    Is there a way to get this coding structure to work? If not, is there a method that will allow me to select which set of nodes to process.

    The input XML looks like:

    Level1
    Level 2[1]
    Field1 = 1
    Level3[1]
    Field2 = 1
    Level3[2]
    Field2 = 2
    Level3[3]
    Field2 = 3
    Level 2[2]
    Field1 =2
    Level3[1]
    Field2 = 1
    Level3[2]
    Field2 = 4
    Level 2[1]
    Field1 = 3
    Level3[1]
    Field2 = 10
    Level3[2]
    Field2 = 11
    Level3[3]
    Field2 = 12
    Level3[4]
    Field2 = 13

    Please let me know if this is confusing. I will try to be clear.

    Thanks,
    Bill Bachelder