EzDevInfo.com

FunkLoad

Functional and load testing framework for web applications, written in Python FunkLoad documentation contents — FunkLoad 1.17.1 documentation

Funkload Magento checkout cookies

I'm attempting to test checkout for a Magento store. However, when I begin checking out I get a 403 error when attempting to POST to /checkout/onepage/save* pages. In my understanding, this is because nothing is showing in the cart due to cookies not being accepted. When attempting to POST to the /checkout/cart/add/ url, funkload loads a redirect link to /enable-cookies.

So, the question is: how can I make sure cookies are being used correctly/respected by funkload?


Source: (StackOverflow)

How to make FunkLoad use gnuplot on windows?

I want to use FunkLoad on Windows and I have installed it. I also installed the Windows version of gnuplot.

But when trying to make a report with FunkLoad it gives me :

RuntimeError: Failed to run wgnuplot cmd on C:\path\tests.gplot

What should I do in order for FunkLoad to detect that there is indeed an available gnuplot on the machine to use for the graphs? Thank you.


Source: (StackOverflow)

Advertisements

Funkload and cookies

I have trouble setting up funkload to work well with cookies. I turn on fl-record and perform a series of requests of which each is sending a cookie. If I use the command without supplying a folder path, the output is stored in TCPWatch-Proxy format and I can see the contents of all the cookies, so I know that they are sent.

For example this is the contents of watch0003.request:

GET http://mydomainnamehere.pl/api/world/me/ HTTP/1.1
Host: mydomainnamehere.pl
Proxy-Connection: keep-alive
Referer: http://mydomainnamehere.pl/test/engine/
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57 Safari/534.24
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: pl,en-US;q=0.8,en;q=0.6,fr-FR;q=0.4,fr;q=0.2
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: Beacon-ClientID=<<<some-beaconpush-id-here>>>; sessionid=<<<some-session-id>>>; fbs_<<<some-facebook-id>>>="access_token=<<<some-access-token>>>&expires=1308254400&secret=<<<some-secret>>>&session_key=<<<some-session-key>>>&sig=<<<some-signature>>>&uid=<<<some-user-id>>>"; Beacon-Preferred-Client=WebSocket

However if I run fl-record with a name of the test case and by doing so order funkload to store the output as a python test, all the Cookies are omitted. There isn't a single line in the code that would have anything to do with them:

import unittest
from funkload.FunkLoadTestCase import FunkLoadTestCase
from webunit.utility import Upload
from funkload.utils import Data
#from funkload.utils import xmlrpc_get_credential

class Simple(FunkLoadTestCase):

    def setUp(self):
        """Setting up test."""
        self.logd("setUp")
        self.server_url = self.conf_get('main', 'url')
        # XXX here you can setup the credential access like this
        # credential_host = self.conf_get('credential', 'host')
        # credential_port = self.conf_getInt('credential', 'port')
        # self.login, self.password = xmlrpc_get_credential(credential_host,
        #                                                   credential_port,
        # XXX replace with a valid group
        #                                                   'members')

    def test_simple(self):
        # The description should be set in the configuration file
        server_url = self.server_url
        # begin of test ---------------------------------------------

        ...

        # /tmp/tmp5Nv5lW_funkload/watch0003.request
        self.get(server_url + "/api/world/me/",
                 description="Get /api/world/me/")

        ...

        # end of test -----------------------------------------------

    def tearDown(self):
        """Setting up test."""
        self.logd("tearDown.\n")

if __name__ in ('main', '__main__'):
    unittest.main()

There is also a configuration file, but nothing about cookies there either.

On the other hand the documentation states that fl has (Cookie support). I've also found some bugfixes in the previous releases concerning Cookie support so I can assume this isn't just an empty statement. I've also found a point in one of the changelogs that states that "deleted cookies" are not included in the output. This got me wondering that maybe the problem is that the cookies as they were recorded are marked for deletion or are recognized as such by fl upon conversion from the TCP-Watch format to an actual testcase. This is just a wild guess however.

I'd like to know:

  • If you ever had successes with support of funkload for cookies. If so, which version were you using.
  • Of your general experiences with funkload and whether or not it is worth using in a more complex setup.

EDIT

Apparently some of the requests that are recorded by TCPWatch are totally ignored and not included in the output test case. Anybody has idea why would it do that? Does it have anything to do with redirection?

EDIT(2)

Ok, it does. This one thing actually makes sense. It leaves out the results of redirection as these will be generated by simply following HTTP 302 Found. However the question of cookies still remains unexplained.


Source: (StackOverflow)

FunkLoad one report for multiple requests

I am using FunkLoad to make some load test on my Django project. One of the page (I will name it /customer/ ) that I am currently try to benchmark "does" an AJAX request on page load to (/customer/json/)

What I am currently doing in my benchmark is the following

self.get("/customer/", description="Customer page")
self.get("/customer/json/", description="Customer list")

that it's then reported with two graphs

