Try increasing the sleep time. When it works through IRB, but not in code, most often than not, the issue is related to timing.
On Nov 30, 3:30 am, Deep <dedeepya.kanipa...@gmail.com> wrote: > Hi, > > I need to clear the checkbox which gives a pop up with OK and Cancel > buttons. Then I have to click on OK button to proceed. > > I have used the following code to clear the check box: > > Object.click_no_wait > Sleep 40 > > To click on OK button on the pop up, code used is > > When /^clicks OK in the pop up box$/i do > sleep 5 > startClicker(browser, "OK", 60) > end > > Have the following method used for startClicker > > def startClicker(browser, button , waitTime = 9, user_input = nil) > # get a handle if one exists > hwnd = browser.enabled_popup(waitTime) > if (hwnd) # yes there is a popup > w = WinClicker.new > if (user_input) > w.setTextValueForFileNameField(hwnd, "#{user_input}") > end > # I put this in to see the text being input it is not > necessary to > work > sleep 3 > # "OK" or whatever the name on the button is > w.clickWindowsButton_hwnd(hwnd, "#{button}") > # > # this is just cleanup > w = nil > end > end > > Ruby Version: 1.8.6_26 > > Issue Description: click_no_wait , clears the check box and throws > popup when tested through IRB. But the same is not working when i run > the automated script. > > Can anyone provide your inputs here. Thanks much. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com