Menu

SAMIE won't populate fields

2006-01-30
2013-04-09
  • Nobody/Anonymous

    Hi,

    I am trying to load a multi-frame page, enter a value and then click verify. The page loads fine but then the script just stops here:

    DocumentComplete doccounter = -1
    WaitForBusy = 0
    ReadyState = 4
    pushing arg 1 http://myurl.asp
    Inside WaitForDocumentComplete
    Cleaning @IEObjects
    Blocking with MessageLoop

    Code:
    use Win32::OLE;
    use Win32::SAM;
    #use Win32::Slingshot;

    $| = 1;
    my $URL = "http://ipaddress/page";
    my $seconds;

    $Win32::OLE::Warn = 3;

    StartIE();
    $seconds = Navigate($URL);
    print "First Page took $seconds seconds to load\n";

    SetEditBox("Number","1234567");
    ClickFormButton("Verify");

    It doesn't populate the field and click verify. Nothing happens. Any help would be greatly appreciated. The script was created with Slingshot.

    Regards

     
    • Jan Ploski

      Jan Ploski - 2006-01-30

      I once had a similar problem. It was caused by the DocumentComplete event arriving too many times. My solution was to simply discard all DocumentComplete events with ReadyState != 4.

       
      • Nobody/Anonymous

        Hi Jan,

        Where exactly do I remove the DocumentComplete events with ReadyState != 4.

        /John

         
        • Jan Ploski

          Jan Ploski - 2006-02-01

          I suppose you are using the current version of SAMIE (2.1) - unlike myself. Locate the SAM.pm file in your system, edit it and look around line 284 (subroutine named Event). This is where the processing of the DocumentComplete event occurs. You will notice that $doccounter is decreased there.

          My suggestion is to add the additional condition $IE->ReadyState() == 4 to the branch, so that DocumentComplete events with other ReadyStates are completely ignored. You may be interested in adding some debugging outputs first to see if the a DocumentComplete with a wrong ReadyState indeed is the cause of your problems.

          Note that I am not involved into SAMIE's development and do not understand the current code fully. You change it at your own risk.

           

Log in to post a comment.