Selenium Exception Element is not visible

0 votes

My task is to write a parser for clicking a button on a website. There are a lot of buttons, but my problem is only clicking on one of them. The source htmlcan be found here: http://pastebin.com/XhsedGLb

And my python code is:

 driver = webdriver.Firefox()  
 ...
 el = driver.find_element_by_id("-spel-nba")
 actions.move_to_element(el)
 actions.sleep(.1)
 actions.click()
 actions.perform()

The error I get is this:

ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with

According to Saifur, I just tried waits with the same element not visible exception:

wait = WebDriverWait(driver, 10)
wait.until(EC.presence_of_element_located((By.XPATH, "//input[contains(@id,'spsel')][@value='nba']"))).click()
May 7, 2018 in Selenium by eLiJha
• 770 points
7,246 views

1 answer to this question.

0 votes

Finding the element before locating the one with the issue solved it for me (that is, just before it in terms of tab order). After that, calling Tab on that element also helped.

from selenium.webdriver.common.keys import Keys
elem = br.find_element_by_name("username")
elem.send_keys(Keys.TAB) # tab over to not-visible element

After that, I could perform any actions on that element.

answered May 7, 2018 by king_kenny
• 3,710 points

Related Questions In Selenium

0 votes
2 answers

Check that the element is clickable or not in Selenium WebDriver

Hi , you want to know only is ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
34,205 views
0 votes
1 answer

Selenium-Debugging Error: Element is not clickable at point (X,Y)

Another element is covering the element you ...READ MORE

answered Jul 2, 2018 in Selenium by Samarpit
• 5,910 points
8,947 views
0 votes
0 answers

How to hover element when action class is not working in my Selenium framework ?

When i am writing the code to ...READ MORE

Feb 16, 2019 in Selenium by Raishul
3,931 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,686 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,149 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,228 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,880 views
+1 vote
2 answers
0 votes
1 answer

Selenium Alternatives: Is there a tool like Selenium for testing web pages but which does not involve coding.

I'm guessing you've tried Selenium IDE already. ...READ MORE

answered Apr 13, 2018 in Selenium by king_kenny
• 3,710 points
791 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP