how to parameter data bank x-path

NeilNeil Posts: 38


I am trying to parameter data bank x-path from excel sheet.

here is my scenario

below is the x-path I have in my data bank.
item'1' will be picked up from the response.
I want to parameter the Item[1] value with an excel sheet , so that I can control which item to pick up from the response.
e.g: /root/item['${item}']/id[1]/text()

---item is the column name in the data source excel sheet. this will help me to control which item to pick from the response.

but for some reason, even though I parameter the item value as mentioned in the e.g format. it's taking all the items from the response.

please correct me if I have to parameter in a different way to control which Item to pick up from the response.



  • OmarROmarR Posts: 231 admin

    Good morning Neil,

    Try removing the quotes around the ${} syntax.

    e.g., /root/item[${index}]/id[1]/text()

    Removing the quotes around the ${} syntax will not evaluate in the Databank successfully, but it will parameterize as expected during run time.

  • anantonananton Posts: 4

    Is it possible to parameterize the complete xpath form a datasource. I have tried passing the variable as ${XPATH}. But am getting the below error.
    " Cannot convert XPath value to Java object: required class is
    org.w3c.dom.NodeList; supplied value has type xs:string"

    Could you please correct me if am doing it in wrong way

  • OmarROmarR Posts: 231 admin
    edited May 2017

    Good morning Ananton,

    Yes, it is possible, but you may not be able to evaluate the xpath successfully in the databank-result window.
    1) Does the error occur during execution? If so, what is the xpath you are currently passing?

    2) Do you receive the error if you add the xpath (not parameterize) in the databank and execute your test?

  • anantonananton Posts: 4

    Hi Omar,

    This error is occurring when am parametrize in the "alter" tab(alter tab will be enabled when selecting the the allow alteration option) of XML data bank. And its working fine when am passing the xpath(not parameterize) .

  • jakubiakjakubiak Posts: 738 admin

    The XPath looks like it is resolving from the data source correctly. The error that you are seeing means that your XPath is selecting a text value from your XML document, but SOAtest is expecting the XPath to select a node. You should modify the XPath that is in your data source to select a node instead.

  • anantonananton Posts: 4

    Its working fine and the variable getting replaced with the xpath when using the variable in Extract ** tab of XML data bank. But the same variable is not working in the **Alter tab of xml data bank

  • OmarROmarR Posts: 231 admin

    Hey Ananton,

    Thank you for the clarification. What version of the tool are you currently using?
    There may be a hiccup with how the tool parameterizes in Alter mode. We will take a further look into this.

  • anantonananton Posts: 4

    Hi Omar,

    We are using 9.10 version

Sign In or Register to comment.