You can use the storeAlert command which will fetch the message of the alert pop up and store it in a variable.