guruk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I am using Win32::IEAutomation module to automate my Web based application. I am trying to prepare a report for the test cases I automated.

The problem is I am unable to get the execution status of the commands gotoURL, getButton .... to know if my button click or url redirection is successful or not.

I tried putting the command in an if loop, but still am unsuccessful as getButton doesn't return o or 1 it returns null ' '. Please help me how do I achieve this.

Regards, Guru
  • Comment on execution status of gotoURL in Win32::IEAutomation

Replies are listed 'Best First'.
Re: execution status of gotoURL in Win32::IEAutomation
by Anonymous Monk on Nov 22, 2007 at 15:59 UTC
    gotoURL($url, [$nowait]) This method navigates to the given url and waits for it to be loaded completely if second argument is not provided Second argument is optional and it represents the boolean value for not waiting till page gets loaded. Giving second argument as 1 (true boolean value) makes your code not to wait for page loading in this 'gotoURL' method. This is useful if you need to interact with any dialog like security alert. In that case use this method with second argument, then interact with dialog (methods for interacting with dialog are described below) and then using method 'WaitforDone' (described below) wait for IE to load page completely.

    # WaitforDone() Waits till IE had came out of busy state and document is loaded completly. This will poll IE for every one second and check its busy state and document complete state, before we move on.

    Click($nowait); Clicks the link and waits till document is completely loaded. As it uses click method of DOM, it supports clicking link with javascript in it. $nowait: This is optional. Giving this argument as 1 (true boolean value) makes your code not to wait for complete page loading after clicking link. This is useful if you need to interact with any dialog (like logon dialog) after clicking the link. (please see logon() method example for details)

      AMonk,

      Thanks for your reply and $nowait option. My problem is I am trying to prepare a report of my test case execution using Test::More.

      when I try to use is() function of Test::More is($ie->getButton('id:',"<value>"), 0, $test_name);

      I get the result as

      failed test.

      got: ''

      expected:0

      How do I fix the above issue.
        expect "" instead of 0?