Text Field not recognized when its dom contains regular expression

24 views
Skip to first unread message

Muthuraja Ramakrishnan

unread,
Sep 20, 2017, 10:14:25 AM9/20/17
to Selenium Users
Hello Team,

I have been experiencing the following problem when trying to automate Angular JS 4 application using Selenium webdriver latest version.

Note: I know protractor is the tool recommended for Angular JS application but we already  made good progress on Angular JS using selenium except below issues.

The below dom structure is for name field which contains pattern attribute and its value is regular expression:

input id="tagName" class="form-control ng-pristine ng-invalid ng-touched" _ngcontent-c20="" name="tagName" required="" pattern="^[^\s\/\\]+([\s]+[^\s\/\\]+)*$" type="text"

Issue:
While running automation in selenium, it does populate value in above said name field and when automation trying to click save button, the error message return "name is mandatory", Although I see automation feed some value  in the field, but technically angular js application doesn't recognize and return error message stating nothing is entered.

I tried with JavaScript executor but still no luck. Does anyone come across this issue? Please advise!

This issue can be reproduced in all browsers versions and from selenium version 3 and above, didn't check selenium 2.x versions

Thanks,

Muthu


Reply all
Reply to author
Forward
0 new messages