519595285 by Unknown
Author:Unknown
Language: eng
Format: epub
5.7 Verification of text on a page using the Assert class
In the code listing of section we have invoked the verifyUser(String) method from the Homepage Page Object. This Page Object had made use of the assertEquals method from the Assert class. This method is provided the following arguments: an actual string and an expected string. The actual string is the text extracted from the WebElement named userDisplay and this string is extracted using the following code snippet:
SingletonDriver.getInstance().getDrvr().findElement(userDisplay).getText()
The Expected string value is taken from the Feature file. The line from the Feature file shown as follows provides this value.
Then, the User should be shown on top-left hand corner of the page.
If we change the string in the preceding line to âPinakin Chaubal1â, the test now fails with an Assertion error shown as follows:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Twisted Games: A Forbidden Royal Bodyguard Romance by Ana Huang(3945)
Den of Vipers by K.A Knight(2678)
The Push by Ashley Audrain(2664)
Win by Harlan Coben(2636)
Echo by Seven Rue(2214)
Beautiful World, Where Are You: A Novel by Sally Rooney(2134)
Baby Bird by Seven Rue(2094)
Iron Widow by Xiran Jay Zhao(2087)
Leave the World Behind by Rumaan Alam(2079)
A Little Life: A Novel by Hanya Yanagihara(2034)
Midnight Mass by Sierra Simone(1982)
Undercover Threat by Sharon Dunn(1768)
Bridgertons 2.5: The Viscount Who Loved Me [Epilogue] by Julia Quinn(1754)
The Four Winds by Hannah Kristin(1746)
Sister Fidelma 07 - The Monk Who Vanished by Peter Tremayne(1635)
The Warrior's Princess Prize by Carol Townend(1616)
Snowflakes by Ruth Ware(1575)
Dark Deception by Rina Kent(1536)
Facing the Mountain by Daniel James Brown(1531)