AnsweredAssumed Answered

error in Beanshell Scripting in devtest

Question asked by prat130193 on Nov 14, 2017
Latest reply on Nov 14, 2017 by Ulrich_Vogt

I am getting error in below script

 

Script is to get response body in one String and storing it as property.

 

Script: 

import com.itko.lisa.vse.stateful.model.response;
String b=LASTRESPONSE.getBodyText();
testExec.setStateValue("new",b);

 

and below is the error

============================================================================
| Error in Script
============================================================================
| Step: Execute script (JSR-223)
----------------------------------------------------------------------------
| Message: bsh.EvalError: Sourced file: inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' : Typed variable declaration : Error in method invocation: Method getBodyText() not found in class'com.itko.lisa.gui.XMLResultsCache' : at Line: 2 : in file: inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' : LASTRESPONSE .getBodyText ( )
in inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' at line number 2
----------------------------------------------------------------------------
| Trapped Exception: bsh.EvalError: Sourced file: inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' : Typed variable declaration : Error in method invocation: Method getBodyText() not found in class'com.itko.lisa.gui.XMLResultsCache' : at Line: 2 : in file: inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' : LASTRESPONSE .getBodyText ( )
in inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' at line number 2
| Trapped Message: javax.script.ScriptException: bsh.EvalError: Sourced file: inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' : Typed variable declaration : Error in method invocation: Method getBodyText() not found in class'com.itko.lisa.gui.XMLResultsCache' : at Line: 2 : in file: inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' : LASTRESPONSE .getBodyText ( )
in inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' at line number 2
----------------------------------------------------------------------------
STACK TRACE
javax.script.ScriptException: bsh.EvalError: Sourced file: inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' : Typed variable declaration : Error in method invocation: Method getBodyText() not found in class'com.itko.lisa.gui.XMLResultsCache' : at Line: 2 : in file: inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' : LASTRESPONSE .getBodyText ( )
in inline evaluation of: ``import com.itko.lisa.vse.stateful.model.response; String b=LASTRESPONSE.getBod . . . '' at line number 2
at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:102)
at bsh.BshScriptEngine.eval(BshScriptEngine.java:61)
at javax.script.AbstractScriptEngine.eval(Unknown Source)
at com.itko.lisa.test.ScriptExecHandler.executeScript(ScriptExecHandler.java:669)
at com.itko.lisa.test.ScriptExecHandler.executeScript(ScriptExecHandler.java:426)
at com.itko.lisa.test.UserScriptNode._execute(UserScriptNode.java:202)
at com.itko.lisa.test.UserScriptNode.execute(UserScriptNode.java:172)
at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)
at com.itko.lisa.test.TestCase.execute(TestCase.java:1280)
at com.itko.lisa.test.TestCase.execute(TestCase.java:1195)
at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1180)
at com.itko.lisa.editor.WalkThruPanel.prepAndExecNode(WalkThruPanel.java:1048)
at com.itko.lisa.editor.WalkThruPanel.access$900(WalkThruPanel.java:68)
at com.itko.lisa.editor.WalkThruPanel$10.doCallback(WalkThruPanel.java:961)
at com.itko.util.swing.panels.ProcessingDialog$2.run(ProcessingDialog.java:194)
at java.lang.Thread.run(Unknown Source)
============================================================================

 

 

 

getting error in getbodytext menthod and i checked its present in lisa-virtualize.jar in class com.itko.lisa.vse.stateful.model.Response.

 

can somebody please let me know whats the issue?

Outcomes