0

Is there something wrong with this code ?

region = Select(driver.find_element_by_id('x_place_occ_reg'))
region.select_by_visible_text(varRegion)

Whenever I run the code, it shows the following error.

Message: Element is not clickable at point (380.5,333) because another element obscures it

I'm hoping that someone who can point out the error, by the way thank you in advance.

eikenn
  • 9
  • 3
  • I fear that without more information it's impossible to answer the question. – Francesco Montesano Apr 27 '18 at 07:32
  • Possible duplicate of [Element MyElement is not clickable at point (x, y)... Other element would receive the click](https://stackoverflow.com/questions/44724185/element-myelement-is-not-clickable-at-point-x-y-other-element-would-receiv) – undetected Selenium Apr 27 '18 at 07:32

1 Answers1

0

I think y code is wrong because, y select twice the element. Try this:

from selenium import webdriver
b = webdriver.Firefox()
b.find_element_by_xpath("//select[@name='element_name']/option[text()='option_text']").click()

OR

from selenium import webdriver
from selenium.webdriver.support.ui import Select

driver = webdriver.Firefox()
driver.get('url')

select = Select(driver.find_element_by_id('fruits01'))

# select by visible text
select.select_by_visible_text('Banana')

# select by value 
select.select_by_value('1')