Service Virtualization

  • 1.  Unable to execute Selenium Script with Chrome/IE Driver

    Posted Oct 19, 2015 04:14 PM

    We are trying to call a selenium code placed inside a beanshell script. This is working fine with the default driver Firefox but not working with Chrome and IE.

     

    We have also mentioned selenium.browser.type and selenium.chrome.driver.path in project.property

     

    Code:-

    System.setProperty("webdriver.chrome.driver", LISA_RELATIVE_PROJ_ROOT+\\Tests\\SeleniumValidationPOC\\driver\\chromedriver.exe);

    WebDriver  wd = new ChromeDriver();

     

    There is no issue in path and chromeDriver.exe is present inside driver folder.

     

    Getting the following error.

     

    Target exception: java.lang.SecurityException: Scripts cannot call Runtime.exec()

    in inline evaluation of: ``import java.util.concurrent.TimeUnit;  import java.util.Date;  import java.io.Fi . . . '' at line number 23

    at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:97)

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



  • 2.  Re: Unable to execute Selenium Script with Chrome/IE Driver

    Broadcom Employee
    Posted Oct 19, 2015 04:36 PM

    Can you provide your project.config file?  What version of DevTest are you on?



  • 3.  Re: Unable to execute Selenium Script with Chrome/IE Driver

    Posted Oct 19, 2015 05:04 PM

    Hi MarcyNunns,

    Thanks for your quick response.

    Devtest version : 8.0.2

     

    Project.config Content

     

    #Fri Oct 16 11:36:32 CDT 2015

    SUBPROCESS_PATH=\\\\visnpapp134\\jenkins\\workspace\\CA_UpdateSharedSubprocess\\SharedSubprocess\\Tests\\Subprocesses

    lisa.http.webProxy.ssl.host=internal.proxy.used.here

    lisa.http.webProxy.host=internal.host.used.here

    lisa.http.webProxy.ssl.port=8080

    lisa.http.webProxy.port=8080

    isa.http.webProxy.host.account=******

    lisa.http.webProxy.host.credential=******

    lisa.http.webProxy.host.domain=NA

    PROTOCOL=https

    Release=aug2015

    selenium.browser.type=Chrome

    selenium.chrome.driver.path={{LISA_RELATIVE_PROJ_ROOT}}\\Tests\\SeleniumValidationPOC\\driver\\chromedriver.exe

    PORTAA=80

    PORTAA1=443

    AUTOVERA_AUTHORIZATION=Basic Y2N3ZHF3ZWI6Q0ByU2hAcmVXZWI\=

    ENDPOINT=https\://enterprise-int1-aem.enterprise.com/en/home.html

    Env=PCS

    DQ_Endpoint=test-reservations.phillycarshare.org

    resultTimeStamp={{\\\=new org.joda.time.DateTime(new Date()).toString("yyyy-MM-dd'T'HH-mm-ss")}}

    selenium.ie.driver.path={{LISA_RELATIVE_PROJ_ROOT}}\\Tests\\SeleniumValidationPOC\\driver\\IEDriverServer.exe

    selenium.enable.waitfor=true



  • 4.  Re: Unable to execute Selenium Script with Chrome/IE Driver

    Broadcom Employee
    Posted Oct 20, 2015 08:40 AM

    Suggestions:

     

    I would move selenium.chrome.driver.path outside of your DevTest Project, for example C:\SeleniumDrivers\chromedriver.exe

    Remove selenium.ie.driver.path={{LISA_RELATIVE_PROJ_ROOT}}\\Tests\\SeleniumValidationPOC\\driver\\IEDriverServer.exe from your Project.config, I like to keep my Firefox, IE and Chrome in separate projects, this way I know for sure one driver is not being picked up before another.

     

    Run your test again and see if this helps.



  • 5.  Re: Unable to execute Selenium Script with Chrome/IE Driver

    Posted Oct 20, 2015 11:23 AM

    Hi MarcyNunns

    I did the above changes. Removed IE Driver Path and updated the Chrome Driver Path. Still getting the same error.

    If I run my code in eclipse it is invoking the chrome browser but not able to call from Beanshell.



  • 6.  Re: Unable to execute Selenium Script with Chrome/IE Driver

    Broadcom Employee
    Posted Oct 20, 2015 11:57 AM

    I would suggest you open a support case on ca.com so we can look at this in more detail.

     

    When you open the case, please also include the following artifacts:

     

    1. Include the test case which has the script node. 

    2. project.config

    3. The workstation.log

     

    Regards,

    Marcy



  • 7.  Re: Unable to execute Selenium Script with Chrome/IE Driver

    Posted Oct 20, 2015 12:16 PM

    Hi MarcyNunns

    Can you please let me know which location the workstation.log get stored?



  • 8.  Re: Unable to execute Selenium Script with Chrome/IE Driver
    Best Answer

    Broadcom Employee
    Posted Oct 20, 2015 12:22 PM

    On Windows it is C:\users\<username>\lisatmp_8.5.0 folder.



  • 9.  Re: Unable to execute Selenium Script with Chrome/IE Driver

    Broadcom Employee
    Posted Oct 20, 2015 12:22 PM

    rather C:\users\<username>\lisatmp_8.x.0 folder where x will be the dot release number.



  • 10.  Re: Unable to execute Selenium Script with Chrome/IE Driver

    Posted Jan 15, 2016 03:19 PM

    Hi, was this issue solved? Thanks



  • 11.  Re: Unable to execute Selenium Script with Chrome/IE Driver

    Posted Jan 15, 2016 02:53 PM

    I'm facing the same issue. How did you resolve it? Thanks