When and where to use killalert
Written by: webDOMinator 2 years and 5 months ago
Okay, so many people get confused as to when exactly they need to run the killalert command in their scripts. The killalert command actually fires off the "killalert.exe" program located in your webDOM install directory. The killalert program just waits 2 seconds and then clicks on the "OK" button from a javascript popup by searching for it's window title and then the okay button and sending a windows "click" signal to the OK button. Here's an example of how to use it in a script where you're clicking on something that brings up a javascript alert.
Code
navigateQuick Reference for "navigate"
Click on command to see examples & comments
Browser Level Commands
Usage: navigate:url
Description: Makes the browser navigate to the URL specified.:http://somesite.com/user.profile.php?id=^
wd.curinfoQuick Reference for "wd.curinfo"
Click on command to see examples & comments
WebDOM Program Variables
Description: Returns the value of the currently selected User ID or item from the info list.
killalertQuick Reference for "killalert"
Click on command to see examples & comments
Browser Level Commands
Usage: killalert[:window-title-search:button-search]
Description: Put this command on a line before the command you're using that will popup a javascript alert or confirm box, and it will kill the popup within 2 seconds. To use a standardized killalert just call this by itself. If you need to click a certain button in a certain window, use the window-title-search to match up the first part of the text of the window, and then a button-search to match the text of the button you want to click.
clickQuick Reference for "click"
Click on command to see examples & comments
DOM Level Commands
Usage: click:element
Description: Clicks a DOM element specified by element.:dom.a.Add Friend
In the above case, you're navigating to the user profile page and then two seconds after you click the dom.a.Add Friend button, the javascript alert box that comes up will dissapear and automation will continue.
In some cases, the alert popup might have a non-default window title or button you want to click. The normal title for a javascript alert popup window is "Microsoft Internet Explorer" and the normal button you want to click on is "OK"... let's say you want to click "No" instead.
Code
...
killalertQuick Reference for "killalert"
Click on command to see examples & comments
Browser Level Commands
Usage: killalert[:window-title-search:button-search]
Description: Put this command on a line before the command you're using that will popup a javascript alert or confirm box, and it will kill the popup within 2 seconds. To use a standardized killalert just call this by itself. If you need to click a certain button in a certain window, use the window-title-search to match up the first part of the text of the window, and then a button-search to match the text of the button you want to click.:Microsoft Internet Explorer:No
clickQuick Reference for "click"
Click on command to see examples & comments
DOM Level Commands
Usage: click:element
Description: Clicks a DOM element specified by element.:dom.input.Send
...or let's say you wanted to click on a completely different button in a different window, you could do it as long as you knew the title of the window you're looking for and the button on that window to click.
Code
...
killalertQuick Reference for "killalert"
Click on command to see examples & comments
Browser Level Commands
Usage: killalert[:window-title-search:button-search]
Description: Put this command on a line before the command you're using that will popup a javascript alert or confirm box, and it will kill the popup within 2 seconds. To use a standardized killalert just call this by itself. If you need to click a certain button in a certain window, use the window-title-search to match up the first part of the text of the window, and then a button-search to match the text of the button you want to click.:Microsoft Word:No
shellQuick Reference for "shell"
Click on command to see examples & comments
Filesystem and Shell Commands
Usage: shell:command
Description: Runs a shell command specified by command.:msword
the above would be let's say that if a javascript popup came up when you opened msword, that you had to click no to for instance.