The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can anyone recommend a book for perl WIN32 popeye Shell Programming and Scripting 1 05-21-2008 10:49 PM
Perl in Win32 Paris Heng Windows & DOS: Issues & Discussions 1 04-06-2008 11:17 PM
execution status of gotoURL in Win32::IEAutomation gurukottur Shell Programming and Scripting 2 11-21-2007 11:27 PM
perl win32::ieautomation gurukottur Shell Programming and Scripting 0 11-06-2007 04:59 AM
Perl: Run perl script in the current process vino Shell Programming and Scripting 10 12-09-2005 06:45 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-23-2007
Registered User
 

Join Date: Apr 2006
Posts: 37
perl script using Win32::IEAutomation

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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-24-2007
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 755
Try replacing this
Code:
$ie->getImage('alt:',"Incidents")->Click;
with this
Code:
$ie->getImage('linktext:',"Incidents")->Click;
This will work if the alt attribute of that image is Incidents
Reply With Quote
  #3 (permalink)  
Old 10-24-2007
Registered User
 

Join Date: Apr 2006
Posts: 37
Its still the same problem.

I tried the command
$ie->getImage('linktext:',"Incidents")->Click;

No luck

If I use class to get the Image and there are more than one objects of the same class. How do I differentiate them and click on the object I desire.
ex:
$ie->getImage('class:',"IceGphImg")->Click;
But my page contains other images of same class.
can I do something like this:
$ie->getImage('class:',"IceGphImg")->getImage('alt:',"Incidents")->Click;

Thanks for the reply
Reply With Quote
  #4 (permalink)  
Old 10-25-2007
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 755
$ie->getImage('class:',"IceGphImg")->getImage('alt:',"Incidents")->Click; would produce error

One way of debugging I can think is (need not be the optimal way): get a list of all images on the form using getAllImages() function. In this list, check the attributes of the image on which you wish to click. If you find any unique attribute, use it as argument to getImage() function.
Reply With Quote
  #5 (permalink)  
Old 10-26-2007
Registered User
 

Join Date: Apr 2006
Posts: 37
yogesh,

thanks for your responses.

I am trying getAllImages on my web page and reading them to an array,but when I print the array element, I get the o/p as Win32::IEAutomation::Element=Hash<0x123>
How can I recognize the image with above value. How do I get the required attribute.

The problem with my web page is that all the attributes ie alt,class,id,name etc are dynamic and keep changing, so I am unable to click on them.

Is there a way I can click on these attriburtes.

Thanks,
Guru
Reply With Quote
  #6 (permalink)  
Old 10-28-2007
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 755
Use the Data:: Dumper module to print that array. For example, convert this:
Code:
print @all_images_array;
to this:
Code:
use Data::Dumper;
print Dumper (@all_images_array);
This will list all the contents of array. Then you may be able to see all the attributes.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0