Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What to use instead of CONTAINS() in CSS3

Question about automation. I use Selenium RC.

I upgraded my FF to 3.6.18 and it seems that it can't find any locators which have "contains()" inside

I've read alot of forums. It's a known problem, but I did not find any solution.

So what to use instead of contains() now?

like image 907
Pasha Avatar asked Jul 11 '11 09:07

Pasha


People also ask

Can I use contains in CSS?

A custom built CSS selector for more advanced users can be built using the "contains" selector. The "contains" selector is useful in cases where we are looking for an element that "contains" some text (case sensitive).

Can we use text () in CSS selector?

For locating elements by using their text contents, CSS selectors and XPath provide methods to find text within the elements. If an element contains specific text, this will return the element back to the test.

How do you exclude tags in CSS?

In CSS, to exclude a particular class, we can use the pseudo-class :not selector also known as negation pseudo-class or not selector. This selector is used to set the style to every element that is not the specified by given selector.

How do you check text in CSS?

The inner texts are the string patterns that the HTML tag manifests on the web page. ':' is used to symbolize contains method. Click on the "Find target in page" button to check whether the defined CSS Selector locates the desired element or not.


1 Answers

The only functionality in CSS which is similar to contains() is:

element[attribute*="substring"]

It is helpful when you need to check some substring which contains in the attribute.

like image 72
Iaroslav Karandashev Avatar answered Oct 16 '22 04:10

Iaroslav Karandashev