1

I'm having issues clicking on a button It returns the following error message for me:

selenium.common.exceptions.WebDriverException: Message: unknown error: Element ... is not clickable at point (1030, 883). Other element would receive the click: (Session info: chrome=70.0.3538.77) (Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 6.1.7601 SP1 x86_64)

Here is the HTML:

<a submit="#invoice_form" id="calculate_button" data-type="json" class="rollover button" data-remote="true" rel="nofollow" data-method="post" href="/invoices/40736/calculate" data-disable-on-click="true"><span>Calculate</span></a>

I'm trying to automate the form and all fields have been filled out, when come to calculate I get that message.

Below is my code:

driver.find_element_by_id("calculate_button").click()
natn2323
  • 1,983
  • 1
  • 13
  • 30
usermt
  • 31
  • 4
  • The error means that some other element is blocking your element from being clicked, e.g. an overlay may be appearing on top of your element, effectively blocking it from being clicked. – natn2323 Nov 14 '18 at 01:51
  • Thank you for that, gave me the direction i needed to go. – usermt Nov 14 '18 at 03:39
  • Probability your intended element covered by some other element and that is accepting click instead of actual one. You can perform scroll on your expected element and then click or if other element is spinner or loader then use explicit wait until that element get invisible and then perform click on expected one – NarendraR Nov 14 '18 at 05:04

3 Answers3

1

Figure it out and is now working. Here is the code I used. Basically I need to add a time to wait for the temporary overlay to disappear before trying to click.

 cal_wait = WebDriverWait(driver, 10)
 cal_wait.until(EC.invisibility_of_element_located((By.XPATH,"//div[@class='blockUI
 blockOverlay']")))
 driver.find_element_by_id("calculate_button").click()
Manoj Kengudelu
  • 647
  • 1
  • 8
  • 21
usermt
  • 31
  • 4
0

I had the same error, and I realized that the button was not clickable because there was actually a nested link that the website would go to when the button was clicked. Try looking for other elements that could be activated/ pressed when you click the button.

Athreya Daniel
  • 101
  • 1
  • 10
0

If anybody else needs the answer maybe you should try sending CR with

.send_keys(u'\ue007')