[twill] Help Please - How to use Twill to access Secure Website with Apache login window
Pham, Hien
Hien.Pham at tekelec.com
Thu Aug 17 11:28:00 PDT 2006
Hello Everyone,
I am a new to Twill. I have been using Python to automate most of my
testing tasks in the last 4-5 years. My current project is to develop a
tool to login to a local secure website, which use apache to
authenticate accessing user. I Google the web and fumble on this
"Testing Web Apps Effectively with Twill". After reading the article
and others related posts, I believe this is the perfect tool for my
project. I just want to login to the website, navigate to some selected
links, fill and submit some forms and retrieve the response for my
posts.
I have written a simple script to login a secure website which use a
"Login" form and it work perfectly. Until I try to go to the website
that uses Apache for the authentication step - just popup window and no
form to fill. I can use URLILB2 to loggin, but I have not been figure
out how to gain access to this website using the Twill for its wonderful
built in feature.
Below is the code I use to login using URLLIB2:
handler = urllib2.HTTPBasicAuthHandler()
handler.add_password(self.realm, domain, userId, password)
opener = urllib2.build_opener(handler)
urllib2.install_opener(opener)
httpPage = urllib2.urlopen(url)
Any idea / suggestion would be greatly appreciated.
Thank you very much in advance for your help,
H. Pham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/twill/attachments/20060817/9cb0f9ff/attachment.htm
More information about the twill
mailing list