ERR_TUNNEL_CONNECTION_FAILED while accessing web application through Proxy in Robot Framework

Hello community,

I was setting up proxy in robot framework using SeleniumLibrary.
Intention was to access web application url through VPN connected. VPN was blocking the access to that web application, but it can be achieved through proxy.

Here is the way I achieved it:

created proxy_chrome.py with code as:

from robot.libraries.BuiltIn import BuiltIn
from selenium import webdriver

def Chrome_browser_options():
    PROXY = "<ip address of proxy>:<port number>"
    chrome_options = webdriver.ChromeOptions()
    chrome_options.add_argument("--no-sandbox")
    chrome_options.add_argument("--disable-gpu")
    chrome_options.add_argument("--start-maximized")
    chrome_options.add_argument('--proxy-server=http://%s' % PROXY)
    return chrome_options

Then called it in my robot framework script as:

*** Settings ***
Library           DatabaseLibrary
Library           OperatingSystem
Library           SeleniumLibrary
Library           Collections
Library           RequestsLibrary
Library           ../Libraries/proxy_chrome.py

*** Test Cases ***
TestTry
    ${chrome options}=    Chrome_browser_options
    Create Webdriver    Chrome    chrome_options=${chrome options}
    Go To    <web application url>

However, I got the exception as below:

WebDriverException: Message: unknown error: net::ERR_TUNNEL_CONNECTION_FAILED

Can someone help me on this.

My issue is fixed by disabling Proxy Setting.

Hello @Pravin_Shirsath
Did you solve your problem because I’m facing the same issue here ?