Click on a button in a Modal Window - Protractor
<p>I'm writing protractor tests for an existing app.
I have a button called 'Decline' in a modal window, and I'm trying to click it using: </p>

<pre><code>element(by.buttonText('Decline')).click();
</code></pre>

<p>But I receive the below error:</p>

<pre><code>UnknownError: unknown error: Element is not clickable at point (,). Other element would receive the click:
</code></pre>

<p>May be because I have another button called 'Decline' outside the modal window?</p>

<p><a href="https://i.stack.imgur.com/BXDTw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BXDTw.png" alt="enter image description here"></a></p>

<p>How do I click on the modal window's Decline button ?</p>

<p>Found that this is the js code that displays this Decline button.</p>

<pre><code>.....
var content = {
          title: 'Decline',
          htmlBody: '&lt;p&gt;...&lt;/p&gt; ',
          okButton: 'Decline',
          onOk: function() {
.....
</code></pre>