How to check Max Length of text box

In my case, I want to check ‘Limit of 150 characters’ against the textbox field

ok, and what is expected behaviour in case you put more than 150 characters?

When I enter text or more than 150 characters,

Then the form rejects submission shows an error message of “limit of 150 characters” against the field.

and that is exactly what you need to do:
1. setText() to field with text more than 150 characters
2. click on submit button
3. verifyElementExist() with error message
see? you are good!

1 Like

Thanks for your response,

What if text field itself doesn’t allow to enter more than 150 characters without any error message.

Means, how to check max length of the text area without get attribute from value?