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

Hi Folks,

I am using Perl module Win32::IEAutomation for automating a web page which is implented using iceface.

I am trying to click on a image which has the following html code: <input alt="Incidents" class="iceCmdBtn" id="_id68:_id79" name="_id68:_id79" onblur="setFocus('');" onclick="iceSubmit(form,this,event);return false;" onfocus="setFocus(this.id);" src="/ipss/images/avaya/esp/nav_inc_def.bmp" type="image">

I'm using the below code to click on the above image in my script:

$ie->getImage('alt:',"Incidents")->Click;

But I get the below error when I run my script: Can't call method "Click" on an undefined value at ieauto.pl line 23. I tried other attributes of getImage like class, id, imgurl ..., but still I am unble to redirect my page to the desired link. My script works fine with other web pages, but with Iceface I think there is a problem recognizing the objects.

Please help me in this as this is blocking my work. Please treat it as important. Thanks in advance Guru Charan

Replies are listed 'Best First'.
Re: perl script using Win32::IEAutomation
by Corion (Patriarch) on Oct 23, 2007 at 16:42 UTC

    I guess that there is no image matching what you tell us. Have you tried pasting the HTML into a separate file to see if it matches what you think?

    I can only recommend to you to make your code more robust by using the following:

    my $image = $ie->getImage('alt:', "Incidents"); if (! $image) { die "Couldn't find 'Incidents' image on the current page."; }; $image->Click();

    As an aside, I don't really care if this is "blocking your work", and queries are not "treated as important" here based on your saying so.