我正在尝试在同一个实例中启动selenium和selenium服务器。我使用RemoteControlConfiguration.setLogOutFileName($ myFileName)来指定我的日志文件,但我总是以调试模式获取日志。我需要的水平是信息,任何建议?
protected static RemoteControlConfiguration rcc = new RemoteControlConfiguration(); protected static SeleniumServer服务器;
protected void startServer(String portList,String logPath)抛出异常{
String portStr[] = portList.split(";");
int portNum = 0;
for (int i = 0; i < portStr.length; i ++){
portNum = Integer.parseInt(portStr[i]);
String logName = "selenium-server-" + portStr[i] + ".log";
try{
rcc.setPort(portNum);
rcc.setBrowserSideLogEnabled(false);
rcc.setDontTouchLogging(false);
rcc.setDebugMode(false);
rcc.setEnsureCleanSession(true);
rcc.setReuseBrowserSessions(true);
rcc.setLogOutFileName(logPath + logName);
server = new SeleniumServer(false, rcc);
server.start();
server.getServer().start();
break;
}catch(Exception e){
Thread.sleep(1000);
}
}
}