-
Notifications
You must be signed in to change notification settings - Fork 2
04. How to read from JSON to Page Factory
Hemanth Sridhar edited this page Sep 15, 2019
·
5 revisions
[
{
"name": "forgottenPasswordLinkInAlert",
"type": "xpath",
"value": "//div[@role='alert']/descendant::a"
},
{
"name": "error_msg",
"type": "xpath",
"value": "//div[@role='alert']"
}
]
- name : name of the locator
- type : type of the locator
- value : value of the locator
@SearchBy(locatorsFile = PageObjectsConfig.ERROR_MSG_PAGE, nameOfTheLocator = "forgottenPasswordLinkInAlert")
private WebElement forgottenPasswordLinkInAlert;
- The locatorsFile value must be the path to the json
- The nameOfTheLocator value must be the same as the one provided in the json. In this case it is forgottenPasswordLinkInAlert