I just ran into this myself yesterday and the IDE supplied me with the
correct syntax:
"css=span.ui-icon.ui-icon-closethick"
Here is the HTML for that element:
<span class="ui-icon ui-icon-closethick">close</span>
Hopefully that will give you an example to work from to use Luke's
suggestion.
This is why I like the IDE as a learning tool.
Mike
On Dec 21, 7:29 am, Luke Inman-Semerau <
luke.seme...@gmail.com> wrote:
> That's just kinda how browsers / HTML works. Browsers parse the class attribute on DOM elements to have lookups on the class name separated by spaces. CSS would be significantly more cumbersome without this feature.
>
> If you want to do something generic (I'm failing to grasp why) you could get the class attribute, replace all spaces with "." (add a "." at the beginning) and pass that into the By.cssSelector
>
> -Luke
>
> On Dec 19, 2011, at 8:52 AM, achengs <
ache...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Is it true that you can ask for the class of an element and get a compound result like "prev left browse enabled" but then you can't use this result to search for elements? "Compound class names are not supported. Consider searching for one class name and filtering the results."
>
> > If so, why is that? In general, shouldn't a library be able to take the same kinds of things that it gives out? Otherwise all client code that wants to do something similar has to jump through the same hoop.
> > --
> > You received this message because you are subscribed to the Google Groups "Selenium Users" group.
> > To view this discussion on the web visithttps://
groups.google.com/d/msg/selenium-users/-/LQ7VCgmUFlwJ.