Yes. I tried this way too by passing expected error as an argument but later I realized that the data I'm using for validating tests includes only one -ve test and rest all are positive.

It means that UI will throw validation error only in case name exceeds 255 character otherwise user will get success notifications.