Have to inspect element 8. When click the element 8 on webpage.It should redirects to next page

<td class="text_overflow-1">
<a targrt="_parent();" href="subscriberall.php?key=138">8</a>

I have tried the following locators


When run the above code in selenium webdriver. What actually happened means, it inspects element 8. But it doesnot clickable to next page

  • What do you mean it doesnot clickable to next page? Do you want to jump to next page? Dec 26, 2015 at 12:19
  • Yes want to jumb to next page. But its not function, when tried the above locators
    – josh test
    Dec 26, 2015 at 12:38
  • Next page- is it in same tab or other- or any other window? Dec 26, 2015 at 12:45
  • When click 8, it redirects to same tab.
    – josh test
    Dec 26, 2015 at 13:33
  • Bit late, but which browser? I have some versions of Internet Explorer seen to not register the first click correctly, this was because of the wrong focus. Clicking twice could help here :) Sep 6, 2016 at 7:28

3 Answers 3


NOTE: You should ask your developers to put in a unique id in the page element so that it will be reusable. The attributes you have now will not suffice.

Usually an element is not clickable if you don't associate your page object to the a tag. So, when your developer adds a unique id into the a tag (let's say id = unique) then this should work.

driver.findElement(By.cssSelector("u a[id='unique']")).click();

There could be a variety of reasons why the above locators do not work. I also noticed a typo in

<a targrt="_parent();"...

It would be very advantageous to check your error log from the IDE/Terminal and copy/paste them so we can get a better idea of what specific issue you are having with the locators. If the element cannot be found that could mean the xpath query you wrote above has a dynamic key=XXX which is very brittle. In this case you may want to change it to

//u/a[contains(@href, 'subscriberall.php?key=')]

You can try following xpath



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.