Quality is delighting customers
To verify toast message by using selenium web driver, most of the software testing services use below approach:
Toast messages is a fast way of telling the user about some action or event. it's a short pop-up message that shows for a short time(for a second) then fade away.
To get the message on toast popup:
Open page source where the toast is shown and find toast element(press f12 and found element value). where you can find id or class name or div which you can select with selenium and get the message on that toast.
so you can use this in the same way as a software company can do.
driver.findElement(By.id("<toast_id>")) or driver.findElement(By.className("<toast_classname>")) to check it's text value in java
If toast is disappeared with in seconds
//Log unable to verify message displayed