I'm currently dealing with a registration page where I encountered an issue.
During my testing phase, I attempted to register without inputting a first name. Upon clicking the register button, I expected to see a 'Required' notification label.
The structure of the page can be viewed in the screenshot provided.
I tried different methods such as xpath and id to locate the text from the element with id 'firstName'
, but it seems like all attempts were unsuccessful.
Here is my latest approach:
String test = driver.findElement(By.id("'firstName'/descendant::td[@class='alert alert-danger']")).getText();`
Can anyone help point out what I might be overlooking?