title: Selenium (Python) - click on disabled button after it is enabled
body: <p>I am using Selenium with Python to automate a process to upload a file. There is an &quot;Upload&quot; button which is disabled by default and only becomes clickable when the file to be uploaded is chosen.</p>
  <p>The HTML for Disabled Button is -</p>
  <pre><code>&lt;button type=&quot;button&quot; id=&quot;upload-button&quot; data-bi-id=&quot;upload-button&quot; class=&quot;ms-Button ms-Button--primary is-disabled root-296&quot; disabled=&quot;&quot; aria-label=&quot;Upload&quot; aria-disabled=&quot;true&quot; data-is-focusable=&quot;false&quot;&gt;
  </code></pre>
  <p>And the HTML for button after it becomes clickable is -</p>
  <pre><code>&lt;button type=&quot;button&quot; id=&quot;upload-button&quot; data-bi-id=&quot;upload-button&quot; class=&quot;ms-Button ms-Button--primary root-437&quot; aria-label=&quot;Upload&quot; data-is-focusable=&quot;true&quot; tabindex=&quot;0&quot;&gt;
  </code></pre>
  <p>I am using -</p>
  <pre><code>WebDriverWait(browser, 15).until(EC.element_to_be_clickable((By.ID,&quot;upload-button&quot;))).click()
  </code></pre>
  <p>But its not working. I believe this is clicking on the disabled button (even though the file is chosen and the button has become clickable). I also tried -</p>
  <pre><code>WebDriverWait(browser, 15).until(EC.element_to_be_clickable((By.CLASS_NAME,&quot;ms-Button ms-Button--primary root-437&quot;))).click()
  </code></pre>
  <p>But this gives a <code>TimeOut Exception</code>. So what should I do to click this button after it becomes clickable. I have tried some solutions from the Internet, but none of them seem to be working.</p>