1

enter image description here

I try to click on plus by xpath. But this plus becomes visible after the mouse cursor on it and my code can't click on this.

driver.find_element_by_xpath('/html/body/div[3]/div/div[5]/div[3]/div[12]/div[2]/div[2]/div[1]/div/div/div/div/div[2]/div/div/div[3]').click()

Is there any way in selenium webdriver to click on invisible elements

Algar Alg
  • 123
  • 1
  • 2
  • 10

2 Answers2

1

Hi please do it like below (code sample)

https://selenium.googlecode.com/git/docs/api/py/webdriver/selenium.webdriver.common.action_chains.html

menu = driver.find_element_by_css_selector("")
hidden_submenu = driver.find_element_by_css_selector("")
ActionChains(driver).move_to_element(menu).click(hidden_submenu).perform() 
Rajnish Kumar
  • 2,828
  • 5
  • 25
  • 39
0

You can click via javascript:

driver.execute_script("arguments[0].click();", element)

Though, I would use "Action Chains" to perform the mouse over + click.

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195