0

There is button in an web application, where i can able to click it manually but when i am clicking it using python selenium at that particular point i am getting this exceptional error saying

selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (700, 3284)

and the XPATH I have used to to click that particular place is

driver.find_element(By.XPATH, "(//a\[@title='Character create'\])\[44\]").click()

and the HTML code, where I used those attributes and its values are from the following code

click to see the image of HTML code for that XPATH

<a href="https://igs.imarticus.org/stratonboardportal/uatinternal/DataEntry/GameConfiguration/gamecharacterlist/101" title="Character create" class="btn outline_btn mb-2 px-4 text-center"><i class="fas fa-wrench"></i></a>

click to see the exception message as image

What I am missing here?

Even I have given enough time around more that 20 seconds before and after to that specific XPATH like time.sleep(20) and also tried driver.implicietly_wait(20)

the co-ordinates where actually I am clicking using python selenium is at {'x': 669, 'y': 3266}, I have found these co-ordinates using the following syntax.

driver.find_element(By.XPATH, "(//a\[@title='Character create'\])\[44\]").location

but the error it is displaying is at (700,3284).

can any one please help me in this?

When I am locating the element where i want click it is throwing an exception error message as

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//a[text()=' Add Character']"}

when I am clicking there, it is throwing an exception error message as

selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (700, 3284)

So, when ever I click on that button no error message should come and i should able to proceed to its respective UI.

Akzy
  • 1,817
  • 1
  • 7
  • 19
  • that happens when there's something above it that would receive the click. Try the javascript solution or just navigate to the url – pguardiario Feb 25 '23 at 00:13

1 Answers1

0

Try if clicking the element using JavaScript works, try the below code to click on the desired element:

element = driver.find_element(By.XPATH, "(//a[@title='Character create'])[44]")
driver.execute_script("arguments[0].click();", element)
Shawn
  • 4,064
  • 2
  • 11
  • 23
  • hey, thank you. Shawn it's working wow, thank you so much. can you tell me what syntax you have used in driver.execute_script("arguments[0].click();", element) – Sai Krishna Feb 27 '23 at 12:20
  • Sometimes selenium alone cannot perform actions(for example clicking a button) due to various reasons. In these cases, we can take help of JavaScript to do the action. `execute_script()` method executes Javascript in the current window. For more details about `execute_script()` refer this https://stackoverflow.com/questions/64987951/what-does-execute-script-in-selenium-does. You can upvote/accept this answer if the answer provided has solved your issue, this will help those who are in the same boat as you and are looking for answers. – Shawn Feb 27 '23 at 12:30
  • Refer this also, you will understand the difference between selenium's `click()` and Javascript's `click()`. https://stackoverflow.com/questions/34562061/webdriver-click-vs-javascript-click – Shawn Feb 27 '23 at 12:35
  • sure, definetly – Sai Krishna Feb 27 '23 at 12:46