-2

我正在运行一个程序,用于使用硒自动在范围报告中添加屏幕截图。程序运行完美,但我想知道下面程序中 System.getProperty 行的含义。

public class SST 
{
    public static String getScreenshot(WebDriver driver)
    {
    TakesScreenshot ts=(TakesScreenshot) driver;
        File src=ts.getScreenshotAs(OutputType.FILE);
    String path = System.getProperty("user.dir")+"/Screenshot/"+System.currentTimeMillis()+".png";
        File destination=new File(path);

        try 
        {
            FileUtils.copyFile(src, destination);
        } catch (IOException e) 
        {
            System.out.println("Capture Failed "+e.getMessage());
        }
        return path;
    }
}
4

1 回答 1

0

它正在获取用户主目录,例如C:\Users\user10796675.

于 2019-05-20T10:25:46.143 回答