4 added 21 characters in body
source | link

Try this Xpath

String text = driver.findElement(By.Xpath("//h1[text()='DefaultBP']"div[@class='row text-center']/following::h1"));
System.Out.Println(text.getText());

Try this Xpath

String text = driver.findElement(By.Xpath("//h1[text()='DefaultBP']"));
System.Out.Println(text.getText());

Try this Xpath

String text = driver.findElement(By.Xpath("//div[@class='row text-center']/following::h1"));
System.Out.Println(text.getText());
3 added 69 characters in body
source | link

Try this Xpath

String text = driver.findElement(By.Xpath("//h1[contains(texth1[text(),'DefaultBP'='DefaultBP']")]);
System.Out.Println(text.getText());

Try this Xpath

//h1[contains(text(),'DefaultBP')].getText();

Try this Xpath

String text = driver.findElement(By.Xpath("//h1[text()='DefaultBP']"));
System.Out.Println(text.getText());
    Post Undeleted by Prasanna venkatesh
    Post Deleted by Prasanna venkatesh
2 added 11 characters in body
source | link

Try this Xpath

//h1[contains(text(),'DefaultBP')].getText();

Try this Xpath

//h1[contains(text(),'DefaultBP')]

Try this Xpath

//h1[contains(text(),'DefaultBP')].getText();
1
source | link