[Webtest] How-To ignore VBScript code using WebTest

Alan Guedeney Alan Guedeney <aguedeney@hotmail.com>
Wed, 13 Aug 2008 19:04:26 -0500


--_2706270a-77ca-401a-9ed3-f342e0744626_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


=20

This is the simple login test case script:

<webtest name=3D"Valid - Login to PFW's website">      <config basepath=3D"=
">            <header name=3D"User-Agent" value=3D"Mozilla/4.0 (compatible=
=3B MSIE 7.0=3B Windows NT 5.1=3B .NET CLR 1.1.4322=3B .NET CLR 2.0.50727=
=3B InfoPath.1)"/>                  </config>              &Login=3B       =
           <setInputField name=3D"username" value=3D"joe" />      <setInput=
Field name=3D"password" value=3D"welcome" />      <clickButton label=3D"Sub=
mit" /></webtest>
Upon execution I get an WARN: "Script is not JavaScript (type: =2C language=
: VBScript). Skipping execution" that seems to indicate I have VBScript cod=
e.  The page uses VBScript code to load an acrobat plugin. One day we'll ma=
ke this javascript code=2C but at the moment I need it to **ignore VBScript=
**.=20

[steps]   INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: steps "Imp=
licit <steps> task" (1/5)
[invoke]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: invoke "Lo=
gin page" (1/5)
[invoke]  INFO (com.canoo.webtest.steps.request.TargetHelper) - getting res=
ponse for url: https://mywebsite.com
[invoke]  WARN (com.gargoylesoftware.htmlunit.html.HtmlScript) - Script is =
not JavaScript (type: =2C language: VBScript). Skipping execution.
INFO (com.canoo.webtest.engine.WebClientContext) - Responses restored


The test fails with this error:
JavaScript error loading page
https://mywebsite.com/login?login:username=3D:
ReferenceError: "VBgetAcrobat" is not defined.
(https://mywebsite.com/login.js#108)

Is there anyway around this?  I looked at the documentation and could not f=
ind any flags or other information to ignore embedded VBScript.

Thanks!=20



--_2706270a-77ca-401a-9ed3-f342e0744626_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style>
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt=3B
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class=3D'hmmessage'>
 <style>.ExternalClass .EC_hmmessage P
{padding:0px=3B}
.ExternalClass body.EC_hmmessage
{font-size:10pt=3Bfont-family:Tahoma=3B}
</style>

<div style=3D"text-align: left=3B"><span style=3D"font-family: Courier New=
=2CCourier=2CMonospace=3B">This is the simple login test case script</span>=
:<br><br><span style=3D"font-family: Courier New=2CCourier=2CMonospace=3B">=
&lt=3Bwebtest name=3D"Valid - Login to PFW's website"&gt=3B</span><br style=
=3D"font-family: Courier New=2CCourier=2CMonospace=3B"><span style=3D"font-=
family: Courier New=2CCourier=2CMonospace=3B">&nbsp=3B &nbsp=3B&nbsp=3B&nbs=
p=3B &lt=3Bconfig basepath=3D""&gt=3B</span><br style=3D"font-family: Couri=
er New=2CCourier=2CMonospace=3B"><span style=3D"font-family: Courier New=2C=
Courier=2CMonospace=3B">&nbsp=3B&nbsp=3B&nbsp=3B &nbsp=3B&nbsp=3B&nbsp=3B &=
nbsp=3B&nbsp=3B&nbsp=3B &lt=3Bheader name=3D"User-Agent" value=3D"Mozilla/4=
.0 (compatible=3B MSIE 7.0=3B Windows NT 5.1=3B .NET CLR 1.1.4322=3B .NET C=
LR 2.0.50727=3B InfoPath.1)"/&gt=3B&nbsp=3B&nbsp=3B&nbsp=3B &nbsp=3B&nbsp=
=3B&nbsp=3B &nbsp=3B&nbsp=3B&nbsp=3B </span><br style=3D"font-family: Couri=
er New=2CCourier=2CMonospace=3B"><span style=3D"font-family: Courier New=2C=
Courier=2CMonospace=3B">&nbsp=3B &nbsp=3B&nbsp=3B&nbsp=3B &lt=3B/config&gt=
=3B&nbsp=3B&nbsp=3B&nbsp=3B &nbsp=3B&nbsp=3B&nbsp=3B </span><br style=3D"fo=
nt-family: Courier New=2CCourier=2CMonospace=3B"><span style=3D"font-family=
: Courier New=2CCourier=2CMonospace=3B">&nbsp=3B&nbsp=3B &nbsp=3B&nbsp=3B &=
amp=3BLogin=3B&nbsp=3B&nbsp=3B&nbsp=3B &nbsp=3B&nbsp=3B&nbsp=3B &nbsp=3B&nb=
sp=3B&nbsp=3B </span><br style=3D"font-family: Courier New=2CCourier=2CMono=
space=3B"><span style=3D"font-family: Courier New=2CCourier=2CMonospace=3B"=
>&nbsp=3B&nbsp=3B &nbsp=3B&nbsp=3B &lt=3BsetInputField name=3D"username" va=
lue=3D"joe" /&gt=3B</span><br style=3D"font-family: Courier New=2CCourier=
=2CMonospace=3B"><span style=3D"font-family: Courier New=2CCourier=2CMonosp=
ace=3B">&nbsp=3B&nbsp=3B &nbsp=3B&nbsp=3B &lt=3BsetInputField name=3D"passw=
ord" value=3D"welcome" /&gt=3B</span><br style=3D"font-family: Courier New=
=2CCourier=2CMonospace=3B"><span style=3D"font-family: Courier New=2CCourie=
r=2CMonospace=3B">&nbsp=3B&nbsp=3B &nbsp=3B&nbsp=3B &lt=3BclickButton label=
=3D"Submit" /&gt=3B</span><br style=3D"font-family: Courier New=2CCourier=
=2CMonospace=3B"><span style=3D"font-family: Courier New=2CCourier=2CMonosp=
ace=3B">&lt=3B/webtest&gt=3B</span><br style=3D"font-family: Courier New=2C=
Courier=2CMonospace=3B"><br><span style=3D"font-family: Courier New=2CCouri=
er=2CMonospace=3B">Upon execution I get an WARN: "</span><span style=3D"fon=
t-family: Courier New=2CCourier=2CMonospace=3B"><span style=3D"color: rgb(2=
55=2C 0=2C 0)=3B font-weight: bold=3B">Script is not JavaScript (type: =2C =
language: VBScript). Skipping execution</span></span><span style=3D"font-fa=
mily: Courier New=2CCourier=2CMonospace=3B">" that seems to indicate I have=
 VBScript code.&nbsp=3B The page uses VBScript code to load an acrobat plug=
