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 6011265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:14:07+00:00 2026-05-23T02:14:07+00:00

using an expression like (//div[@class=’nav’]//a)[5] to retrieve a specific element with Selenium (triggered through

  • 0

using an expression like (//div[@class='nav']//a)[5] to retrieve a specific element with Selenium (triggered through phpunit) never suceeds for some reason.

The Xpath is valid, using other Xpath expressions works fine, but once the Xpath contains brakets the Selenium server (2.0rc2) starts returning ERROR: Element (//div[@class='nav']//a)[5] not found. even it that element is present.

Is this a limitation of the PHP-Webdriver for Selenium, is there some kind of workaround (to get the nth element within a node-set)?

Cheers

  • 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-05-23T02:14:08+00:00Added an answer on May 23, 2026 at 2:14 am

    This was the final solution:
    xpath=(//div[@class=’nav’]//a)[position()=5]

    Not sure why [5] didn’t work, might still be an issue within phpunit

    Cheers

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

Sidebar

Related Questions

I'm using .NET Regular Expressions to strip HTML code. Using something like: <title>(?<Title>[\w\W]+?)</title>[\w\W]+?<div class=article>(?<Text>[\w\W]+?)</div>
I would like to animate a ScatterView Control using Expression Blend However, it seems
I'd like to use a DataGridViewRowCollection in a LINQ expression using extension methods and
I would like to extract portion of a text using a regular expression. So
I have a JavaScript string containing HTML like this: <div> <div class=a> content1 </div>
i put the format of a textbox using expression like Format(Fields!name.Value, dd/MM/yyyy) can i
I would like to generate the following select statement dynamically using expression trees: var
There are known Style Attribute XSS attacks like: <DIV STYLE=width: expression(alert('XSS'));> Or <DIV STYLE=background-image:
I have a javascript string contains html table like this: <div class=nobrtable><table class=at><TBODY><TR><td> FY
I'd like to use regular expressions in selecting elements using the match function. I'd

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.