in reply to Re: Gui Automation using guitest
in thread Gui Automation using guitest

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: Gui Automation using guitest
by MidLifeXis (Monsignor) on Feb 15, 2011 at 14:20 UTC
    WMGetText($id) eq ( ["*agree*" ] or ["*accept*"] )

    perlop - X or Y means that if X evaluates to true, X is returned. If X evaluates to false, then if Y evaluates to true, the statement returns Y. Otherwise it returns a false value.

    ["*agree*"] creates a brand new array reference (perlref). Add this to the previous paragraph, and you are comparing one of two brand new array references or false (which will simplify to just the new arrayref ["*agree*"]) to the results of WMGetText($id) to see if they are equal in a string comparison. Very unlikely to return the results you want.

    Update: reduce part after eq to just arrayref.

    --MidLifeXis

      Any suggestion how to go about it? i tried like this if (("agree"|"accept")=~ /WMGetText($id)/)

        Instead of if (("agree"|"accept")=~ /WMGetText($id)/), how about if (WMGetText($id) =~ /^(agree|accept)$/). See perlre for more details.

        --MidLifeXis