Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3916618

Browse files
committed
orthographic mistake fixed and description added
orthographic mistake fixed for 'interating' an explanation added why to use Page Object pattern.
1 parent ad9781a commit 3916618

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

source/page-objects.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ Page Objects
1414

1515
This chapter is a tutorial introduction to page objects design
1616
pattern. A page object represents an area in the web application user
17-
interface that your test is interating. Page objects reduces the
18-
amount of duplicated code and if the user interface changes, the fix
19-
need only changes in one place.
17+
interface that your test is interacting.
18+
19+
Benefits of using page object pattern:
20+
21+
* Creating reusable code that can be shared across multiple test cases
22+
* Reducing the amount of duplicated code
23+
* If the user interface changes, the fix needs changes in only one place
24+
2025

2126
Test case
2227
~~~~~~~~~
@@ -64,6 +69,8 @@ and ensure some results are found.
6469
Page object classes
6570
~~~~~~~~~~~~~~~~~~~
6671

72+
The page object pattern intends creating an object for each web page. By following this technique a layer of separation between the test code and technical implementsation is created.
73+
6774
The ``page.py`` will look like this::
6875

6976
from element import BasePageElement
@@ -136,6 +143,8 @@ The ``element.py`` will look like this::
136143
Locators
137144
~~~~~~~~
138145

146+
One of the practices is to separate the locator strings from the place where they are being used. In this example, locators of the same page belong to same class.
147+
139148
The ``locators.py`` will look like this::
140149

141150
from selenium.webdriver.common.by import By

0 commit comments

Comments
 (0)