java - 在 Jenkins 上使用现有 Firefox 配置文件的问题
问题描述
我在 Jenkins 服务器中使用现有的 Firefox 配置文件时遇到问题。在本地,一切正常。我正在使用以下代码块来使用 Firefox 配置文件:
System.setProperty("webdriver.gecko.driver", "C:\\path\\to\\geckodriver.exe");
ProfilesIni profile = new ProfilesIni();
FirefoxProfile testprofile = profile.getProfile("selenium-profile");
FirefoxOptions opt = new FirefoxOptions();
opt.setProfile(testprofile);
WebDriver driver = new FirefoxDriver(opt);
driver.get("https://www.google.com");
詹金斯上显示的错误:
org.openqa.selenium.WebDriverException: Unexpected value for profile: null
解决方案
推荐阅读
- android - Android视觉效果隐藏和显示项目
- python - 如何返回星期几,然后从 Weather API 返回星期的名称?
- angularjs - 如何在angularjs中显示特定的div onclick
- c# - 针对特定情况的 Linq 查询中的条件 Where 子句
- css - 将 css 应用于 Twig 中的原始 html
- javascript - 将对象参数传递给另一个函数 - Javascript
- javascript - Chartist.js 动画结束事件
- python - 气流,标记任务成功或在 dag 运行之前跳过它
- akeneo - Akeneo 2.2.5:找不到带有代码“add_to_existing_product_model”的 JobInstance
- javascript - Javascript条件隐藏和显示