2

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

  • 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 Siddiqui May 12 '17 at 21:38
  • This is an anchor tag. Did LinkText/PartialLinkText not work? – Brian Sep 17 at 20:29
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.

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

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

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.

  • I am not sure , how to use actions in Robort framework. Any example pls. – keasav rao Jun 17 '16 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 Jul 27 '16 at 5:56
0
Scroll Element Into View     xpath=(//a[contains(text(),'Audio')])
Sleep    0.5s
Click Element    xpath=(//a[contains(text(),'Audio')])
  • 2
    Plz, give an explanation of your answer. – Nitin Rastogi Sep 16 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 Sep 16 at 15:08
0

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

So, better try wait for element clickable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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