Validating a test with assert and verify
In the last few steps, we were able to record a workflow that we would expect the user to perform. It will test that the relevant bit of functionality is there, such as buttons and links to work against. Unfortunately, we are not checking whether the other items on the page are there or if they are visible when they should be hidden. We will now work against the same page as before, but we shall make sure that different items are on the page.
There are two mechanisms for validating elements available on the application under test. The first is assert: this allows the test to check whether the element is on the page. If it is not available, then the test will stop on the step that failed. The second is
Get Learning Selenium Testing Tools - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.