【发布时间】:2019-06-22 12:40:45
【问题描述】:
我正在尝试在 Chrome Webdriver 中添加用户配置文件首选项,以设置应在启动时打开的特定网站列表,但我无法实现。
我正在使用最新的 Selenium Chrome Web 驱动程序,并尝试了多种方法来使其正常工作。 Chrome 实例始终打开“数据;”选项卡,而不打开一组必需的页面。我在这里找到了 Chrome 首选项:https://chromium.googlesource.com/chromium/src/+/master/chrome/common/pref_names.cc
optionOn.AddUserProfilePreference("session.restore_on_startup", 4)
Dim wbs As New List(Of String)(New String() {"https://google.com", "https://google.com", "https://google.com", "https://google.com"})
optionOn.AddUserProfilePreference("session.startup_urls", wbs)
我希望每次用户运行可执行文件时打开 4 个选项卡。没有错误消息,结果 ChromeDriver 忽略了我设置的用户配置文件首选项。
【问题讨论】:
-
您可以尝试使用任意数量的浏览器实例和相应的 URL 进行并行测试,这是否满足您的要求?还是您希望所有 URL 都在一个浏览器实例中?
-
@ChandraShekhar 我需要一个浏览器实例。
标签: vb.net selenium selenium-chromedriver