Unfortunately, since the browser is entirely allowed to decide whether to show this message at all (e.g. if a tab has never had focus), it might not be something you can really test in an automated fashion. 😔
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.