Evaluating Tools

2003-06-24
2003-06-24
  • Henry Wasserman

    Henry Wasserman - 2003-06-24

    Hi, Henry.  I am currently evaluating different web based automation
    tools
    for my company and I am very eager to get samie up and running.  I
    downloaded ActivePerl and samie.zip according to your documentation
    here:
    http://samie.sourceforge.net/install.html

    However, the example (test.pl) does not work.  I get this error:

    C:\PerlApps\samie>perl test.pl
    Can't locate Win32/SAM.pm in @INC (@INC contains:
    C:/PerlApps/ActivePerl/lib
    C:/PerlApps/ActivePerl/site/lib .) at test.pl li
    ne 3.
    BEGIN failed--compilation aborted at test.pl line 3.

    C:\PerlApps\samie>

    I couldn't find any documentation on your web site, so I tried
    installing
    SAM.pm.  When I do that I get this error, though:

    C:\PerlApps\ActivePerlsite\lib\Win32>dir
    Volume in drive C has no label.
    Volume Serial Number is 544A-D725
    Directory of C:\PerlApps\ActivePerlsite\lib\Win32

    06/17/2003  03:23p      <DIR>          .
    06/17/2003  03:23p      <DIR>          ..
    06/19/2002  09:13a               4,344 BitmapInline.pm
    06/19/2002  09:13a               6,577 GridLayout.pm
    06/19/2002  09:13a              87,017 GUI.pm
    01/04/2003  12:17a              27,247 SAM.pm
    10/12/2000  07:34a              20,864 setupsup.pm
                   5 File(s)        146,049 bytes
                   2 Dir(s)  28,415,404,544 bytes free

    C:\PerlApps\ActivePerlsite\lib\Win32>ppm3 install SAM.pm
    Error: No valid repositories: Error: 501 Protocol scheme '' is not
    supported at
    C:/PerlApps/ActivePerl/site/lib/PPM/Repository.pm line 84 Error: 501
      Protocol scheme '' is not supported at
    D:/PerlApps/ActivePerl/site/lib/PPM/Repository.pm line 84

    C:\PerlApps\ActivePerlsite\lib\Win32>

    Can you

    1) provide any help to the above, so I can run the example (test.pl)
    2) point me to any additional documentation
    3) point me to a mail list for users of samie

    Please keep in mind that I am very new to Perl - but I am an
    experienced
    Java developer.  Thank you for any help.

    Misha

     
    • Henry Wasserman

      Henry Wasserman - 2003-06-24

      hmmm.  Let me suggest that you unistall active perl
      then, reinstall it into the default directories.  then
      run the samie install.

      If this doesn't work, we can still get it up and
      running, send me another e-mail.

       
    • Henry Wasserman

      Henry Wasserman - 2003-06-24

      Because I'm doing a proof of concept with this, I decided to copy
      snippets
      of your code and modify it to our needs here, instead of trying to
      install
      the samie module.  However, I'm running into issues with frames. How
      exactly
      can I access different frames in a document and work on filling out the
      forms there?  I checked SAM.pm and I noticed that you have a Sub Event
      function, which is "A huge work around used to get to the Frame
      documents
      because of an MS OLE Frame Bug". But how exactly can I use it?  All I
      want
      is a way to say:

      GotoFrame("contentFrame);
      ClickLink("Timesheet");

      I have the ClickLink and ClickFormButton implemented, but I need a way
      to
      access different frames in the app.  Thanks for the help - if you can
      point
      me to more documentation for this type of stuff, I'd be happy to
      peruse.

      Also, how do I get all the properties and methods of the $IEbrowser
      object?
      I see that you did this:

      my $IEbrowser = Win32::OLE->new('InternetExplorer.Application');  #or
      die
      $!;

      and then proceed to set a bunch of properties on it (left, top, height,
      etc.) I've browser the Microsoft documentation and I see the
      equivalents.
      However, I'd like to know what all the properties and methods are that
      I can
      set from Perl, without having to guess at what they might be named to
      (e.g.
      $IEbrowser->{statusbar} in Perl, but MS calls it StatusBar).

      Thanks again for the help.

      Misha

       
    • Henry Wasserman

      Henry Wasserman - 2003-06-24

      Of-course I'm biased, but unless you are trying to
      rewrite samie to be more perl object oriented I do
      recommend that you use all of sam.pm.

      It's not that large of a file and the frames problem
      has been dealt with inside there.

      Samie does frames.  But in some places you are walking
      on thin ice and it is an aquired skill.

      Usually in a project under test there is one frame
      where most of the testing gets done, which makes
      things a lot easier.  But samie does handle all frames
      on any page.

      Each frame on a page is defined by a reference to it's
      own dom (dhtml).  In samie each dom is returned as a
      reference. These references are stored in the
      @IEObjects arrray.

      For each testing function, samie spins through each
      dom, then each object in each dom looking for the
      object that you are trying to test.

      The link to microsofts dhtml documentation was broken
      and has been fixed on the samie home page.

      Part of the problem in working with frames is a
      microsoft bug.

      Microsoft has an attribute called readystate.  When
      readystate is = 4 all objects in the document should
      be completely loaded and the spinner should be
      stopped.

      This works fine when there are no frames on the page.
      When frames come into the picture readystate=4 becomes
      unreliable.

      I have created a work around in samie to handle this.
      You tell the WaitForDocumentComplete function how many
      frames to look for on the page.

      samie counts the pages (doms - dhtml pages) as they
      come in and stops the WaitForDocumentComplete function
      from blocking when the page has been completely
      downloaded.

      This works great except that certain frames come in
      blank.

      For this work around I have created the CleanIEObjects
      function which leaves the reference to the dom in the
      IEObject array of any frames that do not get
      refreshed. I am able to identify these frames by
      passing in their URL's into URLHash.

      There is a debug on or off feature in samie that lets
      you see what is going on better when you are using
      frames.

      What usually happens to the inexperienced is that
      their WaitForDocumentComplete function starts getting
      off the track, thinking that pages are loaded when
      they really are not.

      Samie should not be calling any other functions until
      the page and all it's frames has completely loaded.

      If you need to know more just drop me a line.

      Thanks
      Henry

       

Log in to post a comment.