Service Virtualization

 View Only
  • 1.  Event Listener

    Posted Jun 26, 2019 03:55 PM
    Devtest Version : 10.2.4

    Test Design Flow:
    1.Create Javascript step and add an Event listener to capture failed assertions.
    2.Call Subprocess1 and return some properties
    3.Call Subprocess2 and return some properties
    3.Remove the listener, mark test case status as pass/fail and stored the failed assertions in a property
    4.Pass the result ,failed assertions and some data to excel

    Note:
    The subprocess has an assertion which if true or false performs separate set of actions.

    Issue:
    The Event Listener is capturing the assertion which is failing in subprocess.
    Is there a way to prevent the event listener from capturing the failed assertions in subprocess.

    ------------------------------
    Yugain Sharma
    ------------------------------


  • 2.  RE: Event Listener

    Posted Jun 28, 2019 09:37 AM
    Hi Yugain,

    Yes, the event listener is a all-or-nothing feature as you are experiencing yourself.

    In those cases where I used it I would create it right before the assertion I wanted reporting on and I would remove it immediately after. That means, before the target assertion a scripted assertion (one configured to never fire) to create the event listener, and following a scripted assertion to remove it. The assertion itself would have a script step as next action and in there I would process the information and also remove the event listener.

    ------------------------------
    Cheers,
    Danny
    ------------------------------



  • 3.  RE: Event Listener

    Posted Jun 28, 2019 09:37 AM
    Hi Yugain.

    Yes, the event-listener is an all-or-nothing feature as you are experiencing yourself.

    In those cases where I have used it I would create it right before the target assertion I wanted reporting on and I would remove it immediately thereafter.
    Meaning: a scripted assertion (configured to never fire) before the target assertion to create the event listener, and a scripted assertion following it to remove it. The assertion upon firing would have a next step going to a script step where I would process the information and again removev the even-listener.

    ------------------------------
    Cheers,
    Danny
    ------------------------------



  • 4.  RE: Event Listener
    Best Answer

    Posted Jun 28, 2019 09:37 AM
    Hi Yugain.

    Yes, the event-listener is an all-or-nothing feature as you are experiencing yourself.

    In those cases where I have used it I would create it right before the target assertion I wanted reporting on and I would remove it immediately thereafter.
    Meaning: a scripted assertion (configured to never fire) before the target assertion to create the event listener, and a scripted assertion following it to remove it. The assertion upon firing would have a next step going to a script step where I would process the information and again removev the even-listener.

    ------------------------------
    Cheers,
    Danny
    ------------------------------



  • 5.  RE: Event Listener

    Posted Jun 28, 2019 09:43 AM

    And apologies for the spamming but my browser did not indicate that that my response was sent, it looked like it disappeared, multiple times, but it didn't ��

     

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