I want to calculate the total liabilities amount from webtable and need to compare with the total amount which is present on webpage.
I got the following error :
Illegal/unsupported escape sequence near index 1
\L
^
My code is :
{
totalLiabilities = driver.findElement(By.xpath(".//*[contains(text(),'Liabilities :')]")).getText();
logger.info(totalLiabilities);
Pattern patt = Pattern.compile("[-+^:$,a-zA-Z0-9]");
Matcher matchh = patt.matcher(totalLiabilities);
while(matchh.find())
{
String s2 = matchh.group();
System.out.println(s2);
totalLiabilities = totalLiabilities.replaceAll("\\"+s2, "");
}
totalLiabilities=totalLiabilities.replace("Liabilities", "");
logger.info("total liabilities : "+totalLiabilities);
}