Package io.fluentlenium.core.alert
Class AlertImpl
java.lang.Object
io.fluentlenium.core.alert.AlertImpl
- All Implemented Interfaces:
Alert,org.openqa.selenium.Alert
Manages a browser alert.
Wraps a Selenium Alert instance but an instance of this type
is created successfully only when there is an actual alert present.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
AlertImpl
public AlertImpl(org.openqa.selenium.WebDriver driver) Creates a new alert object.Uses the underlying Alert object from the provided driver instance.
If there is no alert present in the provided driver, it throws an
NoAlertPresentExceptionand the instantiation is interrupted.- Parameters:
driver- selenium driver
-
AlertImpl
public AlertImpl(org.openqa.selenium.Alert alert) Creates a new alert object using the provided Alert instance.- Parameters:
alert- selenium alert
-
-
Method Details
-
getAlert
public org.openqa.selenium.Alert getAlert() -
prompt
Description copied from interface:AlertSend input to the alert prompt. -
present
public boolean present()Check if this alert is present.The return value is hardcoded to true, since this object is instantiated successfully only when there is an alert present.
-
getText
- Specified by:
getTextin interfaceorg.openqa.selenium.Alert
-
accept
public void accept()- Specified by:
acceptin interfaceorg.openqa.selenium.Alert
-
sendKeys
- Specified by:
sendKeysin interfaceorg.openqa.selenium.Alert
-
dismiss
public void dismiss()- Specified by:
dismissin interfaceorg.openqa.selenium.Alert
-