Currently, I am utilizing Selenium WebDriver in C# to enhance my knowledge and create automated tests. I recently encountered a particular scenario that has left me puzzled:
Imagine you have a website similar to this one: . When attempting to register without entering any information, a JavaScript alert pops up displaying an error message. My goal is to verify the text of the error message within the alert.
I am unable to utilize driver.FindElement or drive.PageSource as I do not have visibility into the source code. While researching potential solutions, I came across the idea of selecting/changing the frame (Selenium cannot get alert thrown in iframe), but I don't know the frameID. Is there a method to locate and validate the text within the alert?
Your suggestions would be greatly appreciated. Thank you.