[wtr-general] Re: clicking ok on popups

2009-08-16 Thread jane.liu

may be you can use Enter key instead of clicking button

Watir.autoit.Send('{ENTER}')

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: clicking ok on popups

2009-08-06 Thread Reshma
Yes that is right!

 

I realized that PopupA and popup B were invoked using internal propritory
language

So I don't think that can be automated

I managed to click OK on the popup that opens with new browser using the
following 

def check_for_popups

autoit = WIN32OLE.new('AutoItX3.Control')

#

# Do forever - assumes popups could occur anywhere/anytime in your
application.

loop do

# Look for window with given title. Give up after 1 second.

ret = autoit.WinWait('Windows Internet Explorer', '', 2)

#

# If window found, send appropriate keystroke (e.g. {enter}, {Y},
{N}).

if (ret==1) then autoit.Send('{enter}') end

puts looping

#

# Take a rest to avoid chewing up cycles and give another thread a
go.

# Then resume the loop.

sleep(3)

end

 

AND CALLING THE FUNCTION LATER

$popup = Thread.new { check_for_popups }  # start popup handler

 

 

After clicking Save, I am Not able to click the OK which opens in a new
browser whose code is 

form

input type=hidden  name=ShowCarsList value=!$MG_ShowCars

TABLE border=0 cellPadding=0 cellSpacing=0 width=100%

tr

td valign=top class=LeftCornernbsp;nbsp;nbsp;/td

td width=100% valign=middle class=MainHeader
nbsp;nbsp;Confirmation/td

td valign=middle class=MainHeader
nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/td

/tr

tr

td valign=top
class=LeftBorder!--DWLayoutEmptyCell--nbsp;/td


td width=100%

table class=Tablebox  width=100% border=0 cellPadding=0
cellSpacing=0 !-- Main Table --

tr

td

TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0 class=box
width=100% 

tr

td   align=center class=H2Information Has Been Saved
br Reservation Has Been Confirmed/td

/tr

/table

/td

/tr

tr

td

 TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0 class=box
width=100% 

tr

td align=rightinput type=button class=buttonMdTp3
name=OK value=  OK   onclick=javascript:window.close() /td

/tr

/table

/td

/tr

/table


/td

td valign=top class=RightBorder!--DWLayoutEmptyCell--/td


/tr

tr

td valign=top class=BottomLeftCorner/td

td  valign=top class=BottomBorder!--DWLayoutEmptyCell-- /td

td valign=top class=BottomRightCorner/td  

/tr

/table

/form

 

I am unable to click 'OK' on this last popup now and looking for a clean
solution so that I could use the same piece of code.

 

Thanks

 

  _  

From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com]
On Behalf Of Smruti Ranjan Kar
Sent: Tuesday, August 04, 2009 8:48 PM
To: watir-general@googlegroups.com
Subject: [wtr-general] Re: clicking ok on popups

 

If I'm getting you, is this the requirement ?

- You click 'Proceed', Popup A appears
- Click 'OK', Popup B appears
- Click 'OK', New browser opens with a popup
- Click 'OK'
- Click 'Save'
- Click 'OK' on the confirmation

And what are the type of pop-ups at different steps ? i.e: modal, JS, new
browser 

On Tue, Aug 4, 2009 at 5:15 PM, rs77 rishaind...@gmail.com wrote:


I am new to Watir
1. I have an HTML page with fields,
2. When I click Proceed button
3. I get 2 consecutive alert popups with OK button
4. after clicking 'OK' on both of them another IE browser window pops
up
5. with another alert popup, which I click OK
6. Click Save button on the newly opened browser window
7. another confirmation Browser window is opened, which has a form in
it and OK button,

and trying to automate clicking the ok buttons using the methods
described at
http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

successfully click OK butto at step 5 only!!!

Could anybody help with how can i accomplish clicking ok buttons on
step 4 and step 7?

Thanks
RS







--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: clicking ok on popups

2009-08-04 Thread Smruti Ranjan Kar
If I'm getting you, is this the requirement ?

- You click 'Proceed', Popup A appears
- Click 'OK', Popup B appears
- Click 'OK', New browser opens with a popup
- Click 'OK'
- Click 'Save'
- Click 'OK' on the confirmation

And what are the type of pop-ups at different steps ? i.e: modal, JS, new
browser
On Tue, Aug 4, 2009 at 5:15 PM, rs77 rishaind...@gmail.com wrote:


 I am new to Watir
 1. I have an HTML page with fields,
 2. When I click Proceed button
 3. I get 2 consecutive alert popups with OK button
 4. after clicking 'OK' on both of them another IE browser window pops
 up
 5. with another alert popup, which I click OK
 6. Click Save button on the newly opened browser window
 7. another confirmation Browser window is opened, which has a form in
 it and OK button,

 and trying to automate clicking the ok buttons using the methods
 described at
 http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

 successfully click OK butto at step 5 only!!!

 Could anybody help with how can i accomplish clicking ok buttons on
 step 4 and step 7?

 Thanks
 RS

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---