[Webtest] RE: 403 errors

Dierk Koenig webtest@lists.canoo.com
Fri, 7 Jan 2005 10:34:40 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_000F_01C4F4A4.7E7642F0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

RE: 403 errorsHi Marco,

http 403 is "forbidden" so you are trying to access a protected resouce.
The error can have a endless variety of reasons. :-(
A typical one is file permissions on the server.
But it can also be much more elaborate such that the server
expects some kind of information the the http header like
cookies, user-agents, encodings, etc. and throws 403
if not found.
Maybe this behavious is known to the ASPX user
community.

cheers
Mittie

  -----Original Message-----
  From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]On Behalf Of Marco Neri
  Sent: Freitag, 7. Januar 2005 1:44
  To: 'webtest@gate2.canoo.com'
  Subject: [Webtest] RE: 403 errors


  Hi

  this is probably not a webtest issue im posting on the offchance someone
has observed similar problem.

  I'm running a test suite back to back using httpunit based webtest vs
htmlunit based webtest.

  Using httpunit based webtest the tests pass. Using htmlunit based webtest
I see mystery 403 errors when I'm trying to invoke  a url. e.g

  [testSpec] (steps.Step                          273 ) Start Step: null
"[implict setup step]" (1/37)
   [testSpec] (steps.Setup                         66  ) Using browser
version (Microsoft Internet Explorer, 4.0 (compatible; MSIE 6.0b; Windows
98), 4.0 (compatible; MSIE 6.0; Windows 98), 1.2). If the javascript support
is not as expected, then it's time to go into the sources

   [testSpec] (steps.Setup                         134 ) Configuring http
headers (1 elts)
   [testSpec] (steps.Setup                         139 ) Skipped User-Agent
header as it has already been configured in the BrowserVersion

   [testSpec] (steps.Step                          273 ) Start Step: invoke
"login screen" (2/37)
   [testSpec] (request.Target                      157 ) -> gotoTarget(by
url): http://localhost/app/ui/WelcomeForm.aspx
   [testSpec] Jan 7, 2005 11:01:04 AM
com.gargoylesoftware.htmlunit.WebClient getPage
   [testSpec] INFO: statusCode=[403] contentType=[text/html]

  If I check the iis log i see cookie settings & sessionId  not being set
when trying to invoke the url ( welcomeform )

  00:00:53  GET /app/js/browserDetect.js - 200 localhost
$Version=0;+ASP.NET_SessionId=1c44o0nxyhs0exe33obxbiuy;+$Path=/,$Version=0;+
A=11ad466b74824a6683b56f2531eb466b;+$Path=/ -

  00:01:04 GET /app/ui/WelcomeForm.aspx - 403 localhost - -

  Most tests invoke that same url as entry point for the test so I'm at a
loss as to why sometimes it works and sometimes it has 403 error.

  The tests do not fail consistently. Sometimes a test that failed will pass
on a subsequent run. I also observe slightly different pass/fails if I
change the user agent header in config.xml to be that for firefox ( that is
mozilla 1.0 ) instead of I.E although  I doubt this had anything to do with
it.

  Has anyone had a similar problem? Is this probably an issue with
com.gargoylesoftware.htmlunit.WebClient getPage ? (I'm using the html unit
bundled with webtest how recent is that ? )

  Marco



