how to set noProxy list for firefox remotedriver?

136 views
Skip to first unread message

medv...@gmail.com

unread,
Oct 30, 2017, 11:58:57 AM10/30/17
to Geb User Mailing List
hi,
and this seems to be working

JsonObject json = new JsonObject();
json.addProperty("proxyType", "MANUAL");
json.addProperty("httpProxy", PROXY);
json.addProperty("sslProxy", PROXY);

but I could not a noProxy list as the following is not working

JsonArray jArray = new JsonArray();
jArray.add("127.0.0.1");
jArray.add("localhost");
jArray.add("selenium");
json.addProperty("noProxy", jArray);

gives me 

groovy.lang.MissingMethodException: No signature of method: com.google.gson.JsonObject.addProperty() is applicable for argument types: (java.lang.String, com.google.gson.JsonArray) values: [noProxy, ["127.0.0.1","localhost","selenium"]]
        Possible solutions: addProperty(java.lang.String, java.lang.Boolean), addProperty(java.lang.String, java.lang.Character), addProperty(java.lang.String, java.lang.Number), addProperty(java.lang.String, java.lang.String), hasProperty(java.lang.String)

or

json.addProperty("noProxy", "127.0.0.1,localhost,selenium");

gives me

org.openqa.selenium.InvalidArgumentException: "127.0.0.1,localhost,selenium" was not an array
        Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
        System info: host: '45fb2c56975f', ip: '172.17.0.4', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.74-boot2docker', java.version: '1.8.0_131'

I am very thankful for any help or hint!

Marcin Erdmann

unread,
Oct 30, 2017, 5:16:07 PM10/30/17
to Geb User Mailing List
You should use json.add("noProxy", jArray); instead of json.addProperty("noProxy", jArray);

Marcin

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/111eb978-2378-4d24-abaf-1b2f1b2e2084%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

medv...@gmail.com

unread,
Oct 31, 2017, 9:22:49 AM10/31/17
to Geb User Mailing List
Hi Marcin,

thank you very much for your help! It works as you wrote.

JsonObject json = new JsonObject();`
json.addProperty(
"proxyType", "MANUAL");`
json.addProperty(
"httpProxy"
, PROXY); `
json.addProperty(
"sslProxy", PROXY); `

JsonArray jArray = new JsonArray();`
jArray.add(
"127.0.0.1");
jArray.add(
"localhost");
jArray.add(
"selenium");

json.add("noProxy", jArray); 
caps.setCapability(CapabilityType.PROXY, json);

Unfortunately this issue blocks me https://github.com/mozilla/geckodriver/issues/1022.

Best regards,
Roland
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages