Thanks a lot Justin in taking time to write a detailed explanation about 
the issue. Novice automation engineers like me are very blessed to have 
people like you and Titus showing patience to explain basic things to us.

You are right about the issue. Though Im not able to confirm with the devs 
regarding the JS that runs between the click and the alert as you suggested 
the #alert function was able to capture the alert with a sleep after the 
click.

I will user the Watir alert method as its has automatic waiting.

As far as I know there is only a limited no of times alert is even shown 
our our application.

Cheers
Navi

On Thursday, 11 April 2019 12:23:16 UTC+10, NaviHan wrote:
>
> Im trying to capture the alert text and dismiss the alert using the 
> "alert" method
>
>   def test
>     @browser.div(:class => 'address-details', :index =>0).click
>     alert_text = alert do
>       @browser.div(:class => 'select-checkbox', :index =>1).click
>     end
>     sleep 10
>     puts alert_text
>
>
>   end
>
>
> I have passed @browser.div(:class => 'select-checkbox', :index =>1).click  
> into the alert method which actually triggers the alert
>
> As per the implementation this should capture the alert text and click OK
>
> However I'm getting this error
>
> elenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: 
> {Alert text : This address cannot be used.}
>   (Session info: chrome=73.0.3683.86)
>   (Driver info: chromedriver=2.38.552522 
> (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 10.0.17134 
> x86_64)
>
>
> A video of the issue here @ 
> https://drive.google.com/file/d/1Di9idgfqjE7TLSn5QG7pgUFxpln3kben/view?usp=sharing
>

-- 
-- 
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