In Selenium, the most common ways of dealing with alerts are: accept () – takes the available alert and accepts it. Dismiss ()—Removes the currently active alarm from the system. Send keys to the alert using send keys (keysToSend). It gets the alert’s text as a string.