我正在用C#编写我的测试用例。当我尝试运行它们时,FF会生成不受信任的连接错误。我试图添加新的配置文件,添加约:config“accept.all.certs = true”值,我也试图禁用使用在线证书状态协议。但每当我再次运行我的测试用例时,它似乎“忘记”了我所做的所有更改。
答案 0 :(得分:0)
您必须创建专用的FF / Selenium配置文件。 Here是一篇可以帮助您入门的帖子。创建后,请确保在配置文件中保存例外(接受不受信任的连接)。
完成后,您可以使用自定义配置文件在脚本中调用FF,如下所示
RemoteControlConfiguration settings = new RemoteControlConfiguration();
File f = new File("C:\\selenium-profile"); //Path of your stored custom profile
settings.setFirefoxProfileTemplate(f);
SeleniumServer seleniumserver=new SeleniumServer(settings);
seleniumserver.boot();
seleniumserver.start();
这是Java,但可以适应C#