Using Selenium to determine whether checkboxes with a specific class are checked

big1234

New Member
I'm using Selenium with PHPUnit to try to tell whether a bunch of checkboxes with a specific class are checked and I'm having a bit of trouble.My code:\[code\]$count = $this->getXpathCount('//form//input[@type="checkbox" and @class="required"]');for ($i = 1; $i <= $count; $i++) { $this->assertTrue($this->isChecked(sprintf('xpath=//form//input[@type="checkbox" and @class="required"][%d]', $i)));}\[/code\]Unfortunately, it doesn't seem like I can use square brackets twice on the same tag, but I do need to make sure all checkboxes that have the class "required" are checked.Any Suggestions?
 
Back
Top