Issue Details (XML | Word | Printable)

Key: SIDE-331
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Shinya Kasatani
Reporter: Brian Herold
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Selenium IDE

verifyAttribute fails class tests against elements with multiple classes

Created: 23/Jul/09 03:09 PM   Updated: 01/Mar/11 01:18 PM
Component/s: Any
Affects Version/s: 1.0, 1.0.1, 1.0.2
Fix Version/s: None

Environment: Windows XP, Firefox 2.0.12, Selenium 1.0.2


 Description  « Hide

When testing if an element has a particular class, the test "verifyAttribute | myDiv@class | someClass" fails if the element myDiv has multiple classes. Selenium is failing to pull apart the class attribute string into multiple classes and test them each individually.

<div id="myDiv" class="someClass"> PASS

<div id="myDiv" class="otherClass someClass"> FAIL



Sort Order: Ascending order - Click to sort in descending order
Tarek Rached added a comment - 01/Mar/11 01:18 PM

Yeah, this would definitely be nice to have, although verifyAttribute seems to work as intended (the class attribute is indeed the space-separated list of classes)

One potential fix would be to add verifyElementHasClass, as demonstrated here: http://elarson.posterous.com/testing-if-an-element-has-a-class-in-selenium