启动 Chrome 驱动程序,但无法执行任何操作? [英] Launching Chrome Driver, but not able to do any actions?

查看:68
本文介绍了启动 Chrome 驱动程序,但无法执行任何操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Chrome 中运行我的网络驱动程序测试.以下是我用来启动 Chrome 驱动程序的步骤:

I am trying to run my webdriver tests in Chrome. Here are the steps I'm using to launch Chrome driver:

设置chrome二进制路径

Set the chrome binary path

System.setProperty("webdriver.chrome.driver", "paht\\chromedriver.exe");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.switches", Arrays.asList("--start-maximized"));
capabilities.setJavascriptEnabled(true);
capabilities.setCapability("AcceptUntrustedCertificates", true);
capabilities.setCapability("AssumeUntrustedCertificateIssuer", true);
capabilities.setCapability("chrome.switches", Arrays.asList("--ignore-certificate-errors"));
driver = new ChromeDriver( capabilities);

我的 Chrome 浏览器已启动,但未运行任何测试,例如打开 url 等?有人可以帮助我完成启动工作铬浏览器所需的步骤

My Chrome browser is launched, but its not running any tests, like open url etc? Can some please assist me with the steps needed to launch working chromium browser

推荐答案

你不会去任何地方.您实际上只是打开浏览器,仅此而已.

You aren't going anywhere. You are literally just opening the browser and that's it.

在此处阅读入门页面:

http://code.google.com/p/selenium/wiki/GettingStarted

本质上,您正在寻找以下内容:

Essentially, you are looking for something like:

driver.get("http://www.google.com");

这篇关于启动 Chrome 驱动程序,但无法执行任何操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