1

After a lot of research and many tries, I wanted to know how it was possible to work with Selenium AND proxy with username/password in C#, with an headless solution (so no AutoIT script alternative).

For Chrome : -There is no options and arguments available, an authenticate window will always pop up asking for the credentials, there is apparently noway to bypass it, and the only solution would be to use an external tool to write in the window. This solution is obviously not compatible with an headless. I tried to downgrade my Selenium version to the 2.53.0 in order to test the solution with the Alert handling, but it appears that now, Chrome browser doesn't treat that windows as an alert anymore. I could maybe downgrade also my Chrome browser version, but I don't want that for now.

For FireFox : -Exactly same problem.

For IE : -The proxy is set in the registry, so I don't even know how to run manually multiple instance with different proxy.

So, my question is, how, in C#, within an HEADLESS Selenium browser (I don't mind which one), I can run a session with a proxy user/pw (without any manual of course, and if possible without any third party program, but only within Selenium) ?

tucotraff
  • 61
  • 4
  • I have answered a similar question here -https://stackoverflow.com/a/50303623/5074293. – GPT14 May 30 '18 at 15:57
  • 1
    @GPT14 thanks for the link but I already read it, and unfortunatly all of those solutions are as you said outdated, and the only remaining solution will be to downgrade chrome, which is not a very convenient way to solve that problem. but nice answer though – tucotraff May 30 '18 at 16:08
  • 1
    Check BrowserMob proxy out! It might be just the thing to solve your issue. https://browsermob-proxy-py.readthedocs.io/en/stable/client.html#browsermobproxy.Client.basic_authentication – GPT14 May 31 '18 at 06:04
  • any updates on this? – Mans Jun 06 '18 at 14:10
  • I found a way around to make it work only with ip:port and I use only ip:port config. It's such a mess to use username:password too. Sorry for you! – tucotraff Jun 06 '18 at 15:26

0 Answers0