@Then("^I should see \"([^\"]*)\" as a paragraph in the bankrate disclaimer$") public void MatchDisclamierValue(String Message) throws Throwable { Thread.sleep(20000); String msg = Message; System.out.println("---------------Function called-----------------------------" + msg); detailPage = new DetailPage(driver); System.out.println( "ConfirmationMessage Assertion: " + detailPage.MatchDisclamierValueText(msg)); Assert.assertTrue( "No Confirmation Message", detailPage.MatchDisclamierValueText(msg).equals(Message)); System.out.println( "Is Confirmation Message Displayed: " + detailPage.MatchDisclamierValueText(msg).equals(Message)); }