facebookarchive / huxley

A testing system for catching visual regressions in Web applications.
Apache License 2.0
4.07k stars 286 forks source link

How Could I use huxley with proxy? #40

Closed hugoxie closed 10 years ago

hugoxie commented 10 years ago

I want to use huxley to test my website, but my company have set the firewall, so I must set a proxy to open my website by urlopen. How can I do?

petehunt commented 10 years ago

Try setting the http_proxy environment variable before running. Does that work?

hugoxie commented 10 years ago

@petehunt Thank you! I'll try it today. I wonder that is huxley provide some option to set proxy. if it doesn't. I'll try another way.

petehunt commented 10 years ago

Did this end up working?

hugoxie commented 10 years ago

@petehunt set http_proxy is work, it didn't report urlopen error anymore, but I got another problem, it said: 'UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in position 193: invalid start byte', what's the matter

petehunt commented 10 years ago

Can you paste the full trace back?

hugoxie commented 10 years ago

@petehunt

Exception in thread Thread-1: Traceback (most recent call last): File "E:\Python27\lib\threading.py", line 810, in bootstrap_inner self.run() File "E:\Python27\lib\threading.py", line 763, in run self.target(_self.__args, *_self.kwargs) File "build\bdist.win-amd64\egg\huxley\threadpool.py", line 32, in thread func(_args, *_kwargs) File "build\bdist.win-amd64\egg\huxley\cmdline.py", line 69, in run_test screensize=screensize File "build\bdist.win-amd64\egg\huxley\main.py", line 83, in main d = webdriver.Remote(remote, CAPABILITIES[browser]) File "E:\Python27\lib\site-packages\selenium-2.35.0-py2.7.egg\selenium\webdriv er\remote\webdriver.py", line 72, in __init self.start_session(desired_capabilities, browser_profile) File "E:\Python27\lib\site-packages\selenium-2.35.0-py2.7.egg\selenium\webdriv er\remote\webdriver.py", line 114, in start_session 'desiredCapabilities': desired_capabilities, File "E:\Python27\lib\site-packages\selenium-2.35.0-py2.7.egg\selenium\webdriv er\remote\webdriver.py", line 163, in execute response = self.command_executor.execute(driver_command, params) File "E:\Python27\lib\site-packages\selenium-2.35.0-py2.7.egg\selenium\webdriv er\remote\remote_connection.py", line 353, in execute return self._request(url, method=command_info[0], data=data) File "E:\Python27\lib\site-packages\selenium-2.35.0-py2.7.egg\selenium\webdriv er\remote\remote_connection.py", line 404, in _request body = response.read().decode('utf-8').replace('\x00', '').strip() File "E:\Python27\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in position 193: invalid start byte

hugoxie commented 10 years ago

@petehunt I've print the response.read(), but it seems that open website error, the information show that Connection refused. I try set http_proxy and use urllib2.urlopen to open the same website in python cmd mode, the response is the ok. I feel puzzled.