mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 10:58:42 +00:00
docs: update page object
This commit is contained in:
+2
-10
@@ -44,10 +44,6 @@ The Page Object design pattern is a popular design pattern in test automation. I
|
||||
Let's consider a simple programmatic example of the Page Object pattern for a login page using Selenium in Java:
|
||||
|
||||
```java
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
public class LoginPage {
|
||||
private final WebDriver driver;
|
||||
|
||||
@@ -85,10 +81,6 @@ In this example, the `LoginPage` class represents the login page of a web applic
|
||||
|
||||
This Page Object can be used in test scripts to interact with the login page without exposing the details of the page structure in the test code, promoting maintainability and reusability.
|
||||
|
||||
## Class diagram
|
||||
|
||||

|
||||
|
||||
## Applicability
|
||||
|
||||
Use the Page Object pattern when
|
||||
@@ -129,5 +121,5 @@ Trade-offs:
|
||||
* [Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation](https://amzn.to/4bjhTSK)
|
||||
* [Selenium Design Patterns and Best Practices](https://amzn.to/4aofYv8)
|
||||
* [Selenium Testing Tools Cookbook](https://amzn.to/3K1QxEN)
|
||||
* [Page Object - Martin Fowler](http://martinfowler.com/bliki/PageObject.html)
|
||||
* [Page Objects - Selenium](https://github.com/SeleniumHQ/selenium/wiki/PageObjects)
|
||||
* [Page Object (Martin Fowler)](http://martinfowler.com/bliki/PageObject.html)
|
||||
* [Page Objects (Selenium)](https://github.com/SeleniumHQ/selenium/wiki/PageObjects)
|
||||
|
||||
Reference in New Issue
Block a user