I know that selenium can use css locators.
I know that the syntax is something like this:
xpath=//div[@id,’topLeft’)//span[contains(@class,’name’)]
or
css=#topLeft .name
Now, what if .name is like this: //span[contains(@class,’name with space’)]
Then it would fail… HOw to look for a locator that has space in it?
Thanks!
EDIT
Solution: css=span.name.with.space
Class names can’t have spaces. However, you can define multiple classes for a single element by putting a space between them. Take a look at the id and class identifiers section in the HTML spec for more.
You should be able to use the CSS locator by using only one of the classes.
If that doesn’t work, double check your CSS selector using a tool like Firefinder for FireBug. I was able use Selenium-IDE with an element that had two classes. For the HTML
I used the selector