[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Winclicker is not clicking the button on pop-up window.

Bhavesh Sharma

1/20/2008 1:24:00 PM

Hi,

I have to create an script where i have to open an page in IE7.

Once page is opened, i have to click the "Delete" button.

As soon as i press the "Delete" button, an Windows Internet explorer
window [small window] pop up with options "Ok" and "Cancel".

But using watir code im not able to click "Ok" button.

I have tried writing code like this --

def jsAlert(button, waitTime = 3)
w = WinClicker.new
longName = $ie.dir.gsub("/" , "\\" )
shortName = w.getShortFileName(longName)
c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button}
#{waitTime} "
puts "Starting #{c}"
w.winsystem(c)
w=nil
end



Then, before the button i want to click that generates the popup, added:

jsAlert("OK", 3)

ie.button(:name, "Delete").click #After clicking this delete button, a
pop-up window comes up where i need to click "OK" button.


This pop-up window is an modal window i mean im not able to select
anything behind this window and it is having a title of "Windows
Internet Explorer"

I have defined the fuctions sAlert and then immedaitely called it. It
starts another DOS window and searc hsomething but bydefault after 30
secs this Dos window gets closed.
--
Posted via http://www.ruby-....

1 Answer

Axel Etzold

1/20/2008 3:38:00 PM

0

Dear Bhavesh,

> I have to create an script where i have to open an page in IE7.

I am not a watir expert, but I had positive experience with Windows
Automation using AutoIT :

http://www.autoitscript.co...

Best regards,

Axel
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/g...