Forum Discussion

Liberty_Informa's avatar
Liberty_Informa
Regular Contributor
11 years ago

[Resolved] Proxy setting as None through Groovy

Hi

How can I set Proxy setting as 'None' in the global settings through the Groovy code ?

SoapUI.settings.setString( ProxySettings.AUTO_PROXY, 'None' )


I wrote above statement but I know it is not correct. I am not getting sufficient help from the API page.

What should be the correct statement to make Proxy Setting to set to "None" ?
  • Hi,

    You can turn off proxy with the following code snippet:


    import com.eviware.soapui.SoapUI
    import com.eviware.soapui.settings.ProxySettings

    log.info "PROXY OFF!"
    SoapUI.settings.setString( ProxySettings.ENABLE_PROXY, "false")
    SoapUI.updateProxyFromSettings();



    Regards,
    Marcus
    SmartBear Support
  • Liberty_Informa's avatar
    Liberty_Informa
    Regular Contributor
    That's brilliant !

    SoapUI.updateProxyFromSettings();


    Is above line necesary?

    SoapUI.settings.setString( ProxySettings.ENABLE_PROXY, "false")


    Merely having above line gives desired result.

    I am asking because we do apply lot of other settings as part of the setup however we do not call any update method.
  • Hi,

    SoapUI.updateProxyFromSettings()


    Should only apply to the proxy, but if the proxy is being updated without calling that method then don't call it.


    Regards,
    Marcus
    SmartBear Support