perl script using Win32::IEAutomation


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting perl script using Win32::IEAutomation
# 1  
Old 10-23-2007
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
# 2  
Old 10-24-2007
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
# 3  
Old 10-24-2007
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
# 4  
Old 10-25-2007
$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.
# 5  
Old 10-26-2007
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
# 6  
Old 10-29-2007
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies

2. UNIX for Advanced & Expert Users

X-Win32 not working

I am trying to export windows display to my unix SunOS I have Windows server 2000 which has X-Win32 v6 installed. I start X-Win32. I then go to configure session with the following details. 1. host name: myhost 2. command: xterm -ls 3 username: user1 4 password: password Then i right... (1 Reply)
Discussion started by: mohtashims
1 Replies

3. Windows & DOS: Issues & Discussions

Getting Error when using Module Win32::IEAutomation;

Hi All, How are you Guys? I am using the Code use Win32::IEAutomation; # Creating new instance of Internet Explorer my $ie = Win32::IEAutomation->new( visible => 1, maximize => 1); # Site navigation $ie->gotoURL('http://www.google.com');... (4 Replies)
Discussion started by: adisky123
4 Replies

4. Shell Programming and Scripting

win32 ole in deepr details in perl

Hello Gurus, I am begginer in perl. I would like to ask several questions, some related to perl and its syntax but most will be regarding to WIN32 OLE. My main goal is to develop script that will check word document structure (return some information) and make some changes in this document (if it... (0 Replies)
Discussion started by: wakatana
0 Replies

5. Shell Programming and Scripting

PERL Win32::OLE Inserting Picture in Excel

I am trying to insert a picture into a worksheet in Excel using Perl the following is the code use Win32::OLE; use Win32::OLE::Const "Microsoft Excel"; use Win32::OLE qw(in with); # Initiate Excel application $Excel = Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{Visible} =1; #... (1 Reply)
Discussion started by: cold_Que
1 Replies

6. Shell Programming and Scripting

win32::IEAutomation

Hi folks, what is the command used to click on the 'x' button of popup browser window in perl windows.I am using WIN32::IEAutomation module. Please any one can help on this.... (3 Replies)
Discussion started by: jyo123.jyothi
3 Replies

7. Shell Programming and Scripting

Can anyone recommend a book for perl WIN32

Is there a book available that goes into the PERL WIN32 module in depth ? I like the Unix in a nutshell or Perl Black Book by Holzner way of teaching. Teach by example. Anyone ? Thanks Popeye, Olive and sweetpea :p (1 Reply)
Discussion started by: popeye
1 Replies

8. Windows & DOS: Issues & Discussions

Perl in Win32

Dear, Did anybody knnow how to run the Perl script or whatever mean for testing the script in Windows? (1 Reply)
Discussion started by: Paris Heng
1 Replies

9. Shell Programming and Scripting

execution status of gotoURL in Win32::IEAutomation

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... (2 Replies)
Discussion started by: gurukottur
2 Replies

10. Shell Programming and Scripting

perl win32::ieautomation

Hi friends, I am using win32::ieautomation to automate portal Please help me with below line of code: my $target_cell = $table_object->tableCells(2, 5); what is $table_object in above line I am using $browser->getTable('id:', "table_id")->tableCells(2,5); The error I get is can't... (0 Replies)
Discussion started by: gurukottur
0 Replies
Login or Register to Ask a Question