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

B

Bhavesh Sharma

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top