Class AlertImpl

  • All Implemented Interfaces:
    Alert, org.openqa.selenium.Alert

    public class AlertImpl
    extends java.lang.Object
    implements Alert
    Manage browser alert.
    • Constructor Summary

      Constructors 
      Constructor Description
      AlertImpl​(org.openqa.selenium.Alert alert)
      Creates a new alert object.
      AlertImpl​(org.openqa.selenium.WebDriver driver)
      Creates a new alert object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept()  
      void dismiss()  
      org.openqa.selenium.Alert getAlert()  
      java.lang.String getText()  
      boolean present()
      Check if this alert is present.
      void prompt​(java.lang.String text)
      Send input to the alert prompt.
      void sendKeys​(java.lang.String keysToSend)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AlertImpl

        public AlertImpl​(org.openqa.selenium.WebDriver driver)
        Creates a new alert object.
        Parameters:
        driver - selenium driver
      • AlertImpl

        public AlertImpl​(org.openqa.selenium.Alert alert)
        Creates a new alert object.
        Parameters:
        alert - selenium alert
    • Method Detail

      • getAlert

        public org.openqa.selenium.Alert getAlert()
      • prompt

        public void prompt​(java.lang.String text)
        Description copied from interface: Alert
        Send input to the alert prompt.
        Specified by:
        prompt in interface Alert
        Parameters:
        text - test to send to the prompt
      • present

        public boolean present()
        Description copied from interface: Alert
        Check if this alert is present.
        Specified by:
        present in interface Alert
        Returns:
        true if alert is present, false otherwise
      • getText

        public java.lang.String getText()
        Specified by:
        getText in interface org.openqa.selenium.Alert
      • accept

        public void accept()
        Specified by:
        accept in interface org.openqa.selenium.Alert
      • sendKeys

        public void sendKeys​(java.lang.String keysToSend)
        Specified by:
        sendKeys in interface org.openqa.selenium.Alert
      • dismiss

        public void dismiss()
        Specified by:
        dismiss in interface org.openqa.selenium.Alert