Hi all
The below codes logins to the yahoo mail with the paasword given.
When I clicked "view source" in "http://mail.yahoo.com" I can able to find the formname as "login_form " and Iam able to find the labelbox for username and passwd used the same and no issues are seen.
Now Iam trying to automate another application(Tes t director) in which we
upload results of test cases,but I cont find any form name under the
view source tab,so is there any other means by which you can fetch the form name as well as remaining fields(likke label box name for username and paswd)
so that I can Login and do some automation.
Thanks in advance
use strict;
use warnings;
use Win32::OLE ;
my $URL = "http://mail.yahoo.com" ;
my $FormName = "login_form ";
my $UserName = "XXXX";
my $Password = "XXXXX";
my $IE = Win32::OLE->new('InternetE xplorer.Applica tion') || die "Could not start Internet Explorer.Applic ation\n";
$IE->{visible} = 1;
$IE->navigate($URL) ;
while( $IE->Busy() )
{
sleep( 2 );
}
my $Form = $IE->{document}->Forms( $FormName ) || die "Unable to find $FormName form";
$Form->{"username"}->{value} = $UserName;
$Form->{"passwd"}->{value} = $Password;
$Form->Submit();
while( $IE->Busy() )
{
sleep( 2 );
}
print "New page title: " . $IE->{document}->{Title} . "\n";
The below codes logins to the yahoo mail with the paasword given.
When I clicked "view source" in "http://mail.yahoo.com" I can able to find the formname as "login_form " and Iam able to find the labelbox for username and passwd used the same and no issues are seen.
Now Iam trying to automate another application(Tes t director) in which we
upload results of test cases,but I cont find any form name under the
view source tab,so is there any other means by which you can fetch the form name as well as remaining fields(likke label box name for username and paswd)
so that I can Login and do some automation.
Thanks in advance
use strict;
use warnings;
use Win32::OLE ;
my $URL = "http://mail.yahoo.com" ;
my $FormName = "login_form ";
my $UserName = "XXXX";
my $Password = "XXXXX";
my $IE = Win32::OLE->new('InternetE xplorer.Applica tion') || die "Could not start Internet Explorer.Applic ation\n";
$IE->{visible} = 1;
$IE->navigate($URL) ;
while( $IE->Busy() )
{
sleep( 2 );
}
my $Form = $IE->{document}->Forms( $FormName ) || die "Unable to find $FormName form";
$Form->{"username"}->{value} = $UserName;
$Form->{"passwd"}->{value} = $Password;
$Form->Submit();
while( $IE->Busy() )
{
sleep( 2 );
}
print "New page title: " . $IE->{document}->{Title} . "\n";
Comment