Skip to content

Commit 9672df4

Browse files
authored
Update WorkingWithBrowserModals.md
1 parent 2066fc0 commit 9672df4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/WorkingWithBrowserModals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public class ExamplePage extends Page implements DetectsLoadCompletion {
8282
}
8383
```
8484

85-
The preceeding example shows how to incorporate **AlertHandler** into a page class that models a page with associated browser modals. Pay attention to the notes in the code comments, as these provide important information to keep in mind when creating your own implementation. To maintain solid synchronization between your automation and the system under test, it's critical to implement the **DetectsLoadCompletion** interface in landing page classes, instances of which are returned by alert methods like **`accept`**. The example above only shows a definition for the **`accept`** function, but you'll need to implement all three of the abstract method declared by **AlertHandler**, even if the page being modeled doesn't require the associated function. For unneeded methods, a simple solution is just to throw **UnsupportedOperationException** with a meaningful message.
85+
The preceeding example shows how to incorporate **AlertHandler** into a page class that models a page with associated browser modals. Pay attention to the notes in the code comments, as these provide important information to keep in mind when creating your own implementation. To maintain solid synchronization between your automation and the system under test, it's crucial to implement the **DetectsLoadCompletion** interface in landing page classes, instances of which are returned by alert methods like **`accept`**. The example above only shows a definition for the **`accept`** function, but you'll need to implement all three of the abstract methods declared by **AlertHandler**, even if the page being modeled doesn't require the associated function. For unneeded methods, a simple solution is just to throw **UnsupportedOperationException** with a meaningful message.
8686

8787
Here are some of the advantages of using **AlertHandler** in your page model classes:
8888
* The **AlertHandler** base class switches the driver to the alert for you, removing this concern from your own implementation.

0 commit comments

Comments
 (0)