Basically the script gets a focus on "Place Order" button and clicks it. At 
this point the alert occurs

2018-12-07 10:33:21 INFO Selenium    >>> 
http://127.0.0.1:9515/session/5ee6d653d161aabc0a8fe64ac2c8391f/execute | 
{"script":"return (function(){\n    return 
arguments[0].focus();\n}\n).apply(null, 
arguments)","args":[{"ELEMENT":"0.1093678988911102-26"}]}
2018-12-07 10:33:21 INFO Selenium <- 
{"sessionId":"5ee6d653d161aabc0a8fe64ac2c8391f","status":0,"value":null}
2018-12-07 10:33:21 INFO Selenium -> GET 
session/5ee6d653d161aabc0a8fe64ac2c8391f/element/0.1093678988911102-26/enabled
2018-12-07 10:33:21 INFO Selenium <- 
{"sessionId":"5ee6d653d161aabc0a8fe64ac2c8391f","status":0,"value":true}
2018-12-07 10:33:21 INFO Selenium -> GET 
session/5ee6d653d161aabc0a8fe64ac2c8391f/element/0.1093678988911102-26/enabled
2018-12-07 10:33:21 INFO Selenium <- 
{"sessionId":"5ee6d653d161aabc0a8fe64ac2c8391f","status":0,"value":true}
2018-12-07 10:33:21 INFO Selenium -> POST 
session/5ee6d653d161aabc0a8fe64ac2c8391f/element/0.1093678988911102-26/click
2018-12-07 10:33:24 INFO Selenium <- 
{"sessionId":"5ee6d653d161aabc0a8fe64ac2c8391f","status":0,"value":null}
Time after is 2018-12-07 10:33:24 +1100
2018-12-07 10:33:24 INFO Selenium -> POST 
session/5ee6d653d161aabc0a8fe64ac2c8391f/element
2018-12-07 10:33:24 INFO Selenium    >>> 
http://127.0.0.1:9515/session/5ee6d653d161aabc0a8fe64ac2c8391f/element | 
{"using":"xpath","value":".//*[local-name()='div'][contains(concat(' ', @class, 
' '), ' order-num ')]"}
2018-12-07 10:33:24 INFO Selenium <- 
{"sessionId":"5ee6d653d161aabc0a8fe64ac2c8391f","status":26,"value":{"message":"unexpected
 alert open: {Alert text : Couldn't load credit card!}\n  (Session info: 
chrome=70.0.3538.110)\n  (Driver info: chromedriver=2.41.578737 
(49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 SP1 
x86_64)"}}

Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert 
text : Couldn't load credit card!}
  (Session info: chrome=70.0.3538.110)
  (Driver info: chromedriver=2.41.578737 
(49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 SP1 
x86_64)
./features/support/pages/Frontend/Cotton_On/Thankyou_Page.rb:93:in 
`find_dw_order_number'
./features/step_definitions/Checkout_Page_steps.rb:1449:in `block (2 levels) in 
<top (required)>'
./features/step_definitions/Checkout_Page_steps.rb:1448:in `/^Thankyou page is 
shown with details for the user$/'
./features/Giftcards-AU.feature:269:in `Then Thankyou page is shown with 
details for the user'

Skipped step

Skipped step

Skipped step

Skipped step
2018-12-07 10:33:24 WARN Watir Screenshot Stitch [DEPRECATION] Passing the 
browser is deprecated and will no longer work in version 0.7.0 
/lib/watir-screenshot-stitch.rb:31
2018-12-07 10:33:24 INFO Selenium -> POST 
session/5ee6d653d161aabc0a8fe64ac2c8391f/execute
2018-12-07 10:33:24 INFO Selenium    >>> 
http://127.0.0.1:9515/session/5ee6d653d161aabc0a8fe64ac2c8391f/execute | 
{"script":"return window.innerHeight","args":[]}
2018-12-07 10:33:24 INFO Selenium <- 
{"sessionId":"5ee6d653d161aabc0a8fe64ac2c8391f","status":26,"value":{"message":"unexpected
 alert open: {Alert text : Couldn't load credit card!}\n  (Session info: 
chrome=70.0.3538.110)\n  (Driver info: chromedriver=2.41.578737 
(49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 SP1 
x86_64)"}}

Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert 
text : Couldn't load credit card!}
  (Session info: chrome=70.0.3538.110)
  (Driver info: chromedriver=2.41.578737 
(49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 SP1 
x86_64)
./features/support/hooks.rb:88:in `take_screenshot'
./features/support/hooks.rb:73:in `After'

Scenario Failed !




On Wednesday, 5 December 2018 13:31:56 UTC+11, NaviHan wrote:
>
>  Im having a tough time with this intermittent error I get on checkout 
> page once all the details are filled and customer hits payment button.
>
> Sometimes
> Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {
> Alert text : Bad response - parser error!}
>
>  
>
>   (Session info: chrome=70.0.3538.102) 
>
>   (Driver info: chromedriver=2.41.578737 (
> 49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 
> SP1 x86_64) 
>
> ./features/support/pages/Frontend/Cotton_On/Thankyou_Page.rb:91:in 
> `find_dw_order_number' 
>
>
> ./features/step_definitions/Checkout_Page_steps.rb:1395:in `block (2 
> levels) in <top (required)>' 
>
> ./features/step_definitions/Checkout_Page_steps.rb:1394:in `/^Thankyou 
> page is shown with details for the user$/' 
>
> ./features/Giftcards-AU.feature:233:in `Then Thankyou page is shown with 
> details for the user'
>
>  
>
> Sometimes
>
> Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {
> Alert text : Couldn't load credit card!}
>
>  
>
>   (Session info: chrome=70.0.3538.102) 
>
>   (Driver info: chromedriver=2.41.578737 
> (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 SP1 
> x86_64)
>
>
>  
>
> In order for the dev to have a look I need to give them the browser 
> console logs at the point of failure. What happens is that some times I get 
> the error on "wait_for_ajax" and some time on "wait_and_click" method. The 
> test exits abruptly with the errors above and no screenshots ate taken
>
> Is there a way I can get the browser console logs at this point?
>
>
>
> def place_order
>  wait_for_ajax
>  wait_and_click place_order_btn_element
> end
>
>
> def wait_and_click element
>  begin
>  retries ||= 0
>  Watir::Wait.until {element}.focus
>  Watir::Wait.until {element}.click
>  rescue Selenium::WebDriver::Error::UnknownError
>  retry if (retries += 1) < $code_retry
>  rescue Watir::Exception::UnknownObjectException
>  retry if (retries += 1) < $code_retry
>  end
> end
>
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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.

Reply via email to