472,958 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Testing a website with HTTPS login and cookies

Hi everyone,

I want to create a test that will do a proper login test to a web site
but I need some pointers.

I need to login to the website by accessing an https url and posting to
that, which should return a very small 302 reply with the address of the
internal page. I need to take that page href and then access it, if I
can do all that then the test passes. Of course because I have to access
two urls I also need cookies for session handling. I've already tried
bash which would have worked but for the cookie handling and webinject
which is written in Perl, but this doesn't do exactly what I want in
terms of output so I'd rather write something myself. (I'm also curious
as to the best way to do this)

If anybody knows how to do this could they please give me a quick
pointer and tell me what libraries I need to go read up on?
Thanks

Hari
Sep 5 '06 #1
3 2650

Hari Sekhon wrote:
If anybody knows how to do this could they please give me a quick
pointer and tell me what libraries I need to go read up on?
One word. Selenium.

-Sandra

Sep 5 '06 #2
"Sandra-24" <sa***********@yahoo.comwrites:
Hari Sekhon wrote:
If anybody knows how to do this could they please give me a quick
pointer and tell me what libraries I need to go read up on?

One word. Selenium.
Didn't sound like a good fit for Selenium to me. Selenium's great,
but if you want to test HTTP response codes, just test HTTP response
codes -- no need to drag your browser into it :-)
John
Sep 7 '06 #3
Hari Sekhon <hp******@googlemail.comwrites:
I want to create a test that will do a proper login test to a web site
but I need some pointers.

I need to login to the website by accessing an https url and posting
to that, which should return a very small 302 reply with the address
of the internal page. I need to take that page href and then access
it, if I can do all that then the test passes. Of course because I
have to access two urls I also need cookies for session handling. I've
already tried bash which would have worked but for the cookie handling
and webinject which is written in Perl, but this doesn't do exactly
what I want in terms of output so I'd rather write something
myself. (I'm also curious as to the best way to do this)

If anybody knows how to do this could they please give me a quick
pointer and tell me what libraries I need to go read up on?
You could just use httplib, or urllib2 (using
urllib2.HTTPCookieProcessor) if you need to handle cookies. However,
personally I prefer using a higher-level tool that knows a bit more
about web-browser behaviour, e.g.:

http://www.idyll.org/~t/www-tools/twill.html
http://cheeseshop.python.org/pypi?%3...opeTestbrowser
both of which are based on:

http://wwwsearch.sourceforge.net/mechanize/
(BTW, I hear there's work going on on an implementation of
zope.testbrowser that delegates to Selenium instead of to mechanize --
cool.)
John
Sep 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Bozo Schmozo | last post by:
Greetings! I've searched groups.google.com already to see if I can determine if using PHP/MySQL (if needed) for a web site I wish to develop. As the subject indicated, it will be a content...
2
by: Robb Shecter | last post by:
Anybody know about a Python library for testing websites? I'm thinking of something like a scriptable browser, where you could tell it to browse to a certain URL, check for the existence of...
0
by: Antwerp | last post by:
Hi, I'm trying to create a perl script that will log into a website (the login form uses POST), navigate to several pages, and append the (html) content parsed from those pages to a seperate log...
2
by: Gill Bates | last post by:
I'm trying to login to a banking site (https://www.providentconnection.com) using vb.net. I've tried many variations of WebClient and HttpWebRequest; none of which I've got to work. My latest...
2
by: Mark Delon | last post by:
Hi, i want to log via python script to https page: 'https://brokerjet.ecetra.com/at/' # But it does not work. I am using following code(see below)
6
by: Alan | last post by:
Hi All, I am trying to make a few calls in succession to a website to allow me to login and then perform a search, in a c# windows program. wcResponse =...
1
by: dmbkiwi | last post by:
I've been using urllib2 to try and automate logging into the google adsense page. I want to download the csv report files, so that I can do some analysis of them. However, I don't really know...
13
by: Peter Chant | last post by:
I'm considering setting a website up for a club. I do not plan the contents to be for public consumption, but on the other hand I'm not going to have anything on there that is confidential, that...
0
by: barrybevel | last post by:
Hi, I'm trying to login to the www.vodafone.ie website using HttpWebRequest. It works fine with IE/Firefox and the .NET Web Control too, just not with my code. I think it's a redirect 302...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.