客户端之前不能使用idea调试,因为路径不对,修改了一下,现在调试和start_service.cmd都能正常运行了

将System.getProperty("user.dir")替换成RunService.APPLICATION_HOME,
This commit is contained in:
wangkai 2020-09-10 10:02:45 +08:00
parent 2246e416f2
commit b8fcb50f66
1 changed files with 3 additions and 2 deletions

View File

@ -14,6 +14,8 @@ import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.ie.InternetExplorerDriver;
import luckyclient.utils.LogUtil;
import springboot.RunService;
/**
* =================================================================
@ -37,8 +39,7 @@ public class WebDriverInitialization{
*/
public static WebDriver setWebDriverForTask(int drivertype) throws WebDriverException,IOException{
// 参数为空
File directory = new File("");
String drivenpath=directory.getCanonicalPath()+File.separator+"BrowserDriven"+File.separator;
String drivenpath= RunService.APPLICATION_HOME + File.separator+"BrowserDriven"+File.separator;
WebDriver webDriver = null;
LogUtil.APP.info("准备初始化WebDriver对象...检查到当前操作系统是:{}",OS);
if(drivertype==0){