gpt4 book ai didi

linux - 如何设置selenium-server-standalone的tmp目录

转载 作者:太空宇宙 更新时间:2023-11-04 04:06:05 25 4
gpt4 key购买 nike

我正在 Linux VM 上运行 selenium-server-standalone-2.39.0.jar,以便以 headless 方式 (xvfb + firefox) 运行 selenium 测试。

运行时,Selenium 服务器会在 /tmp/ 中创建大量临时目录和文件,这些目录和文件在测试完成后不会被删除。

问题是我的/tmp/磁盘相当小,我想使用 /var/tmp 来实现此目的。但是,我找不到任何方法可以做到这一点。

你知道这种可能性吗?

最佳答案

Selenium 为此使用 JVM java.io.tmpdir 属性:

java/client/src/org/openqa/selenium/io/TemporaryFilesystem.java:

  private static File sysTemp = new File(System.getProperty("java.io.tmpdir"));
private static TemporaryFilesystem instance = new TemporaryFilesystem(sysTemp);

通过将 -Djava.io.tmpdir 传递给 JVM 来设置它,例如:

$ java -jar selenium-server-standalone-*.jar -Djava.io.tmpdir=/some/other/tmp

This question有关 java.io.tmpdir

的更多详细信息

关于linux - 如何设置selenium-server-standalone的tmp目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21116749/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com