[ptt-users] Problem with HTTPProtocol.connect(1)
Frank Cohen
fcohen at pushtotest.com
Wed Nov 22 13:00:53 PST 2006
My wife is recovering from throat surgery so I'm home bound the next
few days. I may get some time to work on the redirect problem. I'll
let you know. Thanks. -Frank
On Nov 21, 2006, at 3:04 PM, Aaron Romeo wrote:
> Thanks Geoff, I have something similar on… However the site I’m
> testing occasionally waits for external events (like credit card
> approvals) before redirecting. So I was hoping that TestMaker’s
> redirects would handle some of this.
>
>
>
> Thanks,
>
> Aaron.
>
>
>
> From: users-bounces at lists.pushtotest.com [mailto:users-
> bounces at lists.pushtotest.com] On Behalf Of Geoff Meakin
> Sent: Tuesday, November 21, 2006 5:25 PM
> To: TestMaker users list; TestMaker users list
> Subject: RE: [ptt-users] Problem with HTTPProtocol.connect(1)
>
>
>
> I wrote a routine to handle some of our redirect problems. It may
> or may not be of use to you... (see the base url checking in the
> refreshcheck section)
>
>
> def getPage( self, url, params=None ):
> self.log(1,"Get "+url+" with params="+str(params))
> while url!='':
> #print str(url)
> if params==None:
> resp=self.get(url)
> else:
> resp=self.get(url, params)
> locationcheck=str(resp.getParameterValue('Location'))
> if locationcheck==None or locationcheck=='None':
>
> # Check for <META HTTP-EQUIV=Refresh CONTENT="0;
> URL=home.do">
>
> #self.log(1," urlcheck> "+str(resp))
> refreshcheck=re.match('.*<META\ +HTTP-EQUIV=Refresh\
> +CONTENT=.*URL=([^\"\']*)',str(resp),re.IGNORECASE)
> if refreshcheck==None:
> url=''
> else:
> #self.log(1," refreshcheck> "+str
> (refreshcheck.group(0)))
> try:
> nurl=refreshcheck.group(1)
> nurl=nurl.lstrip().rstrip()
> except:
> nurl=''
> #self.log(1," ===> "+nurl)
> if re.match('^https?://',nurl,re.IGNORECASE):
> url=nurl
> else:
> if string.find(nurl,'/')==0:
> url=re.sub('^([^\.]*\.[^\/]*)\/.*','\
> \1',url)+nurl
> else:
> url=re.sub('/[^/]*$','/',url)+nurl
> self.log(2," ---> "+url)
>
> else:
> url=locationcheck
> self.log(1," ---> "+locationcheck)
> return resp
>
>
> Cheers
> -Geoff
>
>
> -----Original Message-----
> From: users-bounces at lists.pushtotest.com on behalf of Aaron Romeo
> Sent: Tue 21/11/2006 20:02
> To: TestMaker users list
> Subject: RE: [ptt-users] Problem with HTTPProtocol.connect(1)
>
> OK Frank...
>
> Any idea how people have resolved this in the past? Will I be
> forced to
> have to handle the redirects manually?
>
> Thanks,
> Aaron.
>
> -----Original Message-----
> From: users-bounces at lists.pushtotest.com
> [mailto:users-bounces at lists.pushtotest.com] On Behalf Of Frank Cohen
> Sent: Tuesday, November 21, 2006 3:00 PM
> To: TestMaker users list
> Subject: Re: [ptt-users] Problem with HTTPProtocol.connect(1)
>
> Hi Aaron: I've taken a look at this in the past and found that the
> browsers handle redirects differently.
>
>
>
> On Nov 21, 2006, at 8:11 AM, Aaron Romeo wrote:
>
> > Hello,
> >
> > I have a problem with the HTTPProtocol.connect(1) function.
> >
> > The website I am testing uses a path to redirect. For example, if
> > the base
> > URL is www.myurl.com, the first page might be www.myurl.com/
> > default.html.
> > On this page, I have another link that links me to second.html.
> > The browser
> > can identify that I am referring to www.myurl.com/second.html.
> > However
> > TestMaker doesn't contain my base and host URL anymore. It has
> > also lost
> > the protocol.
> >
> > Can someone tell me how I can get around this? I would really like
> > to have
> > TestMaker handle my redirects for me.
> >
> > Thanks,
> > --
> > Aaron Romeo
> > _______________________________________________
> > Users mailing list
> > Users at lists.pushtotest.com
> > http://lists.pushtotest.com/mailman/listinfo/users
> >
>
> _______________________________________________
> Users mailing list
> Users at lists.pushtotest.com
> http://lists.pushtotest.com/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at lists.pushtotest.com
> http://lists.pushtotest.com/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> Users at lists.pushtotest.com
> http://lists.pushtotest.com/mailman/listinfo/users
More information about the Users
mailing list