AnsweredAssumed Answered

Unable to execute Selenium Script with Chrome/IE Driver

Question asked by SudiptaSen on Oct 19, 2015
Latest reply on Jan 15, 2016 by IvanM

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

Outcomes