[wtr-general] Re: Error in handling popup
sir, I used the method you suggested but, it is not working i've to click the popup button manually to go further testing the application. I'm putting the code i'm using for the handling popup below, please suggest me corrections that are to be made require 'Watir' require 'test/unit' require 'watir/dialog' require 'watir/contrib/enabled_popup' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set() ie.text_field(:name, Login1$Password).set() ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.button(:id, ctl00_ContentPlaceHolder1_btnUpload).click #popup def popupchecker(text) sleep 10 Timeout::timeout(2) do if (ie.enabled_popup) wc = WinClicker.new wc.clickWindowsButton(/Windows Internet Explorer/, OK, 30) end end end #Below is the code for operations after the popup disappears if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end On Apr 9, 8:02 pm, Jim Matthews jim_m...@swbell.net wrote: spike, There is a problem with the new version of Ruby that may be contributing to your problem. I don't use autoit, I use method that Lisa described. For more information on the problem, see: http://groups.google.com/group/watir-general/browse_thread/thread/c8e... Jim On Apr 9, 5:09 am, spike vinaykumarl...@gmail.com wrote: sorry to tel u it isnt working, ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click #this is the button when clicked popup appears. # For handling popups def visible? object = document while object begin if object.currentstyle.invoke('visibility') =~ /^hidden$/i return false end if object.currentstyle.invoke('display') =~ /^none$/i return false end if object.invoke('isDisabled') return false end rescue WIN32OLERuntimeError end object = object.parentElement end true end def top_edge assert_exists assert_enabled ole_object.getBoundingClientRect.top.to_i end def top_edge_absolute top_edge + page_container.document.parentWindow.screenTop.to_i end def left_edge assert_exists assert_enabled ole_object.getBoundingClientRect.left.to_i end def left_edge_absolute left_edge + page_container.document.parentWindow.screenLeft.to_i end def mouse_hover(offsetX = 0, offsetY = 0) x = left_edge_absolute + offsetX y = top_edge_absolute + offsetY WindowsInput.move_mouse(x, y) end def mouse_click(offsetX = 0, offsetY = 0) x = left_edge_absolute y = top_edge_absolute WindowsInput.move_mouse(x, y) Watir.autoit.MouseClick(left, x+offsetX, y+offsetY, 1) sleep(2) end def right_click(offsetX = 0, offsetY = 0) x = left_edge_absolute y = top_edge_absolute WindowsInput.move_mouse(x+offsetX, y+offsetY) WindowsInput.right_click end require 'win32ole' def test_check_for_popups autoit = WIN32OLE.new('AutoItx3.control') loop do ret = autoit.WinWait('Windows Internet Explorer', '' ,1) if (ret==1) then autoit.sent('{enter}') end sleep(3) end end #Below is the code for operations after the popup disappears if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public)
[wtr-general] Re: Error in handling popup
Now I got the problem you are facing. I think in your code u would have used click() method just before the code to handle popup. If this is the case , script would not be coming out of click() method and go to next step. This happens in a case when when used click method and if a popup appears after click. please let me know if you have this issue. I have a work arround where in u need to extend your element class. You can ping me at kiranyajaman...@gmail.com if you have any issues with this. Try the following code once: Copy paste this code and use it. Check if its due to timing issue. require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{space}') Regards, Kiran Y On Thu, Apr 9, 2009 at 11:29 AM, spike vinaykumarl...@gmail.com wrote: Sorry sir even it is not working i've to click it manually to go further in my test. wat about this autoit i've installed autoit-v3 how is it related to watir..? On Apr 9, 10:43 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: make sure that ur caption is same (Including caps) and if autoit.Send({'enter'}) is not working try with autoit.Send({'space'}) On Thu, Apr 9, 2009 at 11:10 AM, spike vinaykumarl...@gmail.com wrote: if i'm clicking the OK button manually its going further to do rest of the operations or els its hung with the popup On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1)
[wtr-general] Re: Error in handling popup
sorry to tel u it isnt working, ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click #this is the button when clicked popup appears. # For handling popups def visible? object = document while object begin if object.currentstyle.invoke('visibility') =~ /^hidden$/i return false end if object.currentstyle.invoke('display') =~ /^none$/i return false end if object.invoke('isDisabled') return false end rescue WIN32OLERuntimeError end object = object.parentElement end true end def top_edge assert_exists assert_enabled ole_object.getBoundingClientRect.top.to_i end def top_edge_absolute top_edge + page_container.document.parentWindow.screenTop.to_i end def left_edge assert_exists assert_enabled ole_object.getBoundingClientRect.left.to_i end def left_edge_absolute left_edge + page_container.document.parentWindow.screenLeft.to_i end def mouse_hover(offsetX = 0, offsetY = 0) x = left_edge_absolute + offsetX y = top_edge_absolute + offsetY WindowsInput.move_mouse(x, y) end def mouse_click(offsetX = 0, offsetY = 0) x = left_edge_absolute y = top_edge_absolute WindowsInput.move_mouse(x, y) Watir.autoit.MouseClick(left, x+offsetX, y+offsetY, 1) sleep(2) end def right_click(offsetX = 0, offsetY = 0) x = left_edge_absolute y = top_edge_absolute WindowsInput.move_mouse(x+offsetX, y+offsetY) WindowsInput.right_click end require 'win32ole' def test_check_for_popups autoit = WIN32OLE.new('AutoItx3.control') loop do ret = autoit.WinWait('Windows Internet Explorer', '' ,1) if (ret==1) then autoit.sent('{enter}') end sleep(3) end end #Below is the code for operations after the popup disappears if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end On Apr 9, 12:01 pm, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi Spike, Here is the perfect solution for you problem Copy paste the code present in the attached text file. And insted of using click() method use yourObject.mouse_click(36,6) and remaing code will be same to handle that windows popup using autoit( Which I have posted in last mail). This is the only way u can handle this issue. It will definetly work. If you still have any issue send me the code you have pasted, i will correct it and send you back. Regards, Krian Y On Thu, Apr 9, 2009 at 12:10 PM, spike vinaykumarl...@gmail.com wrote: Yes i've used the click() method. On Apr 9, 11:09 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: Now I got the problem you are facing. I think in your code u would have used click() method just before the code to handle popup. If this is the case , script would not be coming out of click() method and go to next step. This happens in a case when when used click method and if a popup appears after click. please let me know if you have this issue. I have a work arround where in u need to extend your element class. You can ping me at kiranyajaman...@gmail.com if you have any issues with this. Try the following code once: Copy paste this code and use it. Check if its due to timing issue. require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{space}') Regards, Kiran Y On Thu, Apr 9, 2009 at 11:29 AM, spike vinaykumarl...@gmail.com wrote: Sorry sir even it is not working i've to click it manually to go further in my test. wat about this autoit i've installed autoit-v3 how is it related to watir..? On Apr 9, 10:43 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: make sure that ur caption is same (Including caps) and if autoit.Send({'enter'}) is not working try with autoit.Send({'space'}) On Thu, Apr 9, 2009 at 11:10 AM, spike vinaykumarl...@gmail.com wrote: if i'm clicking the OK button manually its going further to do rest of the operations or els its hung with the popup
[wtr-general] Re: Error in handling popup
spike, There is a problem with the new version of Ruby that may be contributing to your problem. I don't use autoit, I use method that Lisa described. For more information on the problem, see: http://groups.google.com/group/watir-general/browse_thread/thread/c8e233ec27bebb85/02a19203ed99e262?lnk=gstq=%3Cpopup#02a19203ed99e262 Jim On Apr 9, 5:09 am, spike vinaykumarl...@gmail.com wrote: sorry to tel u it isnt working, ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click #this is the button when clicked popup appears. # For handling popups def visible? object = document while object begin if object.currentstyle.invoke('visibility') =~ /^hidden$/i return false end if object.currentstyle.invoke('display') =~ /^none$/i return false end if object.invoke('isDisabled') return false end rescue WIN32OLERuntimeError end object = object.parentElement end true end def top_edge assert_exists assert_enabled ole_object.getBoundingClientRect.top.to_i end def top_edge_absolute top_edge + page_container.document.parentWindow.screenTop.to_i end def left_edge assert_exists assert_enabled ole_object.getBoundingClientRect.left.to_i end def left_edge_absolute left_edge + page_container.document.parentWindow.screenLeft.to_i end def mouse_hover(offsetX = 0, offsetY = 0) x = left_edge_absolute + offsetX y = top_edge_absolute + offsetY WindowsInput.move_mouse(x, y) end def mouse_click(offsetX = 0, offsetY = 0) x = left_edge_absolute y = top_edge_absolute WindowsInput.move_mouse(x, y) Watir.autoit.MouseClick(left, x+offsetX, y+offsetY, 1) sleep(2) end def right_click(offsetX = 0, offsetY = 0) x = left_edge_absolute y = top_edge_absolute WindowsInput.move_mouse(x+offsetX, y+offsetY) WindowsInput.right_click end require 'win32ole' def test_check_for_popups autoit = WIN32OLE.new('AutoItx3.control') loop do ret = autoit.WinWait('Windows Internet Explorer', '' ,1) if (ret==1) then autoit.sent('{enter}') end sleep(3) end end #Below is the code for operations after the popup disappears if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end On Apr 9, 12:01 pm, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi Spike, Here is the perfect solution for you problem Copy paste the code present in the attached text file. And insted of using click() method use yourObject.mouse_click(36,6) and remaing code will be same to handle that windows popup using autoit( Which I have posted in last mail). This is the only way u can handle this issue. It will definetly work. If you still have any issue send me the code you have pasted, i will correct it and send you back. Regards, Krian Y On Thu, Apr 9, 2009 at 12:10 PM, spike vinaykumarl...@gmail.com wrote: Yes i've used the click() method. On Apr 9, 11:09 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: Now I got the problem you are facing. I think in your code u would have used click() method just before the code to handle popup. If this is the case , script would not be coming out of click() method and go to next step. This happens in a case when when used click method and if a popup appears after click. please let me know if you have this issue. I have a work arround where in u need to extend your element class. You can ping me at kiranyajaman...@gmail.com if you have any issues with this. Try the following code once: Copy paste this code and use it. Check if its due to timing issue. require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{space}') Regards, Kiran Y On Thu, Apr 9, 2009 at 11:29 AM, spike vinaykumarl...@gmail.com wrote: Sorry sir even it is not working i've to click it manually to go
[wtr-general] Re: Error in handling popup
I many cases, the most important thing to understand when dealing with popups is to know what KIND of popup you are seeing. The tutorial for Watir covers most of the common kinds of popups, and gives some suggestions of potential ways to deal with each of them. Even if you've been through it once, I recommend repeating that section and pay particular attention to the descriptions of the types of popup windows, and try to figure out which type you are faced with. Once you know you are a lot closer to a solution as it allows us to narrow things down a bit and rule out approaches that are known to not work with that kind of popup --~--~-~--~~~---~--~~ 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: Error in handling popup
Since you are able to run the script, after clicking on the button manually, it could be a timing issue. you might want to check that as well. On Thu, Apr 9, 2009 at 2:26 PM, Chuck van der Linden sqa...@gmail.comwrote: I many cases, the most important thing to understand when dealing with popups is to know what KIND of popup you are seeing. The tutorial for Watir covers most of the common kinds of popups, and gives some suggestions of potential ways to deal with each of them. Even if you've been through it once, I recommend repeating that section and pay particular attention to the descriptions of the types of popup windows, and try to figure out which type you are faced with. Once you know you are a lot closer to a solution as it allows us to narrow things down a bit and rule out approaches that are known to not work with that kind of popup --~--~-~--~~~---~--~~ 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: Error in handling popup
I grabbed this code from somebody here...this may work (you'll need to install AutoIt): # Create a file clicker.rb require 'win32ole' begin autoit = WIN32OLE.new('AutoItX3.Control') loop do autoit.ControlClick(Windows Internet Explorer, '', 'OK') autoit.ControlClick(Security Information,'', 'Yes') autoit.ControlClick(Security Alert,'', 'Yes') sleep(5) end rescue Exception = e puts e end # create another file called clicker_process.rb require 'watir' require 'win32/process' @pid = Process.create( :app_name = 'ruby clicker.rb', #assuming you make the above script into a file called clicker.rb :creation_flags = Process::DETACHED_PROCESS ).process_id at_exit{ Process.kill(9,@pid) } # ...and here's your main script (delete.rb) require 'watir' require 'win32/process' require 'clicker_process' $ie = Watir::IE.attach(:title, /Your Website Title/) $ie.link(:text, Delete).click # this will trigger a popup window = This should automatically handle popups. You can also expand the list to include other window title aside from 'Windows Internet Explorer', 'Security Information' and 'Security Alert'. Hope this helps! -George On Apr 8, 5:26 am, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou --~--~-~--~~~---~--~~ 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: Error in handling popup
We seem to do just this. I haven't looked at it in awhile so I'm not sure if this is everything. This is in a module. require 'watir\ie' require 'watir\contrib\enabled_popup' # Main method to click a modal dialog button. def click_modal_button(ie, type='OK', sleep_time=6, timeout=20) hwnd = ie.enabled_popup(sleep_time) if (hwnd) w = WinClicker.new w.clickWindowsButton_hwnd( hwnd, #{type}) w=nil end end On Wed, Apr 8, 2009 at 6:26 AM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou -- Lisa Crispin Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers and Agile Teams_ (Addison-Wesley 2009) http://lisacrispin.com --~--~-~--~~~---~--~~ 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: Error in handling popup
Thanks sir, the error which i was getting was removed but the script does not handle popups, so please suggest me a script for handling popups. On Apr 8, 8:03 pm, Jim Matthews jim_m...@swbell.net wrote: spike, The only thing I see right off is that you have: wsh WIN32OLE.new('Wscript.Shell') My guess is that it should be: wsh = WIN32OLE.new('Wscript.Shell') That would seem to fit with the error you are getting: NoMethodError: undefined method `wsh' for #Manageresources: 0x2b8c4bc Jim On Apr 8, 7:26 am, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Error in handling popup
Hi Thnaks for the reply but it isnt working for me. On Apr 8, 9:24 pm, George george.sand...@gmail.com wrote: I grabbed this code from somebody here...this may work (you'll need to install AutoIt): # Create a file clicker.rb require 'win32ole' begin autoit = WIN32OLE.new('AutoItX3.Control') loop do autoit.ControlClick(Windows Internet Explorer, '', 'OK') autoit.ControlClick(Security Information,'', 'Yes') autoit.ControlClick(Security Alert,'', 'Yes') sleep(5) end rescue Exception = e puts e end # create another file called clicker_process.rb require 'watir' require 'win32/process' @pid = Process.create( :app_name = 'ruby clicker.rb', #assuming you make the above script into a file called clicker.rb :creation_flags = Process::DETACHED_PROCESS ).process_id at_exit{ Process.kill(9,@pid) } # ...and here's your main script (delete.rb) require 'watir' require 'win32/process' require 'clicker_process' $ie = Watir::IE.attach(:title, /Your Website Title/) $ie.link(:text, Delete).click # this will trigger a popup window = This should automatically handle popups. You can also expand the list to include other window title aside from 'Windows Internet Explorer', 'Security Information' and 'Security Alert'. Hope this helps! -George On Apr 8, 5:26 am, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Error in handling popup
hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou --~--~-~--~~~---~--~~ 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: Error in handling popup
Hi thanks for the reply, i've installed autoIT-v3 software but its not working. On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Error in handling popup
I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Error in handling popup
missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Error in handling popup
Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Error in handling popup
You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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,
[wtr-general] Re: Error in handling popup
if i'm clicking the OK button manually its going further to do rest of the operations or els its hung with the popup On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[wtr-general] Re: Error in handling popup
make sure that ur caption is same (Including caps) and if autoit.Send({'enter'}) is not working try with autoit.Send({'space'}) On Thu, Apr 9, 2009 at 11:10 AM, spike vinaykumarl...@gmail.com wrote: if i'm clicking the OK button manually its going further to do rest of the operations or els its hung with the popup On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc
[wtr-general] Re: Error in handling popup
i didnt get u the popup window title is Windows Internet Explorer and the msg displayed in it is File Uploaded Successfully which one should i use inthe code.. On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted
[wtr-general] Re: Error in handling popup
sorry chat is disabled in my company... On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for #Manageresources:0x2b8c4bc manageresource.rb:24:in `test_manage_resources' Please Please please... give a solution to my problem i'm stuck with handling popup from past 2 days.. thankingyou- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the
[wtr-general] Re: Error in handling popup
You should use the caption only. Means Windows Internet Explorer only. Use space than enter On Thu, Apr 9, 2009 at 11:16 AM, spike vinaykumarl...@gmail.com wrote: i didnt get u the popup window title is Windows Internet Explorer and the msg displayed in it is File Uploaded Successfully which one should i use inthe code.. On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but its not working i'm getting the following error. 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `wsh' for
[wtr-general] Re: Error in handling popup
use space i didnt get this..one On Apr 9, 10:48 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You should use the caption only. Means Windows Internet Explorer only. Use space than enter On Thu, Apr 9, 2009 at 11:16 AM, spike vinaykumarl...@gmail.com wrote: i didnt get u the popup window title is Windows Internet Explorer and the msg displayed in it is File Uploaded Successfully which one should i use inthe code.. On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh WIN32OLE.new('Wscript.Shell') wsh.AppActivate('Windows Internet Explorer') wsh.Sendkeys('{ENTER}') but
[wtr-general] Re: Error in handling popup
Sorry sir even it is not working i've to click it manually to go further in my test. wat about this autoit i've installed autoit-v3 how is it related to watir..? On Apr 9, 10:43 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: make sure that ur caption is same (Including caps) and if autoit.Send({'enter'}) is not working try with autoit.Send({'space'}) On Thu, Apr 9, 2009 at 11:10 AM, spike vinaykumarl...@gmail.com wrote: if i'm clicking the OK button manually its going further to do rest of the operations or els its hung with the popup On Apr 9, 10:38 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: You have to give the exact caption of the window which is appearing as popup. In your case that caption of the pop up is FILE UPLOADED SUCCESSFULLY try this code: autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('FILE UPLOADED SUCCESSFULLY', '', 2) autoit.WinActivate('FILE UPLOADED SUCCESSFULLY') autoit.Send('{enter}') if you are online in g-talk you can ping me. Regards, Kiran Y kiranyajaman...@gmail.com On Thu, Apr 9, 2009 at 11:02 AM, spike vinaykumarl...@gmail.com wrote: Ya it still didnt work for me Test Scenario I'm running on windows platform with IE7 I've to upload a file to the application i'm testing. to do that i'm login to the application and navigating to the respective page where i've to upload the file. I'm able to upload the file, upon successfully uploading the fiel a POPUP appears with the msg FILE UPLOADED SUCCESSFULLY and it has a button OK which has to clicked for the popup to disappear. i'm stuck here. the code is not clicking the OK button. following is the script i'm running. require 'Watir' require 'test/unit' class Manageresources Test::Unit::TestCase def test_manage_resources ie = Watir::IE.start http://192.168.25.10:215/; ie.maximize() ie.text_field(:name, Login1$UserName).set(vinay) ie.text_field(:name, Login1$Password).set(welcome) ie.checkbox(:name, Login1$RememberMe).click ie.button(:value, Log In).click ie.link(:href, http://192.168.25.10:215/administrator/ Default.aspx).click ie.link(:href, javascript:__doPostBack ('ctl00$Menu1','Resources')).click ie.link(:href, http://192.168.25.10:215/admin/ ManageResources.aspx).click ie.link(:id, ctl00_ContentPlaceHolder1_lnkAdd).click ie.radio(:id, ctl00_ContentPlaceHolder1_rdCourses_1).click ie.button(:id, ctl00_ContentPlaceHolder1_btnNext).click ie.file_field(:id, ctl00_ContentPlaceHolder1_Uploadfile).set(D:\ \BCSBI.zip) ie.file_field(:id, ctl00_ContentPlaceHolder1_btnUpload).click # For handling popups require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{~}') if ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).isSet? puts IS FEEDBACK option Yes is selected else ie.radio(:id, ctl00_ContentPlaceHolder1_RdlistisFeedback_1).click end ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlAccesstype).set (Public) ie.select_list(:id, ctl00_ContentPlaceHolder1_DdlApprovaltype).set(Admin) end end Please suggest me a solution thankingyou On Apr 9, 9:24 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: missed this piece of code require 'win32ole' still if it wont work just comment out Opt(WinTitleMatchMode, 3) code and try. If still it wont work please send me the scenario u are testing i will try and give u the code. Regards, Kiran Y On Thu, Apr 9, 2009 at 9:26 AM, spike vinaykumarl...@gmail.com wrote: I used this code but i'm getting the following error 1) Error: test_manage_resources(Manageresources): NoMethodError: undefined method `Opt' for #Manageresources:0x2b697c8 manageresource.rb:25:in `test_manage_resources' so please suggest some solution... On Apr 9, 8:40 am, kiran yajamanyam kiranyajaman...@gmail.com wrote: hi, handle the popup window using autoit. install autoit software. and use the followinf code autoit = WIN32OLE.new('AutoItX3.Control') Opt(WinTitleMatchMode, 3) autoit.WinWait('Windows Internet Explorer', '', 2) autoit.WinActivate('Windows Internet Explorer') autoit.Send('{enter}') This will work fine with out any issue Regards, Kiran Y On Wed, Apr 8, 2009 at 5:56 PM, spike vinaykumarl...@gmail.com wrote: Hi I'm woking on windows platform and IE7 using WATIR I've used the following code for handling JavaScript popup require 'win32ole' wsh