I don't like the way Page Object uses blocks... In Watir it is simply:
alert_text = @browser.alert.text
@browser.alert.dismiss
On Wed, Apr 10, 2019 at 9:23 PM NaviHan wrote:
>
> Im trying to capture the alert text and dismiss the alert using the "alert"
> method
>
> def test
>
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