我想打開一個內部網網站與硒重定向到另一個鏈接登錄,並返回到有效登錄的原始URL。例如 - 當我啓動webdriver並導航到原始網站的URL https://DemoOriginalWebsite.Com
瀏覽器被重定向到https://Validateyourselfbeforeaccessing.com:9030
並顯示下面的彈出窗口輸入用戶名和密碼。如何填寫身份驗證與鉻硒鉻彈出#
我試圖如下傳遞憑證,但沒有奏效。
嘗試1:http://username:[email protected]
嘗試2:https://username:pswdValidateyourselfbeforeaccessing.com:9030
認證URL不能被直接訪問。
我的實際代碼:
IWebDriver chromeDriver;
ChromeOptions options = new ChromeOptions();
options.AddArgument("disable-infobars");
options.AddUserProfilePreference("credentials_enable_service", false);
options.AddUserProfilePreference("profile.password_manager_enabled", false);
chromeDriver = new ChromeDriver(options);
chromeDriver.Manage().Window.Maximize(); chromeDriver.Navigate().GoToUrl(@"http://username:[email protected]");
任何建議,請。
謝謝。讓我嘗試。 –
酷兄弟。 AutoIT就像你一樣令人驚歎。我已將網絡驅動程序更改爲Internet Explorer,因爲它可以讓我彈出適當的窗口。將添加我的工作代碼,以供讀者參考。謝謝。 –
也有一個內容豐富的視頻。 https://youtu.be/civzNtKTCD0 –