Take the 2-minute tour ×

i am doing a sample run on a webserver using multi-mechanize and urllib2

#!/usr/bin/env python

import urllib2
import time
import random

class Transaction(object):
    def __init__(self):

    def run(self):
        start_timer = time.time()
        resp = urllib2.urlopen('')
        content = resp.read()
        latency = time.time() - start_timer

        self.custom_timers['Example_Homepage'] = latency
        assert (resp.code == 200), 'Bad Response: HTTP %s' % resp.code
        assert ('Example Web Page' in content), 'Text Assertion Failed'

if __name__ == '__main__':
    trans = Transaction()
    print trans.custom_timers

after running the project, i can see errors for each transanctions, but not sure what the errors are as I can see the webserver responding to the requests correctly, can anyone advise?

[root@dev1-proxy3 scripts]# multimech-run k1_testrun

  user_groups:  2
  threads: 6

[================100%==================]  30s/30s   transactions: 23879  timers: 23879  errors: 23879

analyzing results...

transactions: 23888
errors: 23888

test start: 2013-01-26 12:59:23
test finish: 2013-01-26 12:59:53

created: ./k1_testrun/results/results_2013.01.26_12.59.23/results.html

share|improve this question
you may need to initialize self.custom_timers to {} –  sureshvv Jan 26 '13 at 18:57
did that but it still gives error –  krisdigitx Jan 26 '13 at 20:03
first run it directly without multi-mech –  sureshvv Jan 29 '13 at 4:15
Are you sure that the webpage @ contains the exact text "Example Web Page"? Also turning console logging = on in the config.cfg might produce interesting results. What does the results csv file show? –  brma Mar 21 '13 at 11:53

Your Answer



Browse other questions tagged or ask your own question.