[Webtest] best-practices? using xml/xsl and webtest to populate data

Dierk König webtest@lists.canoo.com
Sat, 4 Oct 2003 19:09:05 +0200


This is a multi-part message in MIME format.

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

RE: [Webtest] best-practices? using xml/xsl and webtest to populate dataHm,
It seems that the information you want to put in the db is in the
testresult.xml that WT produces.

You can write an xslt to extract it and even generate the sql script code
that puts it into the db.
If you are not comfortable with writing xslt, you can use a scripting
language like perl, python or
ruby. At least for ruby I have used its excellent xpath support to extract
information from xml.
With its REXML package your job is done in just a few lines.

cheers
Mittie
  -----Original Message-----
  From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]On Behalf Of Bill Milbratz
  Sent: Freitag, 3. Oktober 2003 22:48
  To: 'webtest@lists.canoo.com'; webtest@gate.canoo.com
  Subject: RE: [Webtest] best-practices? using xml/xsl and webtest to
populate data


  >+) Are you talking about using webtest to populate the database, let's
says to
  >have a few new business case in the database?!
  Yes, basically I was talking about this. Our QA people had asked about a
means to get 'business' data in the database.



  some background:
  tuations:
  1) some of our 'behind the scenes' processing can be complex..i.e.
sometimes 1 'thing' a user sees might have 2 or 3 records supporting
it..e.g. a Poll record consists of a 'poll' record, a generic 'element'
record, and ACL records for security.

  I've found having sql script/xml file, etc. w/ db information is awkard to
maintain, esp. when data for one element is spread across a few records.

  2) Our application stores some information on a file system...in addition
to the database..
  (e.g. for lucene-based search)..

  It seemed, at a quick glance, like one could set up an xml file w/ just
the information the user typically enters on the web pages and use xsl to
generate webtest xml files to populate the system w/ that data.

  This would take longer to run (most likely) than running raw sql scripts,
but the data itself would be easier to maintain, i.e. QA team could maintain
it as it would match what they type in on the web pages, i.e. not table
primary keys and foreign keys and such.

  that was the idea.

  I hadn't checked out dbunit or octopus yet. thanks for the tip.

  bill


------=_NextPart_000_0019_01C38AAA.FAC761F0
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: [Webtest] best-practices? using xml/xsl and =
webtest to populate data</TITLE>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D694580317-04102003>Hm,=20
</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D694580317-04102003>It=20
seems that the information you want to put in the db is in the =
testresult.xml=20
that WT produces.</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D694580317-04102003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D694580317-04102003>You=20
can write an xslt to extract it and even generate the sql script code =
that puts=20
it into the db.</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D694580317-04102003>If you=20
are not comfortable with writing xslt, you can use a scripting language =
like=20
perl, python or</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D694580317-04102003>ruby.=20
At least for ruby I have used its excellent xpath support to extract =
information=20
from xml.</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D694580317-04102003>With=20
its REXML package your job is done in just a few =
lines.</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D694580317-04102003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D694580317-04102003>cheers</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D694580317-04102003>Mittie</SPAN></FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px">
  <DIV align=3Dleft class=3DOutlookMessageHeader dir=3Dltr><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>Bill Milbratz<BR><B>Sent:</B> Freitag, 3. Oktober 2003=20
  22:48<BR><B>To:</B> 'webtest@lists.canoo.com';=20
  webtest@gate.canoo.com<BR><B>Subject:</B> RE: [Webtest] =
best-practices? using=20
  xml/xsl and webtest to populate data<BR><BR></DIV></FONT>
  <P><FONT size=3D2>&gt;+) Are you talking about using webtest to =
populate the=20
  database, let's says to </FONT><BR><FONT size=3D2>&gt;have a few new =
business=20
  case in the database?!</FONT> <BR><FONT size=3D2>Yes, basically I was =
talking=20
  about this. Our QA people had asked about a means to get 'business' =
data in=20
  the database.</FONT> </P><BR>
  <P><FONT size=3D2>some background:</FONT> <BR><FONT =
size=3D2>tuations:</FONT>=20
  <BR><FONT size=3D2>1) some of our 'behind the scenes' processing can =
be=20
  complex..i.e. sometimes 1 'thing' a user sees might have 2 or 3 =
records=20
  supporting it..e.g. a Poll record consists of a 'poll' record, a =
generic=20
  'element' record, and ACL records for security.</FONT></P>
  <P><FONT size=3D2>I've found having sql script/xml file, etc. w/ db =
information=20
  is awkard to maintain, esp. when data for one element is spread across =
a few=20
  records.</FONT></P>
  <P><FONT size=3D2>2) Our application stores some information on a file =

  system...in addition to the database..</FONT> <BR><FONT size=3D2>(e.g. =
for=20
  lucene-based search)..</FONT> </P>
  <P><FONT size=3D2>It seemed, at a quick glance, like one could set up =
an xml=20
  file w/ just the information the user typically enters on the web =
pages and=20
  use xsl to generate webtest xml files to populate the system w/ that=20
  data.</FONT></P>
  <P><FONT size=3D2>This would take longer to run (most likely) than =
running raw=20
  sql scripts, but the data itself would be easier to maintain, i.e. QA =
team=20
  could maintain it as it would match what they type in on the web =
pages, i.e.=20
  not table primary keys and foreign keys and such.</FONT></P>
  <P><FONT size=3D2>that was the idea.</FONT> </P>
  <P><FONT size=3D2>I hadn't checked out dbunit or octopus yet. thanks =
for the=20
  tip.</FONT> </P>
  <P><FONT size=3D2>bill</FONT> </P></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0019_01C38AAA.FAC761F0--