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?
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).
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With