c# - Selenium Authentication Popup preventing driver close or quit -


i have selenium automated task setup login website retrieve information. it's basic in automation. logging in , clicking 2 links. running issue proving problem.

the site in question uses authentication required popup not javascript popup rather regular windows auth popup. have read isn't handled out of box selenium.

i using "http://username:password@url.com" site every , site has issues on end prompt me again username/password randomly. have enter username/password twice in row when navigating there hand.

since task loops continuously few hours picking needed info figured use webdriverwait verify element present on page. if authentication popup appears, element isn't present. no need care run, start over.

the problem having when authentication popup displayed , hit timeout limit want close driver/browser window can start task on again. however, driver.close() , driver.quit() not doing anything. browser remains open , unloaded page still there login popup.

is there anyway can force close this? switch focus browser window force close?

the alert method, authenticateusing() lets skip http basic authentication box. below code tested on google chrome in java.

alert alert = driver.switchto().alert(); alert.authenticateusing(new userandpassword(username, password)); 

in case doesn't work , might want try this: https://stackoverflow.com/a/40757504/7071055


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -