PAGE_NAME
Definition of PAGE_NAME
In the context of web automation scripts, PAGE_NAME
refers to a property file that contains locators for web elements. These locators are used in automation scripts to interact with the corresponding elements on a web page.
Relationship Between PAGE_NAME and ELEMENT_NAME
PAGE_NAME
is the filename of the properties file without the extension. For example,SwagLabs
refers toSwagLabs.properties
.ELEMENT_NAME
is the identifier used within the property file to refer to a specific web element.
Example: SwagLabs.properties File
In the SwagLabs.properties
file, web elements are defined with their respective locators:
Usage in Automation Scripts
In an automation script, you reference PAGE_NAME
and ELEMENT_NAME
to perform actions on those elements. For example:
Notes
When the automation script runs, it looks up the
ELEMENT_NAME
in the correspondingPAGE_NAME.properties
file to find the locator.This modular approach allows for easy maintenance and updates to element locators without changing the automation scripts.
If the given
ELEMENT_NAME
is not present in thePAGE_NAME.properties
then automation throw below exception:
Demo
Last updated
Was this helpful?