File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes If statement for a checkbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "If statement for a checkbox" Watch "If statement for a checkbox" New topic

If statement for a checkbox

Claudiu Barbulescu

Joined: Dec 04, 2012
Posts: 13

I have a checkbox, that by default is not checked. Now, I write the below selenium rc script, but does not work as expected. When the script test the checkbox and this is not checked, I want to be checked in the else statement. Why this does not work?

Thank you!

Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11778

The way I'm reading your code is:

Perhaps you did not mean to have the "not" (!) in the first part of the if statement?

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
I agree. Here's the link:
subject: If statement for a checkbox
jQuery in Action, 3rd edition