PDA

View Full Version : How to search a string in IEautomation


sangeetha12
05-16-2008, 08:17 AM
Hi,

I am using win32::IEAutomation for automating my webapplication.I want to search a string in my webpage.I am using the function called "VerifyText" to search the strings.But while excuting my code i cant able to see the string selection.How to show the selected string. Here i have given my sample code:

use Win32::IEAutomation;
use Win32::IEAutomation::WinClicker;
my $ie = Win32::IEAutomation->new();
$ie->gotoURL("https://google.com", 1);
my $clicker = Win32::IEAutomation::WinClicker->new();
$clicker->push_security_alert_yes();
$ie->WaitforDone;
$ie->getTextBox('name:', "q")->SetValue("web automation");

$ie->getButton('caption:', "Google Search")->Click;

$ie->getLink('linktext:', "SourceForge.net: Sahi - Web Automation and Test Tool")->Click;
$ie->getLink('linktext:', "Documentation")->Click;
$ie->VerifyText("Overview");


Can anyone help me how to show the searched string to the user. Is it possible?
Another one doubt how to compare the strings .Please send me sample code foe this.

Thanks
Sangeetha

MetalGear
05-26-2008, 09:28 AM
use strict;
use warnings;
use Win32::IEAutomation;
use Data::Dumper;

my $ie = Win32::IEAutomation->new;
$ie->gotoURL('http://www.google.com');
my $text = $ie->PageText;
#print $text;
my $found = $ie->VerifyText("google");
$ie->closeIE;

print Dumper $found;


try this...
use Data::Dumper package......install it...

MetalGear
05-26-2008, 09:29 AM
its Data Dumper package.....

abduraooft
05-26-2008, 09:37 AM
its Data Dumper package.....
See how to post codes in this forum http://www.codingforums.com/showthread.php?t=82672, to avoid :Dumper :)