Service Virtualization

  • 1.  Need suggestions on filtering values from REST Step using lisa property and not filters

    Posted May 04, 2017 06:57 AM

    Is there a way we can use lisa curley braces {{}}within a curley braces eg. {{lisa.{{LISA_LAST_STEP}}.rsp}} where LISA_LAST_STEP is in itself a property formed at run time? 

     

    Objective - I need to run a test case having 10 REST call steps, each having different name/URL. I need to store the result of each step in the database-

    1) Step Name - I know to capture this since we have lisa property as LISA_LAST_STEP.

    2) HTTP URL invoked in this step. - How can we get this?

    3) Request sent/ Response Payload received. - How can we get this in property??. Does lisa.stepname.rsp will give me the response? If yes I need to have a generic property so that it updates the step name everytime and give the result.

     

    example - insert into table abc where stepname = {{some lisa property}}  ,  url = {{some lisa property}} response = ""somelisaproperty}}

     

    I dont want to have multiple filters at each step. Need to have a generic property value name which will have updated values each time a particular step is run.

     

    Please provide your suggestions how can I have a generic framework which can be used for multiple test cases.



  • 2.  Re: Need suggestions on filtering values from REST Step using lisa property and not filters

    Posted May 04, 2017 10:35 AM

    I'm not fully understood whats the ask. But based on what I understood you can create and use SubProcess having dynamic endpoint, request , response by using properties. also add step for saving them in external file. 

     

    Later you can use this in test cases as much you want. also this can be as many times you want in even in same test case as well but I prefer to use looping as read/pass different data in each call. 

     

    Hope this helps. 

    Thanks, 

    Rajesh k Singh



  • 3.  Re: Need suggestions on filtering values from REST Step using lisa property and not filters

    Posted May 08, 2017 09:13 AM

    Vinay,

     

    Did Rajesh's recommendations help you out regarding this issue?

     

    Regards,

    Reid



  • 4.  Re: Need suggestions on filtering values from REST Step using lisa property and not filters

    Posted May 09, 2017 08:35 PM

    Rajeshk.singh15 

    Hi All,

    I am fetching the some information from Config file and few things from the test step.

     

    1) Step Name - I am using testExec.getStateValue("LISA_LAST_STEP")

    2) Request - I am using testExec.setStateValue("Request",testExec.getLastRequest());

     

    I need your inputs to help me find if we have some generic lisa property for filtering the response code and step response just like i am doing for step name and request.

     

    Currently i am using :-   ( CreateCustomer is the name of the step )

    3) Response - testExec.setStateValue("Response",testExec.getStateValue("lisa.CreateCustomer.rsp"));

    4) Response code - String Rspcode = testExec.getStateValue("lisa.CreateCustomer.http.responseCode").toString();

     

    So basically for each step, where i will be applying this scripted assertion, I need to update the step name for getting Response and Response code which I want to avoid and want to use my scripted assertion as is for all the steps. Do we have any way to do this?



  • 5.  Re: Need suggestions on filtering values from REST Step using lisa property and not filters

    Broadcom Employee
    Posted May 10, 2017 05:27 AM

    Does this work for you?

     

    // This script should return a boolean result indicating the assertion is true or false
    lastResponse = testExec.getStateValue("LASTRESPONSE");
    thisStep = "lisa." + testExec.getStateValue("LISA_LAST_STEP") + ".http.responseCode";
    Rspcode = testExec.getStateValue(thisStep);
    _logger.debug("Last response {}: {}", Rspcode, lastResponse);

    return true;



  • 6.  Re: Need suggestions on filtering values from REST Step using lisa property and not filters

    Posted May 10, 2017 08:54 PM

    Hello Rick thanks. Yeah i know we can do that using the script you mentioned, I was looking if we have some generic lisa property. anways thanks.

     

    Can you let me know how can we get step response time in lisa property or how can we capture that?



  • 7.  Re: Need suggestions on filtering values from REST Step using lisa property and not filters

    Posted Jun 08, 2017 10:08 AM

    Rick,

    Can you reply to Vinit's last response?