如何使用 Selenium 运行 Chrome Beta 版和 Chrome 驱动程序?
How to run the Chrome Beta version with ChromeDriver using Selenium?
我正在尝试 运行 chrome beta 版本与 selenium Web 驱动程序。
当我 运行 测试用例时,我在控制台上收到以下错误请看图片:
我在节点配置文件中添加了以下行:
{
"capabilities": [
{
"platform": "WINDOWS",
"browserName": "chrome",
"webdriver.chrome.driver":"drive:\selenium\chromedriver.exe",
"chromeOptions": "drive:\Program Files (x86)\Google\Chrome Beta\Application\chrome.exe",
}
]
我正在使用以下设置:
Selenium=2.53
chrome Web-driver= 80_0_3987_16
Google chrome= 80.0.3987.66 (Official Build) beta (64-bit)
我们有集线器和节点设置以及从 GO cicd 服务器执行的自动化测试套件。
任何帮助将不胜感激,谢谢
至 运行 google-chrome 浏览器变体之一:
- Chrome金丝雀
- Chrome 来自 开发频道
- 用于 Windows x64
的 Chromium 原始版本
您需要从任一官方存储库下载最新的 Chromium 二进制文件:
您可以使用以下解决方案:
代码块:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
public class A_Chrome_Canary {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\Utility\BrowserDrivers\chromedriver.exe");
ChromeOptions opt = new ChromeOptions();
opt.setBinary("C:\Users\AtechM_03\AppData\Local\Google\Chrome SxS\Application\chrome.exe");
WebDriver driver = new ChromeDriver(opt);
driver.get("https://www.google.com/");
System.out.println(driver.getTitle());
}
}
控制台输出:
Google
浏览器快照:
这对我有用
chrome_options.binary_location = "C:/Program Files/Google/Chrome Beta/Application/chrome.exe"
我正在尝试 运行 chrome beta 版本与 selenium Web 驱动程序。 当我 运行 测试用例时,我在控制台上收到以下错误请看图片:
我在节点配置文件中添加了以下行:
{
"capabilities": [
{
"platform": "WINDOWS",
"browserName": "chrome",
"webdriver.chrome.driver":"drive:\selenium\chromedriver.exe",
"chromeOptions": "drive:\Program Files (x86)\Google\Chrome Beta\Application\chrome.exe",
}
]
我正在使用以下设置:
Selenium=2.53
chrome Web-driver= 80_0_3987_16
Google chrome= 80.0.3987.66 (Official Build) beta (64-bit)
我们有集线器和节点设置以及从 GO cicd 服务器执行的自动化测试套件。 任何帮助将不胜感激,谢谢
至 运行 google-chrome 浏览器变体之一:
- Chrome金丝雀
- Chrome 来自 开发频道
- 用于 Windows x64 的 Chromium 原始版本
您需要从任一官方存储库下载最新的 Chromium 二进制文件:
您可以使用以下解决方案:
代码块:
import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; public class A_Chrome_Canary { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\Utility\BrowserDrivers\chromedriver.exe"); ChromeOptions opt = new ChromeOptions(); opt.setBinary("C:\Users\AtechM_03\AppData\Local\Google\Chrome SxS\Application\chrome.exe"); WebDriver driver = new ChromeDriver(opt); driver.get("https://www.google.com/"); System.out.println(driver.getTitle()); } }
控制台输出:
Google
浏览器快照:
这对我有用
chrome_options.binary_location = "C:/Program Files/Google/Chrome Beta/Application/chrome.exe"