Q:

How to click on the button element

How to click on the button element? 
Here is the HTML:
<button class="ui-button ui-widget ui-state-default ui-corner-all ui- 
button-icon-only ui-dialog-titlebar-close" type="button" role="button" 
aria-disabled="false" title="close">
<span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span>
<span class="ui-button-text">close</span>
</button>

The error is "Element is not clickable at point (1165.88330078125, 427.76666259765625).  Other element would receive the click: 
Command duration or timeout: 77 milliseconds"
I am on Selenium 2.53.1, if that helps. 
I am using Java to write automation scripts. 

A:

To click on the desired element you need to induce WebDriverWait for the desired element to be clickable and you can use either of the following solutions:

cssSelector:
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-icon-only.ui-dialog-titlebar-close[title='close']>span.ui-button-text"))).click();

xpath:
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//button[@class='ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close' and @title='close']/span[@class='ui-button-text' and contains(.,'close')]"))).click();

