I need to be able to complete a vbscript msgbox using javascript. The problem is that we are using selenium to test a classic asp website. Our goal is to slowly get rid of the vbscript code that is part of that website but in the interim we still need to test that code.
We would like to run multiple tests through multiple computers and so we need an automated way of completing the vbscript msgboxes that exist on the website using javascript. This is because as far as I could tell Selenium doesn’t support vbscript interaction but it does have a way of injecting javascript into the page at run time.
So I would like to find the modal vbscript dialog and click ok or cancel programmatically.
I have seen that someone used a solution of tabbing to the appropriate button and clicking enter … and making that a recording. But any actual key strokes seem to interfere with the possibility doing the distributed testing, running multiple tests on multiple computers … or stress testing.
Does anyone have any possible ideas on how I can interact with vbscript msgboxes through javascript or jquery?
Thanks,
[edit] – Hey … perhaps I should be asking is a vbscript msgbox part of the dom? Can I manipulate it by using the dom in javascript? Perhaps there is some way to click ok or set the return value and destroy the dialog box?
I had answered a similar question a few days back. If you are using selenium 1.0 then perhaps you can use the JS version from the answer or alternatively, you could try some of the confirmation handling provided by selenium itself, something along the lines below,