How to fetch the values from the extension tool respone.

gollapudigollapudi Posts: 11

Hi Team ,
Can any one help me how to fetch the values from the extension tool response?
Or is there any to set the response in the global variables access further in the consequent test cases.

Thanks

Comments

  • jakubiakjakubiak Posts: 385 admin

    Can you post an example of what your extension tool is doing, and what data you want to save? Also, where do you want to use the data later in your test scenario? These details will help provide a more specific answer for you.

  • gollapudigollapudi Posts: 11

    Hi @jakubiak
    Please find the example as below.
    {
    "e": 5,
    "e": "",
    "e": 6
    }
    Suppose let’s assume my extension tool returns the above mentioned json format response,can you please guide me is there any way to save the json response to use further in consequence test cases.

    Thanks,

  • jakubiakjakubiak Posts: 385 admin

    Do you need the use a particular value from the response, or do you need to use the entire response? How do you need to use it in subsequent test cases?

  • gollapudigollapudi Posts: 11

    Hi @jakubiak

    I need entire response.

    Thanks
    Swapna

  • sansachiesansachie Posts: 20

    Did you try write file options ?

  • jakubiakjakubiak Posts: 385 admin

    There are multiple ways to do this. One way is to create a test suite variable of type "String" in the top-level test suite. Then attach an Extension Tool with the following script to the response traffic of your REST/Messaging Client:

    import com.parasoft.api.*;
    
    def storeResponse(input, context) {
        context.setValue("response", input)
    }
    
  • jakubiakjakubiak Posts: 385 admin

    There are multiple ways to do this. One way is to create a test suite variable of type "String" in the top-level test suite. Then attach an Extension Tool with the following Groovy script to the response traffic of your REST/Messaging Client:

    import com.parasoft.api.*;
    
    def storeResponse(input, context) {
        context.setValue("response", input) // Replace "response" with whatever the test suite variable is named
    }
    
  • jakubiakjakubiak Posts: 385 admin

    There are multiple ways to do this. One way is to create a test suite variable of type "String" in the top-level test suite. Then attach an Extension Tool with the following script to the response traffic of your REST/Messaging Client:

    import com.parasoft.api.*;
    
    def storeResponse(input, context) {
        context.setValue("response", input)
    }
    
  • jakubiakjakubiak Posts: 385 admin

    There are multiple ways to do this. One way is to create a test suite variable of type "String" in the top-level test suite. Then attach an Extension Tool with the following script to the response traffic of your REST/Messaging Client:

    import com.parasoft.api.*;
    
    def storeResponse(input, context) {
        context.setValue("response", input)
    }
    
  • jakubiakjakubiak Posts: 385 admin

    There are multiple ways to do this. One way is to create a test suite variable of type "String" in the top-level test suite. Then attach an Extension Tool with the following Groovy script to the response traffic of your REST/Messaging Client:

    import com.parasoft.api.*;
    
    def storeResponse(input, context) {
        context.setValue("response", input) // Replace "response" with whatever the test suite variable is named
    }
    
  • jakubiakjakubiak Posts: 385 admin

    There are multiple ways to do this. One way is to create a test suite variable of type "String" in the top-level test suite. Then attach an Extension Tool with the following script to the response traffic of your REST/Messaging Client:

    import com.parasoft.api.*;
    
    def storeResponse(input, context) {
        context.setValue("response", input)
    }
    
Sign In or Register to comment.