Service Virtualization

  • 1.  Error in Custom Java Code Step in DevTest 9.5

    Posted Feb 01, 2017 02:46 AM

    Hi All,

     

    I am using Custom Java Code Step for performing some actions (maximize browser window,scroll down in webpage) in my GUI Test Case .I am using Selenium Steps together Custom Java Code Steps.All these actions were working fine in DevTest 8.4 version (which I was using till now).But when I upgraded to Devtest 9.5.1 ,I am getting the below mentioned error.Please suggest further.

     

    Code inside Custom Java Code Step (JSR 223):

    1) Maximize window

    import org.openqa.selenium.remote.RemoteWebDriver;
    RemoteWebDriver driver = testExec.getStateObject("selenium.testrun").getDriver();
    driver.manage().window().maximize();

     

    2) Scroll Down in WebPage

    import org.openqa.selenium.remote.RemoteWebDriver;
    import org.openqa.selenium.JavascriptExecutor;

     

    RemoteWebDriver driver = testExec.getStateObject("selenium.testrun").getDriver();
    JavascriptExecutor sc = (JavascriptExecutor)driver;
    sc.executeScript("window.scrollBy(0,400)","");

     

    Error Observed:

     

     

    ============================================================================
    | Error in Script
    ============================================================================
    | Step: ScrollDown
    ----------------------------------------------------------------------------
    | Message: bsh.EvalError: Sourced file: inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' : Typed variable declaration : Error in method invocation: Method getDriver() not found in class'com.itko.lisa.glass.SeleniumTestNode$SeleniumState' : at Line: 6 : in file: inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' : .getDriver ( )
    in inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' at line number 6
    ----------------------------------------------------------------------------
    | Trapped Exception: bsh.EvalError: Sourced file: inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' : Typed variable declaration : Error in method invocation: Method getDriver() not found in class'com.itko.lisa.glass.SeleniumTestNode$SeleniumState' : at Line: 6 : in file: inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' : .getDriver ( )
    in inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' at line number 6
    | Trapped Message: javax.script.ScriptException: bsh.EvalError: Sourced file: inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' : Typed variable declaration : Error in method invocation: Method getDriver() not found in class'com.itko.lisa.glass.SeleniumTestNode$SeleniumState' : at Line: 6 : in file: inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' : .getDriver ( )
    in inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' at line number 6
    ----------------------------------------------------------------------------
    STACK TRACE
    javax.script.ScriptException: bsh.EvalError: Sourced file: inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' : Typed variable declaration : Error in method invocation: Method getDriver() not found in class'com.itko.lisa.glass.SeleniumTestNode$SeleniumState' : at Line: 6 : in file: inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' : .getDriver ( )
    in inline evaluation of: ``import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.J . . . '' at line number 6
    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:674)
    at com.itko.lisa.test.ScriptExecHandler.executeScript(ScriptExecHandler.java:427)
    at com.itko.lisa.test.UserScriptNode._execute(UserScriptNode.java:210)
    at com.itko.lisa.test.UserScriptNode.execute(UserScriptNode.java:175)
    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1288)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1203)
    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1188)
    at com.itko.lisa.utils.ExecSubProcessNode.doFullExec(ExecSubProcessNode.java:354)
    at com.itko.lisa.utils.ExecSubProcessNode.execute(ExecSubProcessNode.java:268)
    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1288)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1203)
    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1188)
    at com.itko.lisa.utils.ExecSubProcessNode.doFullExec(ExecSubProcessNode.java:354)
    at com.itko.lisa.utils.ExecSubProcessNode.execute(ExecSubProcessNode.java:268)
    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1288)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1203)
    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1188)
    at com.itko.lisa.utils.ExecSubProcessNode.doFullExec(ExecSubProcessNode.java:354)
    at com.itko.lisa.utils.ExecSubProcessNode.execute(ExecSubProcessNode.java:268)
    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1288)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1203)
    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1188)
    at com.itko.lisa.utils.ExecSubProcessNode.doFullExec(ExecSubProcessNode.java:354)
    at com.itko.lisa.utils.ExecSubProcessNode.execute(ExecSubProcessNode.java:268)
    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1288)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1203)
    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1188)
    at com.itko.lisa.utils.ExecSubProcessNode.doFullExec(ExecSubProcessNode.java:354)
    at com.itko.lisa.utils.ExecSubProcessNode.execute(ExecSubProcessNode.java:268)
    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1288)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1203)
    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1188)
    at com.itko.lisa.editor.WalkThruPanel.prepAndExecNode(WalkThruPanel.java:1058)
    at com.itko.lisa.editor.WalkThruPanel.access$900(WalkThruPanel.java:71)
    at com.itko.lisa.editor.WalkThruPanel$10.doCallback(WalkThruPanel.java:965)
    at com.itko.util.swing.panels.ProcessingDialog$2.run(ProcessingDialog.java:194)
    at java.lang.Thread.run(Unknown Source)
    ============================================================================

     

     

    Thanks

    Sarthak Gupta



  • 2.  Re: Error in Custom Java Code Step in DevTest 9.5
    Best Answer

    Broadcom Employee
    Posted Feb 01, 2017 09:56 AM

    Sartha,

     

    Please open a support case, I think I can get a fix for this, but need to do it through CA Support Online.

     

    Thanks,

    Marcy



  • 3.  Re: Error in Custom Java Code Step in DevTest 9.5

    Posted Feb 01, 2017 10:25 AM

    Hi Marcy,

     

    We have a ticket on this already.

    Ticket number is 00661850.

     

    Please let us know if more details are needed.

     

    Thanks in advance.

     

    Regards,

    Mohan



  • 4.  Re: Error in Custom Java Code Step in DevTest 9.5

    Posted Feb 02, 2017 02:21 AM

    HI Marcy,


    Can you please take up the given ticket so that we can try to have the issue resolved.

     

    Thanks

    Sarthak Gupta



  • 5.  Re: Error in Custom Java Code Step in DevTest 9.5

    Broadcom Employee
    Posted Feb 08, 2017 09:04 AM

    Sarthak,

     

    Your case has been transferred to sustaining engineering, as soon as we have an answer we will get it to you.

     

    Marcy



  • 6.  Re: Error in Custom Java Code Step in DevTest 9.5

    Posted Feb 13, 2017 04:53 AM

    Hi Marcy,

     

    PFB the response that we got from the sustaining engineering team.

    "

    Hi Mohan,

     

    Thank you for your time on call today. As discussed, the functionality that you are using is, unfortunately, not a part of our published SDK – we are unable to provide assistance for functionality that does not exist within our published interfaces.

     

    We appreciate that this worked in a previous release, even though it is neither in our SDK nor supported in that release. It is unfortunate that you were provided this information via the DevTest Communities site as it has resulted in the development of tests that will not function when this internal code has changed.

     

    We regret that we will not be able to address your issue as a defect since the call that you are using is not designed for direct use – we would suggest that, should this functionality be required, an enhancement request be made to add this to a future release. We will be more than happy to provide a document outlining the process for this.

     

    Best Regards,

    Javed

    Global Customer Success

     

    Dedicated Service Virtualization Resources:

    http://www.ca.com/us/support/ca-support-online/support-by-product/ca-service-virtualization.aspx

    ref:_00D306yn4._500a01EpmHz:ref

    "

     

    Thanks & Regards,

    Mohan