I look to use css first and for the elements and attributes I try to be as specific as needed without being overly specific and tying myself into page structure. In this case I would consider using:
success_message=driver.findElement(By.css(".content-wrapper .callout-success"))
along with
success_message.contains('the text')
This assumes that you don't have access to change the HTML source.
If you do have that access I recommend you add semantic markup. Currently the page markup is mostly about the placement and appearance, e.g. content-wrapper
and main-sidebar
. These things will change over time (both in their usage and names) so I would look to add attributes about the mean of the content, e.g. a div#institutions
tag and a div.feedback_message
tag within it. Also tag the 'deleted' message itself so you aren't asserting the specific text which may change or be in another language.
Then you can do a find and assert that looks like:
Assert.assertTrue(driver.findElement(By.css(".institutions .feedback .deleted")
and you can see how readable that is - essentially " institutions feedback 'deleted' " exists, with no need for additional comments and robust against changes in both the future page layout and also the text used.