AW: [Webtest] xpath problem
Pourki, Forouhar
webtest@lists.canoo.com
Wed, 5 Nov 2003 17:01:51 +0100
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C3A3B6.2049D1F0
Content-Type: text/plain;
charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Dirk,
Now i got the xpath-explorer and can see that xpath
/html/head/title resolves to LOGIN.
in my WebTest i make the login and should get a Site with
the Title "Projekt".
<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>
<!DOCTYPE project [
<!ENTITY config SYSTEM "file:../includes/config.xml">
<!ENTITY login SYSTEM "file:../modules/login.xml">
]>
<project name=3D"Dart WebTest" basedir=3D"." default=3D"xpath">
<target name=3D"xpath" >
<taskdef name=3D"testSpec" =
classname=3D"com.canoo.webtest.ant.TestSpecificationTask"/>
<testSpec name=3D"xpath">
&config;
<steps>
&login;
<verifyxpath stepid=3D"simple match"
xpath=3D"/html/head/title"
text=3D" Projekt "/>
</steps>
</testSpec>
</target>
</project>
The source is attached.(I had mailed it because of the clickproblem
for the saveIcon button after filling 3 EntryBoxes).
=20
-----Urspr=FCngliche Nachricht-----
Von: Dierk Koenig [mailto:dierk.koenig@canoo.com]
Gesendet am: Mittwoch, 5. November 2003 12:47
An: webtest@lists.canoo.com
Betreff: RE: [Webtest] xpath problem
The easiest advice is to use the xpath explorer
http://www.purpletech.com/xpe/index.jsp on your page
to see your page structure.
Alternatively you may need to provide the html source here for
further investigation.
cheers
Mittie
> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Pourki, Forouhar
> Sent: Mittwoch, 5. November 2003 12:12
> To: 'webtest@lists.canoo.com'
> Subject: [Webtest] xpath problem
>=20
>=20
> Hi there!
>=20
> i use the simple xpath example in
> http://webtest.canoo.com/webtest/manual/syntax.html#16
>=20
> namely:
>=20
> <verifyxpath stepid=3D"simple match with value"
> xpath=3D"/html/head/title"
> text=3D" Projekt "/>
>=20
> but i get the error:
>=20
> com.canoo.webtest.engine.StepFailedException: xpath test:=20
> /html/head/title evaluates to: , expected value is: Projekt ,=20
> Step: VerifyXPath(id=3D"simple match", text=3D Projekt , =
regex=3Dfalse,=20
> xpath=3D"/html/head/title)=20
>=20
> What can cause this?
> my confi & login are the same as other tests.
>=20
> Thanks for any help.
> Forouhar
>=20
>=20
>=20
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>=20
>=20
_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest
------_=_NextPart_000_01C3A3B6.2049D1F0
Content-Type: text/plain;
name="project.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="project.txt"
<html>
<head>
<link rel=3D"stylesheet" type=3D"text/css" =
href=3D"dart.css">
<script type=3D"text/javascript" =
src=3D"loading.js"></script>
<script type=3D"text/javascript" =
src=3D"dart.js"></script>
<script type=3D"text/javascript" =
src=3D"form_validation.js"></script>
<title> Projekt </title>
</head>
<body spaeter_onUnload=3D"abandonChanges();" leftmargin=3D"5px" =
rightmargin=3D"0px" topmargin=3D"5px" bottommargin=3D"0px"> <!-- =
onLoad=3D"setView();" -->
<script language=3D"JavaScript1.2" type=3D"text/javascript">
window.onerror =3D showError;
function validate()
{
if( checkMandatory() )
{
getActiveForm().submit();
}
}
function deleteRecord()
{
var form =3D getActiveForm();
var deleteValue =3D form.deleteAction.value;
if ( deleteValue =3D=3D null || deleteValue =3D=3D "" )
{
alert( '\"Delete\" hat in diesem Bereich keine =
Funktionalit=E4t' );
}
else
{
/*if ( isChangeOK() )
{*/
form.action =3D deleteValue;
form.submit();
/*}*/
}
}
function editRecord()
{
var form =3D getActiveForm();
var editValue =3D form.editAction.value;
if ( editValue =3D=3D null || editValue =3D=3D "" )
{
alert( '\"Edit\" hat in diesem Bereich keine Funktionalit=E4t' =
);
}
else
{
if ( isChangeOK() )
{
form.action =3D editValue;
form.submit();
}
}
}
function newRecord()
{
var form =3D getActiveForm();
var newValue =3D form.newAction.value;
if ( newValue =3D=3D null || newValue =3D=3D "" )
{
alert( '\"Neu\" hat in diesem Bereich keine Funktionalit=E4t' =
);
}
else
{
if ( isChangeOK() )
{
form.action =3D newValue;
form.submit();
}
}
}
function abandonChanges()
{
if( getActiveForm().changeFlag.value =3D=3D "false")
{
return true; // no changes, proceed
}
else
{
var cancelChanges =3D window.confirm( "M=F6chten Sie die =
=C4nderungen speichern?");
if( true =3D=3D cancelChanges)
{
validate();
}
}
return;
}
</script>
<table cellpadding=3D"0" border=3D"0" cellspacing=3D"0">
<tr>
<td class=3D"tdheader" valign=3D"top" align=3D"left"> Projekt =
</td> <!--<h3></h3>-->
</tr>
<tr>
<td align=3D"left" class=3D"formtdheader">
<input class=3D"ActiveButton" type=3D"button" =
onClick=3D"showTab(0);" name=3D"Tab0Button" id=3D"Tab0Button" value=3D" =
New_Project ">
</td>
</tr>
<tr>
<td class=3D"formtd" align=3D"left">
<input class=3D"ToolBarActive" src=3D"icons/new.gif" =
id=3D"newIcon" name=3D"newIcon" type=3D"image" =
style=3D"display:inline;" alt=3D"Neu" =
onClick=3D"newRecord();return false;"><input =
class=3D"ToolBarPassive" src=3D"icons/NoNew24.gif" =
id=3D"emptyNewIcon" name=3D"emptyNewIcon" type=3D"image" =
style=3D"display:none;" alt=3D"Neu (Nicht aktiv)" =
onclick=3D"return false;">
<input class=3D"ToolBarActive" src=3D"icons/Save24.gif" =
id=3D"saveIcon" name=3D"saveIcon" type=3D"image" =
style=3D"display:none;" alt=3D"Speichern" =
onClick=3D"validate();return false;" accesskey=3D"s" tabindex=3D"888" =
><input class=3D"ToolBarPassive" src=3D"icons/NoSave24.gif" =
id=3D"emptySaveIcon" name=3D"emptySaveIcon" type=3D"image" =
style=3D"display:inline;" alt=3D"Speichern (Nicht aktiv)" =
onclick=3D"return false;">
<input class=3D"ToolBarActive" src=3D"icons/Undo24.gif" =
id=3D"undoIcon" name=3D"undoIcon" type=3D"image" =
style=3D"display:inline;" alt=3D"Abbruch" =
onClick=3D"location.reload();return false;"><input =
class=3D"ToolBarPassive" src=3D"icons/NoUndo24.gif" =
id=3D"emptyUndoIcon" name=3D"emptyUndoIcon" type=3D"image" =
style=3D"display:none;" alt=3D"Abbruch (Nicht aktiv)" =
onclick=3D"return false;">
<input class=3D"ToolBarActive" src=3D"icons/Delete24.gif" =
id=3D"deleteIcon" name=3D"deleteIcon" type=3D"image" =
style=3D"display:inline;" alt=3D"L=F6schen" =
onClick=3D"deleteRecord();return false;"><input =
class=3D"ToolBarPassive" src=3D"icons/NoDelete24.gif" =
id=3D"emptyDeleteIcon" name=3D"emptyDeleteIcon" type=3D"image" =
style=3D"display:none;" alt=3D"L=F6schen (Nicht aktiv)" =
onclick=3D"return false;">
<input class=3D"ToolBarActive" src=3D"icons/Edit24.gif" =
id=3D"editIcon" name=3D"editIcon" type=3D"image" =
style=3D"display:none;" alt=3D"Editieren" =
onClick=3D"editRecord();return false;"><input =
class=3D"ToolBarPassive" src=3D"icons/NoEdit24.gif" =
id=3D"emptyEditIcon" name=3D"emptyEditIcon" type=3D"image" =
style=3D"display:inline;" alt=3D"Editieren (Nicht aktiv)" =
onclick=3D"return false;">
</td>
</tr>
<script>
deactivateNewButton();
</script>
<tr>
<td class=3D"formtd" valign=3D"top" align=3D"left">
<div id=3D"tab0" style=3D"display:block">
<form name=3D"Formular-tab0" id=3D"Formular-tab0" =
action=3D"save-project.html" method=3D"POST">
<input type=3D"hidden" name=3D"formproc.formname" =
value=3D"$formName-tab0">
<input type=3D"hidden" name=3D"changeFlag" value=3D"false">
<input type=3D"hidden" name=3D"saveAction" =
value=3D"save-project.html">
<input type=3D"hidden" name=3D"deleteAction" =
value=3D"delete-project.html">
<input type=3D"hidden" name=3D"editAction" value=3D"">
<input type=3D"hidden" name=3D"newAction" value=3D"">
<!-- start include /project.html -->
=20
<input type=3D"hidden" name=3D"id" value=3D"4858">
<script language=3D"JavaScript1.2" type=3D"text/javascript">
function descrchange()
{
if ( document.getElementById("ShortDescription").value !=3D null =
&&
document.getElementById("ShortDescription").value !=3D "" =
&&
document.getElementById("Description").value !=3D null &&
document.getElementById("Description").value !=3D "" &&
document.getElementById("LongDescription").value !=3D null =
&&
document.getElementById("LongDescription").value !=3D "" )
{
//document.getElementById("descriptionChange").value =3D =
"true";
activateSaveButton();
}
else
{
//document.getElementById("descriptionChange").value =3D =
"false";
deactivateSaveButton();
}
}
</script>
<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0">
<tr>
<td height=3D"8px" class=3D"formtd"></td>
<td height=3D"8px" class=3D"formtd"></td>
<td height=3D"8px" class=3D"formtd"></td>
<td height=3D"8px" class=3D"formtd"></td>
<td height=3D"8px" class=3D"formtd"></td>
</tr>
<tr>
<td height=3D"2px" class=3D"formtd"></td>
<td height=3D"2px" class=3D"formtd" =
background=3D"icons/border_upper_left.bmp"></td>
<td height=3D"2px" class=3D"formtd" =
background=3D"icons/border_upper.bmp"></td>
<td height=3D"2px" class=3D"formtd" =
background=3D"icons/border_right.bmp"></td>
<td height=3D"2px" class=3D"formtd"></td>
</tr>
<tr>
<td height=3D"*" class=3D"formtd"></td>
<td height=3D"*" class=3D"formtd" =
background=3D"icons/border_left.bmp"></td>
<td height=3D"*" class=3D"tdwater">
<table cellspacing=3D"5" cellpadding=3D"0" width=3D"100%">
<tr>
<td class=3D"tdwater">
<table cellspacing=3D"0" cellpadding=3D"0" width=3D"100%">
<tr>
<td> <table height=3D"100%" cellspacing=3D"0" =
cellpadding=3D"0">
<tr>
<td width=3D"2px" height=3D"20px" =
background=3D"images/attribute_left.bmp"></td>
<td width=3D"125px" =
background=3D"images/attribute_middle.bmp" class=3D"formtdheader">Kurze =
Beschreibung</td>
<td width=3D"2px" height=3D"20px" =
background=3D"images/attribute_right.bmp"></td>
</tr>
</table>
</td>
<td> <table height=3D"100%" cellspacing=3D"0" =
cellpadding=3D"0">
<tr>
<td width=3D"2px" height=3D"20px" =
background=3D"images/attribute_left.bmp"></td>
<td width=3D"310px" =
background=3D"images/attribute_middle.bmp" =
class=3D"formtdheader">Beschreibung</td>
<td width=3D"2px" height=3D"20px" =
background=3D"images/attribute_right.bmp"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><input class=3D"mandatory" name=3D"ShortDescription" =
id=3D"ShortDescription" style=3D"width:130px;" maxlength=3D"20" =
value=3D"Short description" onkeyup=3D"descrchange();" =
onclick=3D"this.select();this.onclick=3D'';" ></td>
<td><input class=3D"mandatory" name=3D"Description" =
id=3D"Description" style=3D"width:315px;" maxlength=3D"200" =
value=3D"New_Project " onkeyup=3D"descrchange();" =
onclick=3D"this.select();this.onclick=3D'';" ></td>
</tr>
<tr>
<td height=3D"1px" width=3D"155px"><hr noshade =
style=3D"visibility:hidden; height:1px; width:155px;"></td>
<td height=3D"1px" width=3D"330px"><hr noshade =
style=3D"visibility:hidden; height:1px; width:330px;"></td>
</tr>
<tr>
<td colspan=3D"2"> <table height=3D"100%" =
cellspacing=3D"0" cellpadding=3D"0">
<tr>
<td width=3D"2px" height=3D"20px" =
background=3D"images/attribute_left.bmp"></td>
<td width=3D"468px" =
background=3D"images/attribute_middle.bmp" class=3D"formtdheader">Lange =
Beschreibung</td>
<td width=3D"2px" height=3D"20px" =
background=3D"images/attribute_right.bmp"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=3D"2">
<textarea class=3D"optional" name=3D"LongDescription" =
id=3D"LongDescription" rows=3D"6" style=3D"width:473px;" =
onkeyup=3D"descrchange();" onclick=3D"this.select();this.onclick=3D'';" =
onFocus=3D'if(this.value=3D=3D"" && =
document.getElementById("Description").value!=3D"") =
{this.value=3Ddocument.getElementById("Description").value;descrchange()=
;this.select();this.onFocus=3D"";}'>Long description of new =
project</textarea>
</td>
</tr>
<tr>
<td height=3D"10px" colspan=3D"2"></td>
</tr>
<tr>
<td> <table height=3D"100%" cellspacing=3D"0" =
cellpadding=3D"0">
<tr>
<td width=3D"2px" height=3D"20px" =
background=3D"images/attribute_left.bmp"></td>
<td width=3D"125px" =
background=3D"images/attribute_middle.bmp" =
class=3D"formtdheader">Release</td>
<td width=3D"2px" height=3D"20px" =
background=3D"images/attribute_right.bmp"></td>
</tr>
</table>
</td>
<td> <table height=3D"100%" cellspacing=3D"0" =
cellpadding=3D"0">
<tr>
<td width=3D"2px" height=3D"20px" =
background=3D"images/attribute_left.bmp"></td>
<td width=3D"310px" =
background=3D"images/attribute_middle.bmp" =
class=3D"formtdheader">Projekt Type</td>
<td width=3D"2px" height=3D"20px" =
background=3D"images/attribute_right.bmp"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<input class=3D"optional" name=3D"Rel" maxlength=3D"10" =
value=3D"" style=3D"width:130px;" onkeyup=3D"descrchange();">
</td>
<td>
=
=
<input type=3D"text" name=3D"ProjectTypsimili" id=3D"ProjectTypsimili" =
value=3D"ProjectType.0" class=3D"optional" style=3D"width:315px;" =
readonly onClick=3D"alert('Dieses Projekt hat eine odere mehrere =
Applikationen.\n\nDeshalb k\u00f6nnen Sie den Projekttyp nicht mehr =
\u00e4ndern.');">
<input type=3D"hidden" name=3D"ProjectTyp" id=3D"ProjectTyp" =
value=3D"0">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td height=3D"*" class=3D"formtd" =
background=3D"icons/border_right.bmp"></td>
<td height=3D"*" class=3D"formtd"></td>
</tr>
<tr>
<td height=3D"2px" class=3D"formtd"></td>
<td height=3D"2px" class=3D"formtd" =
background=3D"icons/border_lower.bmp"></td>
<td height=3D"2px" class=3D"formtd" =
background=3D"icons/border_lower.bmp"></td>
<td height=3D"2px" class=3D"formtd" =
background=3D"icons/border_lower_right.bmp"></td>
<td height=3D"2px" class=3D"formtd"></td>
</tr>
<tr>
<td height=3D"1px" width=3D"5px"><hr noshade =
style=3D"visibility:hidden; height:1px; width:5px;"></td>
<td height=3D"1px" width=3D"2px"><hr noshade =
style=3D"visibility:hidden; height:1px; width:2px;"></td>
<td height=3D"1px" width=3D"500px"><hr noshade =
style=3D"visibility:hidden; height:1px; width:500px;"></td>
<td height=3D"1px" width=3D"2px"><hr noshade =
style=3D"visibility:hidden; height:1px; width:2px;"></td>
<td height=3D"1px" width=3D"5px"><hr noshade =
style=3D"visibility:hidden; height:1px; width:5px;"></td>
</tr>
</table>
<script>
document.getElementById('ShortDescription').focus();
</script>
<!-- end include /project.html -->
</form>
</div>
<div id=3D"tab1" style=3D"display:none">
<form name=3D"Formular-tab1" id=3D"Formular-tab1" =
action=3D"$page.Tab1Action" method=3D"POST">
<input type=3D"hidden" name=3D"formproc.formname" =
value=3D"$formName-tab1">
<input type=3D"hidden" name=3D"changeFlag" value=3D"false">
<input type=3D"hidden" name=3D"saveAction" value=3D"">
<input type=3D"hidden" name=3D"deleteAction" value=3D"">
<input type=3D"hidden" name=3D"editAction" value=3D"">
<input type=3D"hidden" name=3D"newAction" value=3D"">
</form>
</div>
<div id=3D"tab2" style=3D"display:none">
<form name=3D"Formular-tab2" id=3D"Formular-tab2" =
action=3D"$page.Tab2Action" method=3D"POST">
<input type=3D"hidden" name=3D"formproc.formname" =
value=3D"$formName-tab2">
<input type=3D"hidden" name=3D"changeFlag" value=3D"false">
<input type=3D"hidden" name=3D"saveAction" value=3D"">
<input type=3D"hidden" name=3D"deleteAction" value=3D"">
<input type=3D"hidden" name=3D"editAction" value=3D"">
<input type=3D"hidden" name=3D"newAction" value=3D"">
</form>
</div>
</td>
</tr>
</table>
<script>
setView();
</script>
<p class=3D"comment"><i>TS: 1067859289972, URL: =
/project.html?id=3D4858, current user: 'pourki', dartdb: 'salgar', =
schema: 'sqa_05_schema'</i></p>
</body>
</html>
------_=_NextPart_000_01C3A3B6.2049D1F0--