-
Notifications
You must be signed in to change notification settings - Fork 5.8k
How to set a proxy for webdriver? Via command-line or capabilities? #12420
Comments
From my experience the CLI arguments are the only ones that work. Using DesiredCapabilities is not working, so the output of negotiatedCapabilities is meaningless... |
Thanks, thtat's what I ended up understanding making a few tryouts by accessing a personal server from various phantom configs. |
@OndraM if desired capabilities is not working then what it the work around on this? |
@kenju254 I must start the phantomjs with command line options, like |
@OndraM Have you found a solution now? |
@Accagain2014 and @OndraM i succeeded to get a solution to this . i must have forgotten to share |
@kenju254 Can you share with us? |
@boogheta Have you solved this problem? This troubles me a lot now. I can't find a way. |
@Accagain2014: As @OndraM said, you shouldn't trust the negotiatedCapabilities outputted in the log. If you run phantom from command line with the |
@boogheta I think it's a phantomjs problem, not the ghostdriver problem. |
This proves your proxy works, not that your call with Phantom does not use it. You say you have errors, can you paste them? Maybe your problems rely in your test.js code? |
I noticed that when running phantomjs with webdriver and a proxy from the command-line (
phantomjs-1.9.7 --proxy=proxyhost:3128 --webdriver=33828
for instance), then my phantom sessions do not mention any use of the proxy:[INFO - 2014-08-05T13:51:48.042Z] Session [a4f0d400-1ca7-11e4-8775-2d27219bffd9] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7", "driverName":"ghostdriver", "driverVersion":"1.1.0", "platform":"linux-unknown-64bit", "javascriptEnabled":true, "takesScreenshot":false, "handlesAlerts":false, "databaseEnabled":false, "locationContextEnabled":false, "applicationCacheEnabled":false, "browserConnectionEnabled":false, "cssSelectorsEnabled":true, "webStorageEnabled":false, "rotatable":false, "acceptSslCerts":false, "nativeEvents":true,
"proxy":{"proxyType":"direct"},
"phantomjs.page.settings.userAgent":"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20130330 Firefox/21.0","phantomjs.page.settings.javascriptCanOpenWindows":false,"phantomjs.page.settings.javascriptCanCloseWindows":false}
I assume this means the webdriver is already using the proxy, and then the phantom sessions through the webdriver do not need to use the proxy since it is already being used, but I just wanted to be sure and know whether I should rather:
The text was updated successfully, but these errors were encountered: