Selenium "assertChecked" and "assertNotChecked" commands with examples
assertChecked, assertNotChecked commands are very useful to check whether the check-box or radio button is selected or not.Let's discuss both the commands in detail
assertChecked:
This command is used to check whether check-box or radio button is checked or not, If the check-box or radio button is not selected it will show an error message in the Log
How to use this command in selenium Ide
1) Provide assertchecked in the command field
2) Provide check-box or radio button element locator(css,xpath, id ,name etc..)
3) Click on the play button
If the radio button or check box is selected execution will be passed, if not execution will be failed and show error message in execution log.
assertNotChecked
This command is opposite to the Assertchecked command, If the check-box or radio button is not selected execution will passed , other wise it will failed and shows error in the execution log.
How to use assertNotChecked command in selenium Ide
1) Provide assertNotchecked in the command field
2) Provide check-box or radio button element locator(css,xpath, id ,name etc..)
3) Click on the play button
No comments:
Post a Comment