Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Being killed by Alert(); !!!

Status
Not open for further replies.

davem99

Programmer
May 19, 2003
74
US
I have a VB application that hosts an IE Browser. My app connects to a website and automates a mundane task by filling in text boxes, clicking buttons etc..etc...

My problem is that on one part of this site, my app clicks a search button and then site brings up an alert saying
"x records found"

This stops my app because I need to manually click OK.

Any ideas how I might get around this ?

thanks!!
 

This is more of a VB forum question I think.

You'd probably need to find out if the OS fires an event when a modal dialog is shown, and it it is, auto-click the "ok" button.

I know this can be done, as many years ago, I had some software that auto-centered the mouse cursor on a dialog's OK button when it appeared.

Hope this helps!

Dan
 
Thanks BillyRay!

The VB forum said it was a Java thing! :)

I'm sure Windows does and I'm sure an app that finds the window with the modal dialog and clicks it is possible but that seems like a lot of work!

I wanted to see if there was any way in which I could somehow hook into the script or the event within the document object model.

 
Change the document.location to the following will prevent any alert from happening.

javascript:function alert(){};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top