3

The exception is

`WebDriverException: Message: Element is not clickable at point (548.xxxxxxxxx, 2xx.5). Other element would receive the click: <span class="regs2" style="" id="vtASRSettings_incompletetimeoutDiv" onclick="Bs_Objects[5].textboxEdit(true);"></span>`

I have the following HTML code:

<a title="Audio" href="javascript:document.forms[0].action='/PageEditor?ADC_TOKEN=F5TW-I6G7-8Q0Z-WR8A-45QE-ICUX-LCRM-FZJM&command=addSoundFileError&errorType=noSpeech';document.forms[0].submit();">Audio</a>
    </td>

My script code is

    Wait Until Element Is Visible         xpath=(//a[contains(text(),'Audio')])
        Click Link          xpath=(//a[contains(text(),'Audio')])

Still faces the same error

2
  • 1
    Are you sure that the xpath used uniquely identifies the same element you intend to click? Also Other element would receive the click exception occurs when another element is overlapping the element you want to click on. Please paste the entire <table> tag DOM to get an accurate solution.
    – Zeeshan S.
    Commented May 12, 2017 at 21:38
  • This is an anchor tag. Did LinkText/PartialLinkText not work?
    – Brian
    Commented Sep 17, 2019 at 20:29

7 Answers 7

1

Typically when I get this error it is due to a timing issue. Even after waiting for a certain element to display before clicking the link, it's possible for something to intermittently load or take focus away. Then when your code attempts to click it will click something that wasn't meant to be clicked.

The easiest way to determine if this is the problem is to add an implicit wait for a few seconds to see if the page stabilizes, prior to doing your element visible detection. If you wait for a few seconds, the page may stabilize and then your click will succeed. From there you can best determine how to do the additional explicit waits (hopefully) which are better than the implicit waits.

1

Using xpath or css doesn't matter in this case. First of all find the element which would receive the click (@id='vtASRSettings_incompletetimeoutDiv'). If this element disappear afer some time just wait until element disappear. Sometimes it is necessary to move or scroll, but we can't say without seeing the problem. Would be great if you provide some screenshot.

0

Try using css instead of xpath and use an exact match instead of contains and look at an element or attribute rather than text.

So

Try using css=(a[title='Audio'])

If necessary isolate by table or td, for example css=(table#some_id a[title='Audio'])

0

Use Actions class of webdriver to fix this issue:

 Actions actions = new Actions(driver);
actions.moveToElement(driver.findElement(By.xpath("//a[text()='Audio']"))).click().build().perform();

Hope this will help you.

2
  • I am not sure , how to use actions in Robort framework. Any example pls.
    – Bustaq
    Commented Jun 17, 2016 at 10:51
  • 1
    Actions class is part of Webdrive API not of Robot framework. But by adding selenium jar in your framework you can use the Actions class and code is same for every framework.
    – Vishal
    Commented Jul 27, 2016 at 5:56
0
Scroll Element Into View     xpath=(//a[contains(text(),'Audio')])
Sleep    0.5s
Click Element    xpath=(//a[contains(text(),'Audio')])
2
  • 2
    Plz, give an explanation of your answer. Commented Sep 16, 2019 at 7:37
  • 1
    Hi Junsun! In general, when you are going to answer an older question, where someone is probably not around to ask followups, it's best to explain the answer in greater detail for future visitors. Why the sleep? Why 0.5 seconds? Why would the "wait for" not work? Thanks!!
    – corsiKa
    Commented Sep 16, 2019 at 15:08
0

It is possible that the element is visible, but not yet clickable.

So, better try wait for element clickable.

1
0

you can use

click element at coordinates 'element locator' 0 0

Not the answer you're looking for? Browse other questions tagged or ask your own question.