Thank you Titus, but you haven't explained me why inspect method closes the alert? What's the reason?
On Wednesday, March 22, 2017 at 3:21:56 PM UTC-7, Titus Fortner wrote: > > Ah, I see what's going on; it's Browser#inspect when I was thinking > Element#inspect. Yes this is a bug, but thankfully an easy fix. > > https://github.com/watir/watir/pull/543/commits/1ef85710 > > Expect this to be released in 6.2.1 later this week. > > Thanks for reporting it! (and being persistent with answering my questions) > > Titus > > > On Wednesday, March 22, 2017 at 2:54:00 PM UTC-5, Raja gopalan wrote: >> >> I don't understand exactly what you say because it perfectly works with >> the selenium code "driver.switch_to.alert.accept" >> >> I have given the code which I have written below >> b.element(:id, "txtBillAmt").send_keys("231") >> b.element(:id, "rdbCardType_1").click >> b.element(:xpath, "//input[@value='Submit']").click >> b.alert.ok >> b.element(:id, 'btnConfirm').click >> >> >> >> On Tuesday, March 21, 2017 at 2:04:40 PM UTC-7, Titus Fortner wrote: >>> >>> Perfect, yes, so you can see that in between the element click & the >>> check for the alert text, something is making a call to get the current >>> window handle value. That happens every time you locate an element. You >>> aren't allowed to do that when an alert is on the page. (I think the way >>> Firefox is doing this is a bug, but it'll be addressed with the upcoming >>> w3c protocol). >>> >>> What is your code between the element click and the alert click? >>> >>> >>> >>> >>> On Tuesday, March 21, 2017 at 3:43:31 PM UTC-5, Raja gopalan wrote: >>>> >>>> Yes it's not happening in Chrome, it works fine there. >>>> >>>> What you asked >>>> >>>> 2017-03-22 02:11:40 INFO Selenium <- >>>> {"name":"findElement","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":0,"value":{"ELEMENT":"{68df2e11-1d77-4dc7-9001-7020127f56d8}","element-6066-11e4-a52e-4f735466cecf":"{68df2e11-1d77-4dc7-9001-7020127f56d8}"}} >>>> 2017-03-22 02:11:40 INFO Selenium -> POST >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/element/%7B68df2e11-1d77-4dc7-9001-7020127f56d8%7D/click >>>> 2017-03-22 02:11:41 INFO Selenium <- >>>> {"name":"clickElement","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":0,"value":"ok"} >>>> 2017-03-22 02:11:41 INFO Selenium -> POST >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/element >>>> 2017-03-22 02:11:41 INFO Selenium >>> >>>> http://127.0.0.1:7055/hub/session/53db3357-c228-46cd-bae2-ef9a0288856f/element >>>> >>>> | {"using":"xpath","value":"//input[@value='Submit']"} >>>> 2017-03-22 02:11:41 INFO Selenium > {"Accept"=>"application/json", >>>> "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"52"} >>>> 2017-03-22 02:11:41 INFO Selenium <- >>>> {"name":"findElement","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":0,"value":{"ELEMENT":"{4e03dc55-ad4c-4d53-b157-77048f363418}","element-6066-11e4-a52e-4f735466cecf":"{4e03dc55-ad4c-4d53-b157-77048f363418}"}} >>>> 2017-03-22 02:11:41 INFO Selenium -> POST >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/element/%7B4e03dc55-ad4c-4d53-b157-77048f363418%7D/click >>>> 2017-03-22 02:11:41 INFO Selenium <- >>>> {"name":"clickElement","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":0,"value":"The >>>> >>>> Total Amount you are paying is Rs.231. In case you need assistance while >>>> doing Internet transaction or to confirm on your payment please call 080 >>>> 22955400/401."} >>>> 2017-03-22 02:11:41 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/window_handle >>>> 2017-03-22 02:11:41 INFO Selenium <- >>>> {"name":"getCurrentWindowHandle","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":26,"value":{"message":"Unexpected >>>> >>>> modal dialog (text: The Total Amount you are paying is Rs.231. In case you >>>> need assistance while doing Internet transaction or to confirm on your >>>> payment please call 080 >>>> 22955400/401.)","stackTrace":[{"methodName":"fxdriver.modals.closeUnhandledAlert/<","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js >>>> ","lineNumber":10136,"columnNumber":17},{"methodName":"fxdriver.modals.isModalPresent/<","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js >>>> ","lineNumber":10044,"columnNumber":5},{"methodName":"fxdriver.Timer.prototype.runWhenTrue/h","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js >>>> ","lineNumber":631,"columnNumber":70},{"methodName":"fxdriver.Timer.prototype.runWhenTrue","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js >>>> ","lineNumber":633,"columnNumber":3},{"methodName":"fxdriver.modals.isModalPresent","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js >>>> ","lineNumber":10040,"columnNumber":3},{"methodName":"fxdriver.modals.closeUnhandledAlert","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js >>>> ","lineNumber":10125,"columnNumber":3},{"methodName":"nsCommandProcessor.prototype.execute","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js >>>> ","lineNumber":12774,"columnNumber":15},{"methodName":"Dispatcher.executeAs/<","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/driver-component.js >>>> ","lineNumber":9570,"columnNumber":5},{"methodName":"Resource.prototype.handle","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/driver-component.js >>>> ","lineNumber":9717,"columnNumber":255},{"methodName":"Dispatcher.prototype.dispatch","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/driver-component.js >>>> ","lineNumber":9664,"columnNumber":36},{"methodName":"WebDriverServer/<.handle","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/driver-component.js >>>> ","lineNumber":12545,"columnNumber":5},{"methodName":"createHandlerFunc/<","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/httpd.js >>>> ","lineNumber":2054,"columnNumber":41},{"methodName":"ServerHandler.prototype.handleResponse","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/httpd.js >>>> ","lineNumber":2387,"columnNumber":13},{"methodName":"Connection.prototype.process","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/httpd.js >>>> ","lineNumber":1223,"columnNumber":5},{"methodName":"RequestReader.prototype._handleResponse","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/httpd.js >>>> ","lineNumber":1677,"columnNumber":5},{"methodName":"RequestReader.prototype._processBody","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/httpd.js >>>> ","lineNumber":1525,"columnNumber":9},{"methodName":"RequestReader.prototype.onInputStreamReady","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/httpd.js >>>> ","lineNumber":1393,"columnNumber":9},{"methodName":"openModalWindow","fileName":"resource://gre/components/nsPrompter.js","lineNumber":360,"columnNumber":5},{"methodName":"ModalPrompter.prototype.openPrompt","fileName":"resource://gre/components/nsPrompter.js","lineNumber":550,"columnNumber":9},{"methodName":"ModalPrompter.prototype.confirm","fileName":"resource://gre/components/nsPrompter.js","lineNumber":634,"columnNumber":9},{"methodName":"ObservingAlert.prototype.confirm","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/prompt-service.js >>>> ","lineNumber":4808,"columnNumber":10},{"methodName":"validateFieldsAccountNo","fileName":" >>>> https://www.bangaloreone.gov.in/Bescom/BescomBillDtlsByAccountNo.aspx >>>> ","lineNumber":322,"columnNumber":9},{"methodName":"onclick","fileName":" >>>> https://www.bangaloreone.gov.in/Bescom/BescomBillDtlsByAccountNo.aspx >>>> ","lineNumber":1,"columnNumber":19},{"methodName":"SyntheticMouse.EventEmitter.prototype.fireMouseEvent","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/synthetic-mouse.js >>>> ","lineNumber":11412,"columnNumber":30},{"methodName":"bot.Device.prototype.fireMouseEvent","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/synthetic-mouse.js >>>> ","lineNumber":9727,"columnNumber":14},{"methodName":"bot.Mouse.prototype.fireMouseEvent_","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/synthetic-mouse.js >>>> ","lineNumber":10288,"columnNumber":10},{"methodName":"bot.Mouse.prototype.releaseButton","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/synthetic-mouse.js >>>> ","lineNumber":10237,"columnNumber":3},{"methodName":"bot.action.click","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/synthetic-mouse.js >>>> ","lineNumber":10901,"columnNumber":3},{"methodName":"SyntheticMouse.prototype.click","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/synthetic-mouse.js >>>> ","lineNumber":11318,"columnNumber":83},{"methodName":"WebElement.clickElement","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js >>>> ","lineNumber":12109,"columnNumber":99},{"methodName":"DelayedCommand.prototype.executeInternal_/k","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js >>>> ","lineNumber":12704,"columnNumber":16},{"methodName":"DelayedCommand.prototype.executeInternal_","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js >>>> ","lineNumber":12709,"columnNumber":7},{"methodName":"DelayedCommand.prototype.execute/<","fileName":"file:///C:/Users/RAJAGO~1/AppData/Local/Temp/webdriver-profile20170322-3688-iikmru/extensions/ >>>> [email protected]/components/command-processor.js","lineNumber":12651,"columnNumber":5}],"alert":{"text":"The >>>> >>>> Total Amount you are paying is Rs.231. In case you need assistance while >>>> doing Internet transaction or to confirm on your payment please call 080 >>>> 22955400/401."}}} >>>> 2017-03-22 02:11:41 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:11:44 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:11:44 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:11:46 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:11:46 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:11:48 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:11:49 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:11:51 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:11:51 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:11:53 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:11:53 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:11:55 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:11:55 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:11:58 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:11:58 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:12:00 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:12:00 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:12:02 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:12:02 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:12:05 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:12:05 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:12:07 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:12:07 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:12:09 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:12:09 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:12:11 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> 2017-03-22 02:12:11 INFO Selenium -> GET >>>> session/53db3357-c228-46cd-bae2-ef9a0288856f/alert_text >>>> 2017-03-22 02:12:14 INFO Selenium <- >>>> {"name":"getAlertText","sessionId":"53db3357-c228-46cd-bae2-ef9a0288856f","status":27,"value":{"message":"No >>>> >>>> alert is present"}} >>>> This code has slept for the duration of the default timeout waiting for >>>> an Alert to exist. If the test is still passing, consider using >>>> Alert#exists? instead of rescuing UnknownObjectException >>>> C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.2.0/lib/watir/alert.rb:115:in >>>> `rescue in wait_for_exists': unable to locate alert >>>> (Watir::Exception::UnknownObjectException) >>>> from >>>> C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.2.0/lib/watir/alert.rb:106:in >>>> `wait_for_exists' >>>> from >>>> C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.2.0/lib/watir/alert.rb:36:in >>>> `ok' >>>> from >>>> C:/Users/Rajagopalan/RubymineProjects/WatirAndSelenium/First/BillPayment.rb:22:in >>>> >>>> `<top (required)>' >>>> from -e:1:in `load' >>>> from -e:1:in `<main>' >>>> >>>> Process finished with exit code 1 >>>> >>>> >>>> On Tuesday, March 21, 2017 at 1:15:06 PM UTC-7, Titus Fortner wrote: >>>>> >>>>> Does your code work as expected with Chrome? >>>>> >>>>> The legacy Firefox driver will automatically close the alert if >>>>> something raises an `UnhandledAlertError `, and so long as the error >>>>> is rescued your code will timeout the way you describe. I'm not sure why >>>>> the `#inspect` call would cause this. >>>>> >>>>> I'd need to see your output from setting: >>>>> >>>>> `Selenium::WebDriver.logger.level = :info` >>>>> >>>>> >>>>> >>>>> On Tuesday, March 21, 2017 at 2:57:14 PM UTC-5, Raja gopalan wrote: >>>>>> >>>>>> I am using mozilla >>>>>> >>>>>> Version of mozilla is 47.0.2 >>>>>> >>>>>> Using legacy Firefox driver >>>>>> >>>>>> >>>>>> >>>>>> On Mar 22, 2017 1:20 AM, "Titus Fortner" <[email protected]> wrote: >>>>>> >>>>>>> I need to know which browser, browser version & driver version you >>>>>>> are using. >>>>>>> >>>>>>> If you are using the latest version of Watir, you can place this >>>>>>> above the code of concern: `Selenium::WebDriver.logger.level = :info` >>>>>>> and >>>>>>> paste the output. >>>>>>> >>>>>>> Thanks >>>>>>> >>>>>>> On Tuesday, March 21, 2017 at 2:29:59 PM UTC-5, Raja gopalan wrote: >>>>>>>> >>>>>>>> If I remove Inspect from that line it works very fine that means >>>>>>>> that line crosses by leaving alert open so that wait unit passes. >>>>>>>> >>>>>>>> By the way what is the rest of the info? >>>>>>>> >>>>>>>> On Mar 22, 2017 12:56 AM, "Titus Fortner" <[email protected]> >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Interesting. I need the rest of the information I asked for, or a >>>>>>>>> reproducible test case to figure out why this is happening. >>>>>>>>> >>>>>>>>> -- >>>>>>>>> -- >>>>>>>>> Before posting, please read http://watir.com/support. In short: >>>>>>>>> search before you ask, be nice. >>>>>>>>> >>>>>>>>> [email protected] >>>>>>>>> http://groups.google.com/group/watir-general >>>>>>>>> [email protected] >>>>>>>>> <http://groups.google.com/group/[email protected]> >>>>>>>>> >>>>>>>>> --- >>>>>>>>> You received this message because you are subscribed to the Google >>>>>>>>> Groups "Watir General" group. >>>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>>> send an email to [email protected]. >>>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>>> >>>>>>>> -- >>>>>>> -- >>>>>>> Before posting, please read http://watir.com/support. In short: >>>>>>> search before you ask, be nice. >>>>>>> >>>>>>> [email protected] >>>>>>> http://groups.google.com/group/watir-general >>>>>>> [email protected] >>>>>>> >>>>>>> --- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Watir General" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to [email protected]. >>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>> >>>>>> -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
