我在 Firefox 中使用 Selenium WebDriver。每次selenium 都会在临时文件夹中为firefox 生成新的aniumus 配置文件,并在退出后将其删除。我需要这个个人资料。我怎么才能得到它?Fe 剖面存储在
C:\Documents and Settings\Developer\Local Settings\Temp\anonymous5583304190515426768webdriver-profile
Run Code Online (Sandbox Code Playgroud)
关闭 WebDriver 后
driver.quit();
Run Code Online (Sandbox Code Playgroud)
profile 将被删除,但它已经被记录,我想在下一次迭代中使用它,通过用它初始化 WebDriver :
FirefoxDriver driver = new FirefoxDriver(new FirefoxProfile(profileFolder));
Run Code Online (Sandbox Code Playgroud)
是否可以保存配置文件而不需要像在驱动程序工作时处理整个文件夹这样的肮脏黑客行为(我什至不确定它是否有效,因为在 Windows 中,文件夹在 Firefox 启动时被锁定)?也许 Selenium 中存在一些 API?