2

我正在尝试在同一实例中启动 selenium 和 selenium 服务器。我使用 RemoteControlConfiguration.setLogOutFileName($myFileName) 来指定我的日志文件,但我总是在调试模式下获取日志。我需要的级别是信息,有什么建议吗?

protected static RemoteControlConfiguration rcc = new RemoteControlConfiguration(); 受保护的静态 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);
    }
}       

}

4

0 回答 0