Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Selenium2Library and css selector
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David  
View profile  
 More options Nov 5 2012, 8:23 pm
From: David <manga...@gmail.com>
Date: Mon, 5 Nov 2012 17:23:24 -0800 (PST)
Local: Mon, Nov 5 2012 8:23 pm
Subject: Re: Selenium2Library and css selector

Kevin's suggestion is correct, you can use XPath to match by text in an
element. I would highly suggest that route because:

WebDriver has deviated from Selenium RC in what you'd expect for CSS
locator support. It now uses native browser CSS support rather than Sizzle
library and falls back to it only on unsupported browsers (old IE8/9?). If
you want Sizzle, you have to inject it manually for use with WebDriver.
What's the issue with that? Native CSS support excludes the contains()
method, which is not an official CSS spec method. And that's the only way
to match by element text in CSS.

Eliza's suggestion of FirePath is also good. Using FirePath, you can test
out official CSS selectors using the CSS dropdown option for
finding/testing elements. Use the Sizzle drop down for testing unofficial +
official CSS selectors (like contains()). You'll see contains works under
Sizzle but fail under CSS in FirePath.

On Monday, November 5, 2012 1:01:12 PM UTC-8, Kevin O. wrote:

> Learning CSS selectors is on my to do list.
> For you second issue I'm fairly certain you can use XPath.
> Try xpath=//p[contains(text(), 'foobar')]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.