Display results as :
Advanced Search

Go down
Regular Participant
Regular Participant
Posts : 33
Join date : 2009-08-21

css with regexp Empty css with regexp

on Mon Aug 24, 2009 7:38 pm
I want to know the presence of a span tag element.

For Example,
[<]span class="cpCurrentMonthDateDisabled"[>]23[<]/span[>]

(Pls, ignore square brackets in above stmt Embarassed )

But I don't know exact class(css) name, I know just few letters of class name, let's say Disable, How to exec assertElementPresent command?

The below is not working

assertElementPresent | //span[@class='regexp:*Disable*'] | 23.

How to do?
Posts : 387
Join date : 2009-07-30
Location : India

css with regexp Empty Re: css with regexp

on Tue Aug 25, 2009 11:10 am
To use css in selenium , it is a actual way

Select the element using css selectors. Please refer to CSS2 selectors, CSS3 selectors
for more information. You can also check the TestCssLocators test in
the selenium test suite for an example of usage, which is included in
the downloaded selenium core package.

  • css=a[href="#id3"]
  • css=span#firstChild + span

Currently the css selector locator supports all css1, css2 and css3
selectors except namespace in css3, some pseudo classes(:nth-of-type,
:nth-last-of-type, :first-of-type, :last-of-type, :only-of-type,
:visited, :hover, :active, :focus, :indeterminate) and pseudo
elements(::first-line, ::first-letter, ::selection, ::before, ::after).

For more details, read this link:

Hope this will help you, best of luck.

Back to top
Permissions in this forum:
You cannot reply to topics in this forum