------=_NextPart_000_000F_01C4F4A4.7E7642F0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>RE: 403 errors</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2523" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =
size=3D2>Hi=20
Marco,</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =
size=3D2>http=20
403 is "forbidden" so you are trying to access a protected=20
resouce.</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =
size=3D2>The=20
error can have a endless variety of reasons. :-(</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =
size=3D2>A=20
typical one is file permissions on the server.</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =
size=3D2>But it=20
can also be much more elaborate such that the server</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =

size=3D2>expects some kind of information the the http header=20
like</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =

size=3D2>cookies, user-agents, encodings, etc. and throws =
403</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =
size=3D2>if not=20
found.</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =
size=3D2>Maybe=20
this behavious is known to the ASPX user</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =

size=3D2>community.</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =

size=3D2>cheers</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =

size=3D2>Mittie</FONT></SPAN></DIV>
<DIV><SPAN class=3D812402309-07012005><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B>=20
  webtest-admin@lists.canoo.com =
[mailto:webtest-admin@lists.canoo.com]<B>On=20
  Behalf Of </B>Marco Neri<BR><B>Sent:</B> Freitag, 7. Januar 2005=20
  1:44<BR><B>To:</B> 'webtest@gate2.canoo.com'<BR><B>Subject:</B> =
[Webtest] RE:=20
  403 errors<BR><BR></FONT></DIV>
  <P><FONT size=3D2>Hi</FONT> </P>
  <P><FONT size=3D2>this is probably not a webtest issue im posting on =
the=20
  offchance someone has observed similar problem.</FONT> </P>
  <P><FONT size=3D2>I'm running a test suite back to back using httpunit =
based=20
  webtest vs htmlunit based webtest.</FONT> </P>
  <P><FONT size=3D2>Using httpunit based webtest the tests pass. Using =
htmlunit=20
  based webtest I see mystery 403 errors when I'm trying to invoke&nbsp; =
a url.=20
  e.g</FONT></P>
  <P><FONT size=3D2>[testSpec]=20
  =
(steps.Step&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;=20
  273 ) Start Step: null "[implict setup step]" (1/37)</FONT> <BR><FONT=20
  size=3D2>&nbsp;[testSpec]=20
  =
(steps.Setup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;=20
  66&nbsp; ) Using browser version (Microsoft Internet Explorer, 4.0=20
  (compatible; MSIE 6.0b; Windows 98), 4.0 (compatible; MSIE 6.0; =
Windows 98),=20
  1.2). If the javascript support is not as expected, then it's time to =
go into=20
  the sources</FONT></P>
  <P><FONT size=3D2>&nbsp;[testSpec]=20
  =
(steps.Setup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;=20
  134 ) Configuring http headers (1 elts)</FONT> <BR><FONT=20
  size=3D2>&nbsp;[testSpec]=20
  =
(steps.Setup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;=20
  139 ) Skipped User-Agent header as it has already been configured in =
the=20
  BrowserVersion</FONT></P>
  <P><FONT size=3D2>&nbsp;[testSpec]=20
  =
(steps.Step&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;=20
  273 ) Start Step: invoke "login screen" (2/37)</FONT> <BR><FONT=20
  size=3D2>&nbsp;[testSpec]=20
  =
(request.Target&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  157 ) -&gt; gotoTarget(by url): <A=20
  href=3D"http://localhost/app/ui/WelcomeForm.aspx"=20
  target=3D_blank>http://localhost/app/ui/WelcomeForm.aspx</A></FONT> =
<BR><FONT=20
  size=3D2>&nbsp;[testSpec] Jan 7, 2005 11:01:04 AM=20
  com.gargoylesoftware.htmlunit.WebClient getPage</FONT> <BR><FONT=20
  size=3D2>&nbsp;[testSpec] INFO: statusCode=3D[403] =
contentType=3D[text/html]</FONT>=20
  </P>
  <P><FONT size=3D2>If I check the iis log i see cookie settings &amp;=20
  sessionId&nbsp; not being set when trying to invoke the url ( =
welcomeform=20
  )</FONT> </P>
  <P><FONT size=3D2>00:00:53&nbsp; GET /app/js/browserDetect.js - 200 =
localhost=20
  =
$Version=3D0;+ASP.NET_SessionId=3D1c44o0nxyhs0exe33obxbiuy;+$Path=3D/,$Ve=
rsion=3D0;+A=3D11ad466b74824a6683b56f2531eb466b;+$Path=3D/=20
  -</FONT></P>
  <P><FONT size=3D2>00:01:04 GET /app/ui/WelcomeForm.aspx - 403 =
localhost -=20
  -</FONT> </P>
  <P><FONT size=3D2>Most tests invoke that same url as entry point for =
the test so=20
  I'm at a loss as to why sometimes it works and sometimes it has 403 =
error.=20
  </FONT></P>
  <P><FONT size=3D2>The tests do not fail consistently. Sometimes a test =
that=20
  failed will pass on a subsequent run. I also observe slightly =
different=20
  pass/fails if I change the user agent header in config.xml to be that =
for=20
  firefox ( that is mozilla 1.0 ) instead of I.E although&nbsp; I doubt =
this had=20
  anything to do with it.</FONT></P>
  <P><FONT size=3D2>Has anyone had a similar problem? Is this probably =
an issue=20
  with com.gargoylesoftware.htmlunit.WebClient getPage ? (I'm using the =
html=20
  unit bundled with webtest how recent is that ? )</FONT></P>
  <P><FONT size=3D2>Marco</FONT> </P><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000F_01C4F4A4.7E7642F0--