Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8787073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:47:42+00:00 2026-06-13T21:47:42+00:00

SeleniumHQ says that each driver supports whatever CSS Selectors its browser supports. According to

  • 0

SeleniumHQ says that each driver supports whatever CSS Selectors its browser supports. According to this site, IE 9 should support the :nth-of-type() selector. However, I appear to be getting a NullPointerException from the depths of the RemoteWebDriver class when I execute findElements on this selector. My By.cssSelector looks like this:

table#ucsp_dgMultiSelect tr:nth-of-type(2) input#cbPres

This works fine on Chrome. Maybe IE 9 has a problem with putting that selector in the middle there, I don’t know, but that would break a lot of my code. The :nth-of-type() selector has become my go-to for identifying WebElement locators within a table. Has anyone else had success using the :nth-of-type() selector as a locator with WebDriver and IE 9?

I’m using IEDriverServer.exe.2.25.2.0 and my IE version is 9.0.8112.16421 64-bit

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:47:43+00:00Added an answer on June 13, 2026 at 9:47 pm

    WebDriver does, in fact, support the CSS selectors that the browser does, and if IE9 supports the :nth-of-type() selector, then so should the IE driver. However, that’s not the entirety of the story. If the DOCTYPE in your page is not a modern standard (e.g. <!DOCTYPE html>, IE also tries to guess at how it’s supposed to render the document, and if it guesses that it should be rendering it as a previous IE version, it’ll use the CSS selector engine of that previous version.

    Since you’re using IE9, there’s a very easy way to see if WebDriver should be able to find the element with the selector you’re trying to use. Open the “F12 Developer Tools” by hitting the function key F12 while you’re on the page you’re interested in. Go to the Script tab in the Developer tools, and type

    document.querySelector('table#ucsp_dgMultiSelect tr:nth-of-type(2) input#cbPres')
    

    If the console displays the element information, then WebDriver should be able to find it. If not, then IE can’t find it, and WebDriver never will either.

    This debugging technique will work anytime you’re trying to find an element using CSS selectors in IE9, and is invaluable in helping find out if the problem is IE or if it’s the driver. Additionally, the F12 Developer Tools also will tell you what mode IE is trying to render the page in, which can also be instructive.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On the official Selenium blog ( http://seleniumhq.wordpress.com/ ) it mentions that Maven is no
Selenium provide many kinds of browser driver, so I want to let the user
Using Selenium and the Chrome Driver I do: links = browser.find_elements_by_partial_link_text('##') matches about 160
from selenium import webdriver browser = webdriver.Firefox() So this gives me a browser object
The Selenium Reference documentation says Selenium does NOT support JavaScript alerts that are generated
This is version 1. It is a part of webdriver-selenium project. http://grepcode.com/file/repo1.maven.org/maven2/org.seleniumhq.webdriver/webdriver-selenium/0.9.7376/org/openqa/selenium/WebDriverBackedSelenium.java#WebDriverBackedSelenium This is
Selenium Java Web Driver: How to pass numeric data to a numeric field? For
I'm using selenium with IE 7,8,9 and for some reason, some CSS 3 locators
When I use Selenium 2 code (Java) to open Firefox (or any other browser)
I've got a problem with this class require test/unit require selenium/client class Test <

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.