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!

Capture the text displayed in a JS alert

Status
Not open for further replies.

canberrasnag

Programmer
Nov 25, 2004
19
RU
I need to capture the text displayed in a JS alert.
I am trying to automate the testing of some web pages and when the automation script enters invalid characters and clicks submit (still to be worked out), an alert pops up.
I need to capture the text in that alert and chack it agains the original customer agreed text which is loaded from a text file.

I am still trying to work out how to locate the alert window that pops up :(

Thanks
 
Hello canberrasnag,

If you're automating navigating and loading html pages, to get to JS alert message or VBS msgbox message alike, you have to parse the page. Once, those user interactives are triggered, it would be too late to get to them in script. The observations are the same as I have expressed in your other thread.

regards - tsuji
 
I have found a solution :(
the company I work for has written some modules.
launch thread and findwindowobject
now, I launch the thread, click the submit button then the thread finds the alert and closes it.

pity I couldn't do it all with vbscript :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top