nuxeo / FunkLoad

Functional and load testing framework for web applications, written in Python
http://funkload.nuxeo.org/
GNU General Public License v2.0
382 stars 83 forks source link

Value error for cookie expiration when I test a website #160

Open alirezastack opened 7 years ago

alirezastack commented 7 years ago

I have installed funkload on OS X by using the command below:

brew install funkload

I use the demo version of funkload itself to run a test, so what only do is to just change the URL in main section in conf to my own website. After running the test to get main URL I get the below error:

$ fl-run-test test_Simple.py
test_simple: Starting -----------------------------------
    Access the main URL 20 times
test_simple: GET: http://www.faxdev.plus//login/
    Page 1:  ...
test_simple:  Done in 0.006s
test_simple:  Load css and images...
E
ERROR: test_simple (test_Simple.Simple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/funkload-1.17.1-py2.7.egg/funkload/FunkLoadTestCase.py", line 1010, in __call__
    self.setUp()
  File "/Users/a.hosseini/funkload-demo/faxplus/test_Simple.py", line 17, in setUp
    self.get(self.server_url + "/login/")
  File "/Library/Python/2.7/site-packages/funkload-1.17.1-py2.7.egg/funkload/FunkLoadTestCase.py", line 434, in get
    follow_redirect=follow_redirect)
  File "/Library/Python/2.7/site-packages/funkload-1.17.1-py2.7.egg/funkload/FunkLoadTestCase.py", line 367, in _browse
    self._browser.pageImages(url, page, self)
  File "/Library/Python/2.7/site-packages/funkload-1.17.1-py2.7.egg/funkload/PatchWebunit.py", line 243, in WTC_pageImages
    sucker.feed(page)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sgmllib.py", line 104, in feed
    self.goahead(0)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sgmllib.py", line 138, in goahead
    k = self.parse_starttag(i)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sgmllib.py", line 296, in parse_starttag
    self.finish_starttag(tag, attrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sgmllib.py", line 341, in finish_starttag
    self.handle_starttag(tag, method, attrs)
  File "/Library/Python/2.7/site-packages/webunit-1.3.10-py2.7.egg/webunit/IMGSucker.py",
line 46, in handle_starttag
    method(attributes)
  File "/Library/Python/2.7/site-packages/funkload-1.17.1-py2.7.egg/funkload/PatchWebunit.py", line 152, in do_link
    self.session.css[url] = self.session.fetch(url)
  File "/Library/Python/2.7/site-packages/funkload-1.17.1-py2.7.egg/funkload/PatchWebunit.py", line 502, in WF_fetch
    decodeCookies(url, server, headers, self.cookies)
  File "/Library/Python/2.7/site-packages/funkload-1.17.1-py2.7.egg/funkload/PatchWebunit.py", line 226, in decodeCookies
    expire = datetime.datetime.strptime(cookie['expires'],"%a, %d-%b-%Y %H:%M:%S %Z")
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data 'Sun, 08-Apr-18 05:20:34 GMT' does not match format '%a, %d-%b-%Y %H:%M:%S %Z'

----------------------------------------------------------------------
Ran 1 test in 0.760s

FAILED (errors=1)

Cookie expiration date is set by angularJS, so this is not a format we have chosen. It would be better to check for both date formats (with 2 digits year and with 4 digits).

I think this is a bug in funkload as I have no intervention in between. What should I do now for my test?

ed303 commented 7 years ago

hi, i do have the same issue with last version on Kali linux