Service Virtualization

Expand all | Collapse all

how can i enter value dynamically while lisa is running a test?

Jump to Best Answer
  • 1.  how can i enter value dynamically while lisa is running a test?

    Posted 12-14-2017 06:47 AM

    monika_mehtaDirkBleyenberg  roble04  - Guys would appreciate if you spare some time and commented on this thread.

     

    -Regards,

    Shashank

     

    **************************************

     

    Like if a service triggers an email with some kind of code which goes as input for next service?

    I did introduce a delay for email to be triggered, which is happening and I have the code now, but how do i enter that as an input in form of pop up box which can be consumed by next service?

    #monikamehta4453146

    #dynamic input

    *********************UPDATE*****************

     

    I am trying to run and use javascript in this context, to take a value from user. 

     

     

    <html>
       <head>
          
          <script type="text/javascript">
             <!--
                function getValue(){
                   var retVal = prompt("Enter your name : ", "your name here");
                   document.write("You have entered : " + retVal);
                }
             //-->
          </script>
          
       </head>
       
       <body>
          <p>Click the following button to see the result: </p>
          
          <form>
             <input type="button" value="Click Me" onclick="getValue();" />
          </form>
          
       </body>
    </html>
     

     

     

    Ran into this error. Guessing that i have to download libraries or declare dependencies.

     

    ============================================================================ 
    | Error in Script 
    ============================================================================ 
    | Step:        Execute script (JSR-223) 
    ---------------------------------------------------------------------------- 
    | Message:     ReferenceError: "window" is not defined in <eval> at line number 1


    | Trapped Exception: ReferenceError: "window" is not defined in <eval> at line number 1 
    | Trapped Message:   javax.script.ScriptException: ReferenceError: "window" is not defined in <eval> at line number 1 
    ---------------------------------------------------------------------------- 
    STACK TRACE 
    javax.script.ScriptException: ReferenceError: "window" is not defined in <eval> at line number 1 
            at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:467) 
            at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:451) 
            at jdk.nashorn.api.scripting.NashornScriptEngine.access$200(NashornScriptEngine.java:73) 
            at jdk.nashorn.api.scripting.NashornScriptEngine$3.eval(NashornScriptEngine.java:507) 
            at javax.script.CompiledScript.eval(CompiledScript.java:106) 
            at com.itko.lisa.test.ScriptExecHandler.executeCompiledScript(ScriptExecHandler.java:501)  



  • 2.  Re: how can i enter value dynamically while lisa is running a test?

    Broadcom Employee
    Posted 12-27-2017 03:09 AM

    Hello Shashank,

     I am not sure if I understand your use case completely. To my understanding you are sending an email which is having some code, which is captured and now you want to pass this into RA which is making a next service call is my understanding correct.

     

    If yes I would prefer to use RA action User Input- Ask for parameter value and than use it to be passed in system

     

    Let me clarify in case if I am missing some context on above problem.

     

    Regards,

    Saurabh



  • 3.  Re: how can i enter value dynamically while lisa is running a test?

    Posted 12-27-2017 03:41 AM

    i am executing a service which triggers an email, which in background executes some operation and generates a passcode, which can only be seen in the email once it is triggered to the recipient.

     

    I have already introduced a delay between execution of two services, during which i get the email.

     

    Then am trying to use java script to create a popup dialogue which will prompt user to enter a value and reads the value.

    Thinking that i have the correct java script.

     

    Problem here is i am unable to execute this java script via LISA, so unable to check if the script runs as expected.

     

    Not sure if i have to include dependencies or import any libraries. 

     

    I am trying to find a way to execute java script directly inside LISA.



  • 4.  Re: how can i enter value dynamically while lisa is running a test?

    Broadcom Employee
    Posted 01-02-2018 09:13 AM

    Hi 

     

    Creating a popup dialog on a script running on a agent would be  a challenge . 

    Where do you expect this dialog box to popup ? On windows the OS will not allow it by defaults 

    on linux for which user are you creating the dialog box as the agents runs as a service .

     

    I do not think this is going to work , to get input you need to use a  User Input parameter which can be provided

    when you start the deployment .

     

    Regards Dirk 



  • 5.  Re: how can i enter value dynamically while lisa is running a test?

    Posted 01-03-2018 03:07 AM

    Hi. Thank you for replying.

     

    If I understood you correctly, while it is possible to execute a javascript code on LISA, dynamic elements such as Dialogue box or pop up is not possible?

     

    Please confirm



  • 6.  Re: how can i enter value dynamically while lisa is running a test?
    Best Answer

    Posted 01-03-2018 08:19 AM

    Hi,

    This would not be how DevTest would be expected to work - tests should be able to execute from start to finish without requiring further user intervention.

     

    You could read input from a data source or dataset, but not interactively 

     

    The mental test for this is to ask what would happen if the a test was staged to a remote simulator (or a service to a remote VSE) how would it be able to obtain its input.



  • 7.  Re: how can i enter value dynamically while lisa is running a test?

    Broadcom Employee
    Posted 01-03-2018 08:18 AM

    Hi , 

     

    Not possible is not completely true if we are speaking about Release automation  , a Popup should be possible depending on the OS and the user rights . 

     

    a Dialog box would be complicated and would normally not be something you want to ( who is going to respond to this on a remote agent ) 

     

    If this is about Devtest please see David response 

     

    Regards .

    Dirk