Clicking 'OK' on alert or confirm dialog through jquery/javascript? -


i thinking of writing ui tests in backbone.js , jquery. may not best way it's thinking - automate tests without record , playback - through plain code.

the thing made me scratch head using approach this: in 'use-case flow' (of execution) confirm/alert dialogs show up. i'd click 'ok' , continue flow - doable through plain javascript code? how?

note: know gui testing libraries exist, want know how using jquery/javascript code, if @ possible.

as far know if use standard alert() call cannot trigger "ok" click because alert call blocks normal js event loop.

however should able replace window.alert , window.confirm own function nothing:

window.alert = function() {     console.log.apply(console, arguments); }; 

place these @ top of js before else loaded , subsequent calls alert() or confirm() call these instead.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -