[twill] twill with threads
barry.hart at predictix.com
Thu Dec 18 04:27:11 PST 2008
We've been using Twill recently to do volume testing of a web site. Each
simulated user is a separate CPython process running Twill. The processes
are lightweight enough that a single ordinary PC with 2GB of RAM can
easily simulate dozens of users.
From: twill-bounces at lists.idyll.org [mailto:twill-bounces at lists.idyll.org]
On Behalf Of C. Titus Brown
Sent: Thursday, December 18, 2008 12:04 AM
Cc: twill at lists.idyll.org
Subject: Re: [twill] twill with threads
On Tue, Dec 16, 2008 at 05:36:28PM -0200, Macarse wrote:
-> Hi, I am doing a script that:
-> - Gets a list of ips
-> - Sets a threadpool
-> - With twill it logins to the http
-> - with urlib2 gets some html
-> go(ip + '/login.asp')
-> fv('1', 'user', 'user')
-> fv('1', 'password', 'password')
-> req = urllib2.Request(ip + '/status.asp')
-> response = urllib2.urlopen(req)
-> statusPage = response.read()
You could do this with twill easily enough -- just do
browser = twill.commands.browser
statusPage = browser.get_html()
-> my question is: Is ok to use twill like that?
-> Is it thread safe?
...however, unfortunately, the commands interface in twill is not thread
safe, and mechanize (which twill uses to actually do anything :) may
also not be threadsafe.
C. Titus Brown, ctb at msu.edu
twill mailing list
twill at lists.idyll.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the twill