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

  • SEARCH
  • Home
  • 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 5946959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:53:48+00:00 2026-05-22T16:53:48+00:00

I am trying to click on a link using webdriver but it throws me

  • 0

I am trying to click on a link using webdriver but it throws me a ElementNotVisibleException saying “Element is not currently visible and so may not be interacted with”

My WebDriver code:

addProgram.click();

addProgram refers to an anchor element. This is populated by annotating @FindBy(how= How.LINK_TEXT, using=”Add Program”). In other words it is similar to driver.findElement(By.linkText(“Add Program”)).

My HTML is:

<div class="form_btn">
<a href="/program/addProgram">   
<span>Addrogram</span
</a>
</div>

It starts working when I remove the css declaration from the above div. The dive has a hover style, may be that is the one causing the problem.

CSS:

.form_btn { 
    float:left; 
background:url(/bg_button_right.gif) no-repeat scroll top     
    right; 
color: #fff; 
display: block; 
height:22px; 
font: bold 10px arial; 
margin-right: 0px; 
margin-top:2px; 
padding-right: 4px; /* sliding doors padding */ 
text-decoration: none; 
}

.form_btn span { 
background:url(/assets/images/provider/bg_button_left.gif) no-repeat; 
display: block; 
float:left; 
line-height:18px; 
padding: 2px 5px 5px 10px; 
font-size:11px; 
}

.form_btn a{ 
color:#fff;
}

.form_btn a:hover{ 
color:#fff; 
text-decoration:none; 
cursor:hand;
}

I have trawled the web trying to find a solution but none has worked. Any suggestions/help is greatly appreciated.

Thanks,
Chris.

  • 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-22T16:53:49+00:00Added an answer on May 22, 2026 at 4:53 pm

    (UPDATE) This issue was resolved and should be available since Selenium 2.4.0

    Sounds like you ran into the same bug as I did:

    http://code.google.com/p/selenium/issues/detail?id=1445

    the work-around is to get the element inside the link and click.

    re-writing your code:

    driver.findElement(By.linkText("Add Program")).findElementBy(By.tagName("span"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to click a link using this line: webBrowser1.Document.GetElementsByTagName(a)[i].InvokeMember(click); But when the element
I'm trying to click on a link using jquery. There only appears to be
I'm trying to delete using the delete action. But whenever I go click the
When I am trying to click on the Link using below line of code
I have a link ('a' tag). I'm trying to click it using JavaScript. While
I'm trying to load some stuff using AJAX when a user clicks a link,
I'm trying to make the case for click-once and smart client development but my
I'm trying to change a Button's Click property/event when a DataTrigger is triggered but
I've been trying to parse this feed . If you click on that link,
I'm trying to add an iframe using jquery this way below, but when I

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.