我创建了以下Java类:
public class setup {
public void browserSetup() {
// System.setProperty("webdriver.chrome.driver","/home/cangouser-38/Documents/mohan/chromedriver");
}
我的机器人框架测试用例如下:
*** Settings ***
Documentation A resource file containing the application specific keywords
Library Selenium2Library
Library com.Auto.Robot.SeleniumRobot.setup
*** Test Cases ***
Check out joe colantonio dot com
Open Browser https://www.google.com gc
Close Browser
必须通过webdriver.chrome.driver系统属性设置驱动程序可执行文件的路径;有关更多信息,请参见https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver。可以从http://chromedriver.storage.googleapis.com/index.html
下载最新版本答案 0 :(得分:0)
chromedriver。 exe :-)
使用我自己的Chrome个人资料进行设置:
// path to chromedriver.exe
System.setProperty("webdriver.chrome.driver", "C:\\Users\\pburgr\\Desktop\\chromedriver\\chromedriver.exe");
// new instace of ChromeOptions
ChromeOptions options = new ChromeOptions();
// add arg to load Chrome with my own profile instead of a temporary profile
options.addArguments("user-data-dir=C:\\Users\\pburgr\\AppData\\Local\\Google\\Chrome\\User Data");
// new instance of ChromeDriver with added args
driver = new ChromeDriver(options);
// maximaze current window, can be used later again if window get minimaze or after a new window is opened (in Chrome no switch is needed)
driver.manage().window().maximize();