Forum Discussion

anusha21's avatar
anusha21
Occasional Contributor
7 years ago

Get node values when i map datasource values to my request

HI all I am bit stuck to get Node value of a request please help me on below scenario

 

1. I am using 2 test cases in my Test suite

2. In first test case i am using datasource as one test step and 2nd one is SOAP test step and 3rd one is Groovy test step

3 in groovy script i want to get node value from request but that node has mapped to datasource value

 

so when i use below line its returning "${DataSource#ProposerPostcode}"

def Ppc = request1.getNodeValue('//*[local-name()="Proposer"]/*:Address/*:PostCode')

log.info Ppc

 

but in this case i want to get data source value (m22 3gh) but it is printing "${DataSource#ProposerPostcode}"

 

so please help me in this, i think this will resolve if i get Rawresponse node value but not sure how to get it

 

4. In 2nd test case groovy test step i want to get 1st test case > SOAP request test case > Node values  (for example i want to get Ppc value from 1st test case to 2nd test case groovy test step (please help me in this scenario too)

 

thanks

Anusha

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    1. The best practice is that each test case should be independent.
    2. The details provided are inadequate to offer any help.
    • anusha21's avatar
      anusha21
      Occasional Contributor

      thanks for your response,

       

      i know it should be independent, but in my scenario i have to pass previous test case response node values to my current test case request nodes so i have to do this 

      so if you can help me on below i think i can figure out the solution

       

      in groovy script i want to get node value from request but that node has mapped to datasource value

       

      --> I created data source step with key as ProposerPostcode and value  as "m22 3gh"

      and i have written below line to get the value from request

      def Ppc = request1.getNodeValue('//*[local-name()="Proposer"]/*:Address/*postCode')

      log.info Ppc

       

      In this case i want to get data source value (m22 3gh) but it is printing "${DataSource#ProposerPostcode}"

       

      i think now it may clear to you what i am asking

       

      thanks

      Anusha

      • nmrao's avatar
        nmrao
        Champion Level 3
        Part of your reply is already the same from previous response.
        Please show the input data and specify what needs to be extracted.