I would like to have a single graph where /customer/json/ is considered as a "page resource" (let's say style.css)

Is it somehow feasible / am I missing something ?

---EDIT---

Here's my dirty patch to force my tests to load a list of media (self.media) every time I do a get request, I know that there are at least 4 good reasons to not do this way but for the moment I can live with it :)

class MyLoadTest(FunkLoadTestCase):

    def get(self, url, params=None, description=None, ok_codes=None):
        response = FunkLoadTestCase.get(self, url, params, description, ok_codes)
        if not self._simple_fetch:
            for media in self.media:
                self._connect("%s%s" % (self.server_url, media), [], self.ok_codes, "GET", "")
        return response

Source: (StackOverflow)

How to configure FunkLoad monitor in two servers?

I have a small problem. How to configure monitor and run?!

Now ,I try use this configuration - but this is not work.

I have two servers: 1. Imitation server clients (178.216.200.170) 2. A server application (178.216.200.48)

They should look like files? - monitor.conf (should by in server 2 - 178.216.200.48) - TestingClassName.conf (should by in server 1 - 178.216.200.170)

I'm trying to: monitor.conf

[server]
host = 178.216.200.48
port = 8008
interval = .5
interface = eth0
[client]
host = 178.216.200.170
port = 8008

and TestingClassName.conf:

...
[monitor]
hosts=178.216.200.48
[178.216.200.48]
port=8008
description=My description

but it does not work?!


Source: (StackOverflow)

Testing posting to forms in FunkLoad

I am trying to test functionality of a web-application using FunkLoad.

The page under testing is just a login form - give email and pwd and if successful it redirects to a index page; if not successful it throws an error.

I have the below code:

self.get(server_url + "/login", description="Get /init/default/login")
params=[['email', 'xxxx@gmail.com'],
        ['password', 'xxxxx'],
        ['_formname','login'],
        ]
ret=self.post('%s/login' % server_url,
          params=params,
          description="Testing login functionality")

self.logd(self.getBody())

Whether it is a valid email id/pwd or a wrong one, the test throws a 200 as a return code and stays in the same login page.

How do I test posting in forms using FunkLoad?

(BTW, when I tested this web page with a mechanize script, I could login and then routed to the correct index page)

Thank you


Source: (StackOverflow)

Funkload Load Testing Implementation

I am very new to performance testing. I am using funkload pypi package to do that. I can run load tests with that. I want the following scenario to implement.

  1. Ability to specify ramp up rate (i.e. 5 users every 1 minute)
  2. Ability to specify ramp up time (i.e. ramp up all users within 20 mins)
  3. Ability to specify ramp down rate (i.e. stop 5 users every 30 seconds)
  4. Ability to specify ramp down time (i.e. stop all users within 1 min)
  5. Ability to specify how long to execute after users have been ramped up (i.e. after all users are ramped up,run performance test for 30 mins)
  6. Ability to specify how long each test case should be run (i.e. run login and log out test script 15 times)
  7. Ability to choose rendezvous point (i.e. wait for all users to login and then execute steps in the scripts)
  8. Ability to wait between steps (i.e. for a script that logs in, presses new account button, creates a new account and logs out; we should be able to randomly wait between 15 - 45 seconds between login and press the create new account button, randomly wait between 15s - 45s between pressing new account button and creating new account, and randomly wait between 15-45 seconds between creating new account and logging out).

Source: (StackOverflow)

Running funkload tests located in some folder

I have the following project structure:

funkload_configs
 - Simple.conf
a
 - __init__.py
 - module1.py
 - perf_tests
   - __init__.py
   - perf_test1.py

when I run fl-run-test -dv perf_tests/perf_test1.py from project root (the one containing funkload_configs and a folders) I get the following error:

ImportError: No module named perf_test1

Is it possible to run a funkload test located in another directory?

I've also set the FL_CONF_PATH environment variable to point to funkload_configs


Source: (StackOverflow)

Getting exception while executing FunkLoad .py script

I am quite new to Performance testing. Found out about funkload and giving it a try to do a performance testing for a web application. I have recorded some of the very basic search operation using fl-record and got a .py and .conf file.

While executing the test using fl-run-test -dV , i am getting the exception - Please see attached error screen shot

Funkload test execution error

Can anyone out here help me out? Thanks in advance


Source: (StackOverflow)

Does Funkload store cached data?

I want to make sure that I am not fetching the cached images while testing for performance results (so that it will not give me wrong interpretation).

class Simple(FunkLoadTestCase):

    def setUp(self):
        # fetch urls from a file ... ending up with something like
        urlList = ['myurl']
        self.urlList = urlList

    def test_simple(self):
        for url in self.urlList:
            self.get(url, description='Get url')

Now myurl is a static page and all the images when accessed second time around, will be browser cached.


Source: (StackOverflow)

Identifying failure reason in Funkload benchmark

Is there a way to get more details on how Funkload test failed during a benchmark?


Source: (StackOverflow)

Funkload API testing

So I want to use funkload to stress test an API. I have a set of urls in the test

The thing is the authentication is sent via querystring on every request (no cookies involved)

so /abc?auth=token1 would be one user and /abc?auth=token2 is another

I have code similar to this:

class Simple(FunkLoadTestCase):

    def setUp(self):
        # fetch urls from a file ... ending up with something like
        urlList = ['http://localhost/abc?auth=1', 'http://localhost/def?auth=1']
        self.urlList = urlList

    def test_simple(self):
        for url in self.urlList:
            self.get(url, description='Get url')

The problem is that the server relies heavily on memcached so running the same user concurrently x times only puts the server on proper load on the 1st request.

I am looking for a way for to identify what concurrent user I am running as so I can modify the authentication token per concurrent user.

Any ideas?


Source: (StackOverflow)

funkload benchmark test failure

I am testing my Python script with funkload.

I use this command :

fl-run-bench -c 1:2 test_RecuperationPhotos.py RecuperationPhotos.test_RecPhotos

I have this error :

Traceback (most recent call last):
  File "/usr/local/bin/fl-run-bench", line 8, in <module>
    load_entry_point('collective.funkload==0.3', 'console_scripts', 'fl-run-bench')()
  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 343, in load_entry_point
  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 2354, in load_entry_point
  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 2060, in load
  File "/Library/Python/2.7/site-packages/collective/funkload/bench.py", line 8, in <module>
    from zope.testing.testrunner import runner
ImportError: cannot import name runner

I cannot understand what the error means.


Source: (StackOverflow)

report doesnt containts monitor server info

I have problem with generating report. in benching is everything ok:

* Start monitoring 188.166.46.45: ... done.
...
* Stop monitoring 188.166.46.45:  done.

I run fl-monitor-ctl in debug mode and everything is 200,OK.

I found in generated bench.xml this:

<monitorconfig host="188.166.46.45" key="MonitorMemFree" value="(lp0\n(ifunkload.MonitorPlugins\nPlot\np1\n(dp2\nS'plots'\np3\n(dp4\nS'MEM'\np5\n(lp6\nS'lines lw 2'\np7\naS'Memory'\np8\nasS'SWAP'\np9\n(lp10\ng7\naS'Swap'\np11\nassS'ylabel'\np12\nS''\np13\nsS'unit'\np14\nS'kB'\np15\nsS'title'\np16\nS'Memory usage'\np17\nsba." />
<monitorconfig host="188.166.46.45" key="MonitorCPU" value="(lp0\n(ifunkload.MonitorPlugins\nPlot\np1\n(dp2\nS'plots'\np3\n(dp4\nS'LOAD1'\np5\n(lp6\nS'lines lw 2'\np7\naS'Load 1min'\np8\nasS'LOAD15'\np9\n(lp10\ng7\naS'Load 15min'\np11\nasS'LOAD5'\np12\n(lp13\ng7\naS'Load 5min'\np14\nasS'CPU'\np15\n(lp16\nS'impulse lw 2'\np17\naS'CPU 1=100%%'\np18\nassS'ylabel'\np19\nS'loadavg'\np20\nsS'unit'\np21\nS''\np22\nsS'title'\np23\nS'Load average'\np24\nsba." />
<monitorconfig host="188.166.46.45" key="MonitorNetwork" value="(lp0\n(ifunkload.MonitorPlugins\nPlot\np1\n(dp2\nS'plots'\np3\n(dp4\nS'NETOUT'\np5\n(lp6\nS'lines lw 2'\np7\naS'Out'\np8\nasS'NETIN'\np9\n(lp10\ng7\naS'In'\np11\nassS'ylabel'\np12\nS''\np13\nsS'unit'\np14\nS'kB'\np15\nsS'title'\np16\nS'Network traffic'\np17\nsba." />
<monitorconfig host="188.166.46.45" key="MonitorCUs" value="(lp0\n(ifunkload.MonitorPlugins\nPlot\np1\n(dp2\nS'plots'\np3\n(dp4\nS'CUs'\np5\n(lp6\nS'impulse'\np7\nag5\nassS'ylabel'\np8\ng5\nsS'unit'\np9\nS''\np10\nsS'title'\np11\nS'Concurent users'\np12\nsba." />

but after build-report there is no information about server monitoring.

Some solution?


Source: (StackOverflow)

FunkLoad monitor doesn't show any graphs in report

I did set up everything according to tutorial here http://funkload.nuxeo.org/monitoring.html , started monitor server, made bench test, builded report. But in report there are no added graphs from monitoring... Any idea? I am using credential server as well, but that was and is working correctly... its just that after i added monitor things, nothing seems to change...

monitor.conf

[server]
host = localhost
port = 8008
interval = .5
interface = eth0
[client]
host = localhost
port = 8008

my_test.conf:

[main]
title= some title
description= some descr
url=http://localhost:8000
... some other not important lines here

[monitor]
hosts=localhost

[localhost]
port=8008
description=The benching machine

Source: (StackOverflow)