How to click "ok" or "cancel" on a confirm dialog box ?

1,640 views
Skip to first unread message

Sami Fiaz Bari

unread,
Mar 4, 2014, 6:32:11 AM3/4/14
to casp...@googlegroups.com

Hi guys,

I am wondering how can we click "ok" or "cancel" on a confirm dialog box ? I am trying to fill and submit a form that shows a confirm dialog box after clicking on submit button and submits the form if user clicks "Ok". how can I do this with casperjs ?

Thanks,

François Donval

unread,
Mar 13, 2014, 9:22:39 AM3/13/14
to casp...@googlegroups.com
Use casperjs filters :

page.confirm, page.prompt : http://casperjs.readthedocs.org/en/latest/events-filters.html

exemple :

        casper.setFilter('page.confirm', function(message) {
            self.received = message;
            this.echo("message to confirm : " + message);
            return true;
        });
Reply all
Reply to author
Forward
0 new messages