0

I am trying to set up assertion for unchecked checkbox. Checked assertion works fine when I use:

$this->assertChecked('css=#element', true);

When I want to test unchecked chekbox with

$this->assertChecked('css=#element', false);

I get this error:

Failed command: assertChecked('css=#element', '')
Failed asserting that false is true.

1 Answer 1

2

1.assertChecked ( locator ) - true if the checkbox is checked, false otherwise

2.assertNotChecked ( locator ) - true if the checkbox is unchecked, false otherwise

http://release.seleniumhq.org/selenium-core/1.0.1/reference.html

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. The problem is that I'm not able to use negative case in any of these assertions. Every time I use assertChecked('css=#element', false), I get that error. The same thing is with any of assert methods where we can put true/false parameter
Sorry, this is actually correct answer. There's no second parameter. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.