加载chrome用户配置
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir=C:\\Users\\test\\AppData\\Local\\Google\\Chrome\\User Data\\Default");
WebDriever driver = new ChromeDriver(options );
加载firefox用户配置
ProfilesIni allProfiles = new ProfilesIni();
FirefoxProfile profile = allProfiles.getProfile("default"); //default为火狐默认
WebDriever driver = new FirefoxDriver(profile);
本文介绍如何在Chrome和Firefox中加载特定用户的配置文件。通过设置ChromeOptions和ProfilesIni对象,可以实现不同用户配置的加载。
&spm=1001.2101.3001.5002&articleId=74919727&d=1&t=3&u=8afaf487563f4afcbf503f26e49ef186)
1万+

被折叠的 条评论
为什么被折叠?



