在离线模式下运行Firefox中的Selenium RC测试

1 投票
1 回答
1128 浏览
提问于 2025-04-16 00:39

有没有办法在离线模式下运行Selenium测试?如果我在Firefox的配置文件中设置了离线模式,Selenium就会卡在selenium.start()这一步。我使用的是Python的客户端驱动。下面是代码:

sel = selenium('localhost', 4444, '*firefox', 'file:///home/user/selenium/selenium-python/client-driver-1.0.1/inputs/input.html')
sel.start()
sel.open('file:///home/user/selenium/selenium-python/client-driver-1.0.1/inputs/input.html')

1 个回答

1

下面这段描述来自一个博客,它帮助我解决了同样的问题,不过我是用Java和JUnit测试来运行Selenium的。

我对如何用Python运行Selenium了解不多,所以我看不出你是怎么用Firefox配置文件启动Selenium RC服务器的。

也就是说:

java -jar selenium-server.jar -firefoxProfileTemplate “”

撰写回答