in. One day we'll make this javascript code=2C but at the moment I need it =
to **ignore VBScript**. <br><br></span><span style=3D"font-family: Courier =
New=2CCourier=2CMonospace=3B">[steps]&nbsp=3B&nbsp=3B INFO (com.canoo.webte=
st.steps.Step) - &gt=3B&gt=3B&gt=3B&gt=3B Start Step: steps "Implicit &lt=
=3Bsteps&gt=3B task" (1/5)</span><br style=3D"font-family: Courier New=2CCo=
urier=2CMonospace=3B">
<span style=3D"font-family: Courier New=2CCourier=2CMonospace=3B">[invoke]&=
nbsp=3B INFO (com.canoo.webtest.steps.Step) - &gt=3B&gt=3B&gt=3B&gt=3B Star=
t Step: invoke "Login page" (1/5)</span><br style=3D"font-family: Courier N=
ew=2CCourier=2CMonospace=3B">
<span style=3D"font-family: Courier New=2CCourier=2CMonospace=3B">[invoke]&=
nbsp=3B INFO (com.canoo.webtest.steps.request.TargetHelper) - getting respo=
nse for url: https://mywebsite.com</span><br style=3D"font-family: Courier =
New=2CCourier=2CMonospace=3B">
<span style=3D"font-family: Courier New=2CCourier=2CMonospace=3B">[invoke]&=
nbsp=3B WARN (com.gargoylesoftware.htmlunit.html.HtmlScript) - <span style=
=3D"color: rgb(255=2C 0=2C 0)=3B font-weight: bold=3B">Script is not JavaSc=
ript (type: =2C language: VBScript). Skipping execution.</span></span><br s=
tyle=3D"font-family: Courier New=2CCourier=2CMonospace=3B">
<span style=3D"font-family: Courier New=2CCourier=2CMonospace=3B">INFO (com=
.canoo.webtest.engine.WebClientContext) - Responses restored</span><br>
<span style=3D"font-family: Courier New=2CCourier=2CMonospace=3B"><br>The t=
est fails with this error:<br>JavaScript error loading page
https://mywebsite.com/login?login:username=3D:
ReferenceError: "VBgetAcrobat" is not defined.
(https://mywebsite.com/login.js#108)</span><br><span style=3D"font-family: =
Courier New=2CCourier=2CMonospace=3B"><br>Is there anyway around this?&nbsp=
=3B I looked at the documentation and could not find any flags or other inf=
ormation to ignore embedded VBScript.<br><br>Thanks!<br style=3D"font-famil=
y: Courier New=2CCourier=2CMonospace=3B"></span><span style=3D"font-family:=
 Courier New=2CCourier=2CMonospace=3B"></span><br style=3D"font-family: Cou=
rier New=2CCourier=2CMonospace=3B"><span style=3D"font-family: Courier New=
=2CCourier=2CMonospace=3B"></span><span style=3D"font-family: Courier New=
=2CCourier=2CMonospace=3B"></span><span style=3D"font-family: Courier New=
=2CCourier=2CMonospace=3B"> </span><br><br></div>
</body>
</html>=

--_2706270a-77ca-401a-9ed3-f342e0744626_--