I was searching for a message in the html. I used VerifyTableText as a model and was able to get the following to work:

sub VerifyText { #$text
my $text = shift @_;
my $IEDocument;
my $IEObject;
my $i;
my $j;
my $k;
foreach $IEObject (@Win32::SAM::IEObjects) {
$IEDocument = $IEObject->{Document};
for ($i=0; $i<$IEDocument->all->length; $i++) {
if ($IEDocument->all($i)->tagName =~ /^TABLE$/) {
#print "Found a TABLE\n";
my $table = $IEDocument->all($i);
for ($j=0; $j < $table->rows->length; $j++) {
my $cell = $table->rows($j);
#print "Found a row: " . $table->rows($j)->tagName . "\n";
for($k=0; $k < $cell->cells->length; $k++) {
if (defined($cell->cells($k)->innerText)) {
if ($cell->cells($k)->innerText =~ /^$/) {
}#if ($cell->cells($k)->innerText =~ /^$/) {
if ($cell->cells($k)->innerText =~ /^\s*$/) {
}#if ($cell->cells($k)->innerText =~ /^\s*$/) {
#print "Here's the cell: " . $cell->cells($k)->innerText . "\n";
if ($cell->cells($k)->innerText =~ /^\s*$text\s*$/) {
LogResults("PASSED - Found $text in a table on the page\n","RESULT");
return 0;
LogResults("FAILED - Could not find $text in a table on the page\n","RESULT");
return 1;

You can post my question.

Thanks for the great tool!


-----Original Message-----
From: Rob Marchetti [mailto:samie4qa@yahoo.com]
Sent: Monday, November 11, 2002 12:18 PM
To: laura.meli@points.com
Cc: rmarchetti@upromise.com
Subject: Re: Verifying Data in Web browser

Is the message displayed in a pop up message box or is it part of the html?

If the message is displayed in a message box, I'll send you info on how to verify that.

If the message is displayed in the html...

Most of the time, messages are displayed inside of tables. Try the VerifyTableText method. If this doesn't work, send me the HTML and I'll get it working for you and then add the new function to SAM.pm


p.s. would it be ok to post your question to http://samie.sourceforge.net?

Henry Wasserman

Laura Meli <laura.meli@points.com> wrote:

I am using Samie to automate my GUI testing. I've run into a small problem.
How do I verify the result on the screen after a button is selected. For
example I am expecting to get an error message printed on the top of the
screen after the button is pushed and the required fields have been left

Thanks in advance.