Service Virtualization

 View Only
  • 1.  How to get only the body from vse.image.response of the response content is Flat Text?

    Posted Jul 15, 2019 12:22 PM
    How to get only the body from vse.image.response when content is Flat Text being returned from VSI?

    e.g.
    Current Response is coming as:
    <data contentType="text" contentLength="1019">
    <![CDATA[TEST IS SUCCESSFUL]]>
    </data>

    What property or attribute can i use to extract and store only "TEST IS SUCCESSFUL" from the vse.image.response?

    ------------------------------
    Best Regards,
    Nick.
    ------------------------------


  • 2.  RE: How to get only the body from vse.image.response of the response content is Flat Text?
    Best Answer

    Broadcom Employee
    Posted Jul 15, 2019 02:39 PM
    VS response is in a transient form. To get the response body, you can add Scripted assertion and write code the capture the response body in to a property. Below is the code you can use:

    import com.itko.lisa.vse.stateful.model.TransientResponse; 

    responseList = testExec.getStateObject("lisa.vse.response"); 
    TransientResponse response = responseList.get(0); 
    String respText = testExec.parseInState(response.getBodyText()); 
    testExec.setStateValue("RespBody",respText); 
    return true; 

    The RespBody property have the response.

    Note: Set the assertion logic "If False to Fail" as code returns true, the assertion never fails

    -Prema


  • 3.  RE: How to get only the body from vse.image.response of the response content is Flat Text?

    Posted Jul 16, 2019 08:49 AM
    thanks Prema, i knew that can be tried with scripted assertion, though was looking for direct value. I will try the above for sure as it seems that's the only option.

    ------------------------------
    Best Regards,
    Nick.
    ------------------------------



  • 4.  RE: How to get only the body from vse.image.response of the response content is Flat Text?

    Posted Jul 16, 2019 01:36 AM

    Can you let us know in your service image editor what is the exact content of the response? Is it only the flat text?

     

    Cheers,

    Danny

     

    ::DISCLAIMER::
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------





  • 5.  RE: How to get only the body from vse.image.response of the response content is Flat Text?

    Posted Jul 16, 2019 08:47 AM
    Hi Danny,

    It's something like this in VSI-Match Response

    ***************************
    88800000TXT9090 090909 079098
    56N 07097098JLJSDLKSDKNF001
    78AJ00000DNLLNLKNKLD888888
    ***************************

    ------------------------------
    Best Regards,
    Nick.
    ------------------------------



  • 6.  RE: How to get only the body from vse.image.response of the response content is Flat Text?

    Posted Jul 16, 2019 09:05 AM

    Can you please indicate how the body of your response inside the VSI:

    88800000TXT9090 090909 079098
    56N 07097098JLJSDLKSDKNF001
    78AJ00000DNLLNLKNKLD888888

    is related to:

    TEST IS SUCCESSFUL

    ?

     

    If that is the response that you want than can you not put the text: TEST IS SUCCESSFUL as your response inside your VSI?

     

    Cheers,

    Danny

     

    ::DISCLAIMER::
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------