java - Selenium - 无法启动浏览器 session - 访问被拒绝 - XP

标签 java windows-xp selenium

在 XP 上启动 Selenium 时出现以下错误

java.lang.RuntimeException: 
Could not start Selenium session: Failed to start new browser session: 
java.lang.RuntimeException: java.io.FileNotFoundException: 
C:\Program Files\Mozilla Firefox (Access is denied)

有什么想法吗?

最佳答案

有点明显,但看起来 Selenium 正在尝试读取/写入 Firefox 配置文件,但系统阻止了它。这可能是因为 Selenium 用户没有适当的安全权限,或者可能是其他原因锁定了对配置文件的访问。

您可以尝试运行 Sysinternals Process Explorer识别阻碍因素的工具。

Firefox 可以在复制过程中阻止对 Selenium 配置文件的访问,就像 mentioned in this related answer 一样。 。

您可能还想refer to the Selenium documentation关于配置文件处理:

Firefox will not run two instances simultaneously unless you specify a separate profile for each instance. Selenium-RC 1.0 and later runs in a separate profile automatically, so if you are using Selenium 1.0, you can probably skip this section. However, if you’re using an older version of Selenium or if you need to use a specific profile for your tests (such as adding an https certificate or having some addons installed), you will need to explicitly specify the profile.

关于java - Selenium - 无法启动浏览器 session - 访问被拒绝 - XP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4466168/

相关文章:

c++ - 将整数转换为 Little Endian 十六进制字符串

php - mysql 无法与 php 一起使用

regex - 为什么 Selenium 在连字符之前插入反斜杠?

python - pip安装selenium权限错误

python - 以前未见过的 Web 元素引用

JAVA - 字符串包含字符字母。可以检查吗?

java - 如何实现参数化运算

java - weblogic jmx tomcata php/java 桥接并让 t3 协议(protocol)正常工作

windows - 如何使用批处理文件捕获 Windows 硬件配置?

java - 使用servlet下载大文件