[英]How to run firefox browser as a different user with Selenium Webdriver?
我正在Selenium測試中嘗試以其他用戶身份運行Firefox。 如何告訴Selenium以“指定”用戶身份運行? 我的應用程序具有Windows身份驗證,並且我需要運行具有不同角色的測試。
這可以通過創建Firefox配置文件來完成,使用firefox.exe -p啟動配置文件管理器
根據需要創建配置文件后,請使用配置文件名稱並啟動驅動程序:
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile("profileName");
WebDriver driver = new FirefoxDriver(myprofile);
希望這可以幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.