Tips needed in Ie automation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kriz4321
    New Member
    • Jan 2007
    • 48

    Tips needed in Ie automation

    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";
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    I suggest that you use one of the already created cpan modules for accessing yahoo mail:




    If you feel compelled to make you own, at the very least you can base some of your functionality off of what they used to accomplish the task. It's possible that Yahoo Mail's new interface breaks the use of these modules as they are both a couple years old. But I'm certain that you can learn a lot from them even if they don't still work.

    Comment

    Working...