ChromeDriver won't open websites

When testing Chrome through selenium webdriver, I am experiencing very strange behavior.

Instead of navigating through the pages, as you might expect, the "get" command only downloads tiny files (no files like or .apsx) from the target site. Important - this behavior only occurs when I pass chrome_options

as an argument to the Chrome driver.

The same test scripts work flawlessly with the firefox driver.

code:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options # tried with and without 

proxy = '127.0.0.1:9951'  # connects to a proxy application 
chrome_options = webdriver.ChromeOptions()    
chrome_options.add_argument('--proxy-server=%s' % proxy)
driver = webdriver.Chrome(chrome_options=chrome_options)

driver.get('whatismyip.com')

      

Causes an automatic download of a file named download (no file extension, size 2 bytes). When other sites are called, small aspx files are loaded. This happens when the browser page remains blank and no interaction occurs with the elements occurring = the site is not loaded at all.

No error message is displayed except element not found

.

This is really weird.

Additional information: I am running Debian Wheezy 32 bit and using Python 2.7.

Any suggestions on how to solve this problem?

+3


source to share


1 answer


I tried my code and captured traffic on localhost using SOCKS v5 proxy over SSH. It definitely sends data through a proxy, but no data is returned. I have verified that the proxy works with Firefox.

I am running Google Chrome on 64 bit Ubuntu 14.04 LTS. Chrome browser gives me the following message when I try to set up a proxy in the settings menu:

When running Google Chrome in a supported desktop environment, the system proxy settings will be used. However, your system is not supported or there is a problem starting your system configuration.

But you can still configure via the command line. Please see the google-chrome-stable man for more information on flags and environment variables.



Unfortunately I don't have a man page for google-chrome-stable.

I also found that according to the selenium documentation in Chrome the system proxy settings are used and according to their documentation it is not known how to programmatically set the proxy in Chrome: http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp# using-a-proxy

0


source







All Articles