Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid capabilities in firstMatch element 0: a proxy type named MANUAL is specified, but proxy type must be 'pac', 'noproxy', 'autodetect', 'system', or 'manual' #4574

Closed
kongkong56 opened this issue Aug 25, 2017 · 16 comments

Comments

@kongkong56
Copy link

Meta -

OS: WINDOWS10
Selenium Version: 3.5.1
Browser: Internet Explorer 11

Browser Version: 11.1593.14393.0 64bit

c#
error :
Invalid capabilities in firstMatch element 0: a proxy type named MANUAL is specified, but proxy type must be 'pac', 'noproxy', 'autodetect', 'system', or 'manual'

@barancev
Copy link
Member

For issues please provide a concise reproducible test case and describe what results you are seeing and what results you expect.

See CONTRIBUTING.md

@kongkong56
Copy link
Author

Expected Behavior -

internet explorer browser should opened and can open by proxy

Actual Behavior -

Unable to open internet explorer

Steps to reproduce -

Lunch hub and node with selenium standalone server 3.5.1
refer attached batch files to start hub and node

My code:
private InternetExplorerOptions GetOptions()
{
var options = new InternetExplorerOptions();
var proxy = new OpenQA.Selenium.Proxy();
options.UsePerProcessProxy = true;
proxy.Kind = ProxyKind.Manual;
proxy.HttpProxy = requestArgs.ProxyIP;
proxy.SslProxy = requestArgs.ProxyIP;
proxy.IsAutoDetect = false;
proxy.NoProxy = string.Empty;
options.Proxy = proxy;
options.BrowserCommandLineArguments = "--private";
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
options.IgnoreZoomLevel = true;
return options;
}
private InternetExplorerDriverService InitService()
{
string driverPath = Helper.GetAppSetting("IedriverPath");
var service = InternetExplorerDriverService.CreateDefaultService(driverPath);
service.HideCommandPromptWindow = true;
return service;

    }
             var options = GetOptions();
                var service = InitService();
                driver = new InternetExplorerDriver(service, options);
                driver.Manage().Window.Maximize();
                    driver.Navigate().GoToUrl(url);

Error:
Invalid capabilities in firstMatch element 0: a proxy type named MANUAL is specified, but proxy type must be 'pac', 'noproxy', 'autodetect', 'system', or 'manual'

在 OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
在 OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
在 OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
在 OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
在 OpenQA.Selenium.IE.InternetExplorerDriver..ctor(InternetExplorerDriverService service, InternetExplorerOptions options)
在 DataAnalysis.SpiderService.Spider.IE.Get(String url, RequestArgs requestArgs)

@jimevans
Copy link
Member

This is a bug in the IE driver. The spec language changed to indicate the passed-in value should be lowercased, and the driver does not adhere to that statement in the spec.

@barancev
Copy link
Member

@jimevans Are you sure it's the driver issue? Would you clarify my reading of the specification. The spec lists proxy types in lowercase. IEDriverServer expects them to be in lowercase. But all language bindings send uppercase strings.

There was a patch that suggested to treat them as case-insensitive: w3c/webdriver#870 , but I can't see it in the current editors draft of the specification, so it must be reverted.

@jimevans
Copy link
Member

From Section 7.1 (Proxy), in the algorithm to "deserialize a proxy," step 3, substep 3:

If key is equal to "proxyType", let value be the result of lowercasing value.

@barancev
Copy link
Member

Editors draft have different wording:
https://w3c.github.io/webdriver/webdriver-spec.html#proxy

@jimevans
Copy link
Member

You're right, of course, @barancev. I'm not in front of my laptop at the moment, and doing this on my phone, so I had an older draft of the spec queued up. Either way, it needs to be fixed in a component I maintain, so it's work for me either way.

@barancev
Copy link
Member

@shs96c said the bindings should be changed to send proxy type in lowercase.

@barancev
Copy link
Member

Java binding sends wrong payload too: https://gist.github.com/barancev/7ab7bbe91a59ab7bcbfb2c399d0202ab

@barancev
Copy link
Member

Sorry, Java appears to be all right, the parts of payload required by W3C spec contain lowercased proxy type.

@barancev barancev removed the C-java label Aug 25, 2017
@shs96c
Copy link
Member

shs96c commented Aug 25, 2017

Yeah. This is messy. We want to retain backwards compatibility, so "desiredCapabilities" should retain the upper-casing for proxyType (meaning a new client can talk to a 2.x server).

The spec, however, says anything in the w3c new session payload must be spec compliant, which means that "capabilities.firstMatch" and "capabilities.alwaysMatch" should have a lower-case proxyType.

@ara-medina
Copy link

ara-medina commented Aug 30, 2017

Any update on this issue? I'm getting the same error, and here is my code:

Server server = new Server(@"C:\Users\sandra\Desktop\B\Dependencies\BrowserMobProxy\bin\browsermob-proxy.bat");
server.Start();
Client client = server.CreateProxy();
client.NewHar("google");
var seleniumProxy = new Proxy { HttpProxy = client.SeleniumProxy, FtpProxy = client.SeleniumProxy, SslProxy = client.SeleniumProxy };

var options = new InternetExplorerOptions();
options.Proxy = seleniumProxy;
            
InternetExplorerDriver driver = new InternetExplorerDriver(options);
driver.Navigate().GoToUrl("http://www.google.co.uk");

@p0deje
Copy link
Member

p0deje commented Aug 31, 2017

91be330 fixes this in Ruby bindings.

@p0deje p0deje removed the C-rb label Aug 31, 2017
jimevans added a commit that referenced this issue Aug 31, 2017
@jimevans
Copy link
Member

Fixed for .NET in eead3f1

@jimevans jimevans removed the C-dotnet label Aug 31, 2017
lmtierney added a commit that referenced this issue Sep 1, 2017
@lmtierney
Copy link
Member

Fixed for python in e9d3ff1

@lmtierney lmtierney removed the C-py label Sep 1, 2017
Tom-Trumper pushed a commit to Tom-Trumper/selenium that referenced this issue Sep 11, 2017
Tom-Trumper pushed a commit to Tom-Trumper/selenium that referenced this issue Sep 11, 2017
@jleyba jleyba assigned jleyba and unassigned jleyba Oct 3, 2017
@jleyba
Copy link
Contributor

jleyba commented Oct 5, 2017

nodejs bindings have always sent lowercase proxy type.

Closing this issue since node was the last language tagged.

@jleyba jleyba closed this as completed Oct 5, 2017
@jleyba jleyba removed the C-nodejs label Oct 5, 2017
@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants