Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to fetch the values from the extension tool respone.

gollapudi
gollapudi 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

  • jakubiak
    jakubiak Posts: 795 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.

  • gollapudi
    gollapudi 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,

  • jakubiak
    jakubiak Posts: 795 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?

  • gollapudi
    gollapudi Posts: 11

    Hi @jakubiak

    I need entire response.

    Thanks
    Swapna

  • sansachie
    sansachie Posts: 26

    Did you try write file options ?

  • jakubiak
    jakubiak Posts: 795 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)
    }
    
  • jakubiak
    jakubiak Posts: 795 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
    }
    
  • jakubiak
    jakubiak Posts: 795 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)
    }
    
  • jakubiak
    jakubiak Posts: 795 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)
    }
    
  • jakubiak
    jakubiak Posts: 795 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
    }
    
  • jakubiak
    jakubiak Posts: 795 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)
    }