Namespace: webdriverView Sourceclass AlertRepresents a modal dialog such as alert, confirm, or prompt. Provides functions to retrieve the message displayed with the alert, accept or dismiss the alert, and set the response text (in the case of prompt). new Alert(driver, text)Parametersdriverwebdriver.WebDriverThe driver controlling the browser this alert is attached to. textstringThe message text displayed with this alert. Instance Methodsaccept()code »Accepts this alert. Returnswebdriver.promise.Promise<undefined>A promise that will be resolved when this command has completed. dismiss()code »Dismisses this alert. Returnswebdriver.promise.Promise<undefined>A promise that will be resolved when this command has completed. getText()code »Retrieves the message text displayed with this alert. For instance, if the alert were opened with alert("hello"), then this would return "hello". Returnswebdriver.promise.Promise<string>A promise that will be resolved to the text displayed with this alert. sendKeys(text)code »Sets the response text on this alert. This command will return an error if the underlying alert does not support response text (e.g. window.alert and window.confirm). ParameterstextstringThe text to set. Returnswebdriver.promise.Promise<undefined>A promise that will be resolved when this command has completed.