Java Selenium WebDriver code to implement Verify instead of Assert

前端 未结 3 1141
没有蜡笔的小新
没有蜡笔的小新 2021-01-21 14:03

I am not able to understand how to write Java code to implement Verify. I am always seeing the code to implement Assert but not for Verify

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-21 14:40

    You must use the TestNG framework which only supports Assert statements. It doesn't support Verify statements. You can visit the following URL for TestNG Javadoc:

    http://testng.org/javadocs/

    From http://seleniumonlinetrainingexpert.wordpress.com/2012/11/20/what-is-the-difference-between-assert-and-verify-in-selenium/

    When Assertion fails all test steps after that line of code are skipped When a “verify” fails, the test will continue executing and logging the failure.

    If you want to use Verify statements then you will have to use the Junit framework.

提交回复
热议问题