From the course: Advanced Selenium: Automation Frameworks

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Testing with Selenide: Assertions

Testing with Selenide: Assertions - Selenium Tutorial

From the course: Advanced Selenium: Automation Frameworks

Start my 1-month free trial

Testing with Selenide: Assertions

- [Presenter] Now that we've got our form filled out, let's go ahead and practice some assertions on it. In the IDE, go ahead and go to the line where we set the name field. Copy just the selector. Make some room at the bottom. And paste our selector. Now, we're going to call this shouldHave method. shouldHave, shouldBe, shouldNot, these are all variations on the should method. They do about the same thing. It's just there for fluent assertions and tags so that your code looks a little bit more linguistic. We're going to go ahead and pass in a condition of value. And then we're going to give that an argument. It needs a string. And we'll go ahead and give it whatever you set for the name in your own code. There is an assertion to check that the name field should have a value of Jane Waldrop. Assertions on text fields are relatively simple and straightforward. They're best handled by Selenide's built-in conditions.…

Contents