Discussion:
need to parse and verify certain content..
(too old to reply)
Vishwanath Chitnis
2006-10-11 06:51:34 UTC
Permalink
hi,

i need to parse the content on a page (which are basically headers ) and
verify certain content is returned or not by my server . i am using IE
automation i tried using
Content();
VerifyText($string, [iflags])..but getting "Undefined subroutine
&main::Content called at main.pl line 35." this error..any ideas how this
can be done..?
is there any other way other than above mentioned to do this?

thanks in advance
vish
Charles K. Clarkson
2006-10-11 07:02:37 UTC
Permalink
Vishwanath Chitnis wrote:

: is there any other way other than above mentioned to do this?

How can we possibly tell with only those lines?

Show more code. Something we can run that will illustrate
your problem.


HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
Free Market Advocate
Web Programmer

254 968-8328

Don't tread on my bandwidth. Trim your posts.
u***@DavidFilmer.com
2006-10-11 08:49:26 UTC
Permalink
Post by Vishwanath Chitnis
..but getting "Undefined subroutine
&main::Content called at main.pl line 35."
Wow. Usually the problem is on line 42 (42 is, of course, The Answer to
the Ultimate Question of Life, the Universe, and Everything, according
to Deep Thought). I have no idea how you could possibly have a problem
on line 35. Maybe you accidentally deleted seven lines.
--
David Filmer (http://DavidFilmer.com)
Vishwanath Chitnis
2006-10-11 11:48:28 UTC
Permalink
ok, here is the code:

$webserver=apache1;
$platform=solaris;
$uname=abc123;
$password=abc123;

my $ie = Win32::IEAutomation->new(visible=>1,maximized=>1);

if ($webserver == apache1 && $platform == solaris){

$ie->gotoURL('http://xyz.test.com:8900/_cqr/test.cgi');

}

$ie->getTextBox("name:", "loginId")->SetValue($uname);# am passing username

$ie->getTextBox("name:", "password")->SetValue($password); # to pass the
password

$ie->getButton("caption:", "Submit")->Click; #this is to submit the
details...

$ie->getLink("linktext:", "xyz")->Click;# after i login i need to click on
particular link on the page
Content();# after i am navigated, i am trying to get contents from my
page...not sure if this is correct..
VerifyText($nick="google.com") ;# this is to verify whether google.com is
present in the contents returned...



now i am able to login successfully, and able to navigate to that particular
link as well...but after navigating i have to verify wehther certain
parameters are present or not...this is where i am struck.. any ideas how do
i verify..this
thnx
vish
Provide a segment of code which can be run and produces
the error you are getting. These three lines of code will
not run. We don't know how you defined the $ie object, for
example. We should be able to copy and paste your supplied
code and run it locally.
Please send your code to the list, not to me personally.
Allow everyone to help you.
Charles K. Clarkson
--
Mobile Homes Specialist
Free Market Advocate
Web Programmer
254 968-8328
Don't tread on my bandwidth. Trim your posts.
-----Original Message-----
*Sent:* Wednesday, October 11, 2006 2:54 AM
*Subject:* Re: need to parse and verify certain content..
Post by Charles K. Clarkson
: is there any other way other than above mentioned to do this?
How can we possibly tell with only those lines?
Show more code. Something we can run that will illustrate
your problem.
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
Free Market Advocate
Web Programmer
here is sample of code..
$ie->getLink("linktext:", "xyz")->Click;#am navigated to my xyz page
Content();#here i am trying to get contents from my page...not sure if
this is correct..
VerifyText($nick="google.com") ;# this is to verify whether google.com is
present in the contents returned...
let me know if you need some more info.
thnx
254 968-8328
Post by Charles K. Clarkson
Don't tread on my bandwidth. Trim your posts.
--
< http://learn.perl.org/> <http://learn.perl.org/first-response>
Mug
2006-10-11 13:31:08 UTC
Permalink
Post by Vishwanath Chitnis
$webserver=apache1;
$platform=solaris;
$uname=abc123;
$password=abc123;
Missed the quotes ??
$webserver = "apache1" ;
Post by Vishwanath Chitnis
my $ie = Win32::IEAutomation->new(visible=>1,maximized=>1);
if ($webserver == apache1 && $platform == solaris){
if ( $webserver eq "apache1" .... ) { .... }

HTH
Mug

Loading...