Compare 2 different strings | Selenium Forum
D
divya Posted on 21/02/2020

I have 2 same columns as 'Status'

and Header status has value with 'COMPLETE' 

and child row Status column has 'PROCESSED' value

 

i took these 2 xpaths and trying to assertEquals(actual,expected)

since the 2 column values are different am getting assertion failure

Please suggest what asserrtion i can use in this case, and should i just wirte simple log.ware(".....");

 


A
Ashish Thakur Replied on 24/02/2020

if you just want to compare, then use the below code

actual.equals(expected)

This with either return true or false accordingly.

Assert is used to fail the testcase in case the data doesnt match.