Mod24: DatatDtivenFrameWork- Getting java.lang.AssertionError: null when i try to use verifyText() from the base class in the testscript. | Selenium Forum
V
Viji Medithi Posted on 13/10/2019

Getting java.lang.AssertionError: null when i try to use verifyText() from the base class in the testscript.

could you please help me figure out. thanks in advance

java.lang.AssertionError: null

at org.testng.Assert.fail(Assert.java:94)

at org.testng.Assert.fail(Assert.java:101)

 

_____________________________________________

Method used

public boolean verifyText(String locatorKey, String expTextKey){

String actualTxt = getElement(locatorKey).getText().trim();

System.out.println(actualTxt);

String expText = prop.getProperty(expTextKey);

System.out.println(expText);

if(actualTxt.equals(expText))

------------------------------------------------------------

InConfigProperties.file it is set as below

#text validation

act_yourEmailAddTxt_xpath=//*[text()='Your email address']

exp_yourEmailAddTxt=Your email address


A
Ashish Thakur Replied on 14/10/2019

Did you try debugging the code?

Assertion error comes up whenever your code fails to validate the condition.