How to check if an HTML5 validation was triggered using selenium?

前端 未结 4 1815
执笔经年
执笔经年 2020-12-14 19:43

If testing my webapp using Selenium. All the form validation in the webapp is done using HTML5 form validations. Is there any way to assert if a form/input validation was tr

4条回答
  •  一生所求
    2020-12-14 20:11

    In addition to the answer from @Slanec: add also the following row (using C#, but it should be the same in Java or other languages):

    Assert.IsTrue(true,"",elem1);
    

    This is in case you want to check if the message is visible.

提交回复
热议问题