This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 11757

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
It's not a secret anymore!