1

I'm using a proxy in my webdriver, and it has a user/pass authentication dialogue that pops up. After a lot of searching I decided the easiest way to deal with it is to use an autoit script which looks like this:

#Include <File.au3>

WinWaitActive("Authentication Required")
Send(proxyuser)
Send("{TAB}")
Send(proxyuser)
Send("{ENTER}")

I invoke the script like so:

subprocess.run('proxyscript.exe')

The problem is, after I do this, anything running in my python selenium web driver script gives the error "No modal dialog is currently open". I'm not really sure what it means or how to fix it.

My webdriver settings look like this:

        caps = DesiredCapabilities().FIREFOX
        caps["pageLoadStrategy"] = "eager"
        fp = webdriver.FirefoxProfile('firefoxadblocked')

        proxyString = ad_proxy_array[0] + ':' + ad_proxy_array[1]

        caps['proxy'] = {
                    "proxyType": "manual",
                    "httpProxy": proxyString,
                    "ftpProxy": proxyString,
                    "sslProxy": proxyString
                }
chow
  • 19
  • 1
  • You should be able to handle the pop with webdriver itself without the use of autoit. – Amit Jun 10 '18 at 02:04
  • How so? I've searched about using proxies with authentication and just can't find a simple solution to it directly in selenium. – chow Jun 10 '18 at 02:06
  • https://stackoverflow.com/questions/27322871/handling-authentication-required-alert-box-with-python-2-7-selenium-webdrive – Amit Jun 10 '18 at 02:08

1 Answers1

0

Such tricks were possible in FF 53. I've moved to FF 60 recently, and it's over. Once you change something with Autoit (open tabs, change UserAgent, for example), Selenium gets broken.