This is the HTML code for the source page of bitbucket.org webpage
    <div class="aui-layer aui-dialog2 aui-dialog2-large" role="dialog" aria-hidden="false" data-aui-focus="false" data-aui-blanketed="true" style="z-index: 3000;">  <header class="aui-dialog2-header">
    <h1 class="aui-dialog2-header-main dialog-title">Add SSH key</h1>
  </header>
<div id="bb-new-ssh-key-dialog-content" class="aui-dialog2-content "><form id="new-ssh-key" method="post" class="ssh-keys-form aui">
    <input type="hidden" name="csrfmiddlewaretoken" value="Y1fI2KoE87IKZwncZHYIh7zBpFyfXMsI">
    <div id="id_label_group" class="field-group ">
        <label for="id_label">
          Label
        </label>
          <input class=" text long-field" id="id_label" maxlength="255" name="label" type="text">
    </div>
    <div id="id_key_group" class="field-group ">
        <label for="id_key">
          Key<span class="aui-icon icon-required"></span><span class="content">required</span>
        </label>
          <textarea class=" textarea long-field" cols="40" columns="40" id="id_key" name="key" placeholder="Paste your key here..." rows="8"></textarea>
    </div>
<p class="field-group">
  <strong class="heading">Already have a key?</strong>
    Copy <a href="https://confluence.atlassian.com/x/YwV9E" target="_blank">your key</a> to your clipboard
  <span class="ssh-key-copy-help mac">with: <code>cat ~/.ssh/id_rsa.pub | pbcopy</code></span>
  <span class="ssh-key-copy-help linux" style="display: inline;">with: <code>xclip -sel clip < ~/.ssh/id_rsa.pub</code></span>
</p>
<p class="field-group" id="ssh_error_help">
  <strong class="heading">Problems adding a key?</strong>
    Read our <a href="https://confluence.atlassian.com/x/2YJnJ" target="_blank">knowledge base</a> for common issues.
</p>
    <div class="buttons-container">
      <div class="buttons">
        <input type="hidden" name="action" value="add-key">
        <button type="submit" id="add_key_button" class=" hidden add_key_button">
          Add key
        </button>
      </div>
    </div>
  </form></div>
  <footer class="aui-dialog2-footer">
    <div class="aui-dialog2-footer-actions">
      <button class=" aui-button aui-button-primary dialog-submit" resolved="">
          Add key
        </button>
        <button class=" aui-button aui-button-link dialog-cancel" resolved="">Cancel</button>
    </div>
  </footer>
</div>
I want to press button with the text "Add key". I have tried following commands using selenium
1. driver.find_element_by_xpath("//button[contains(text(),'Add key')]").click()
2. driver.find_element_by_tag_name("footer").find_element_by_tag_name("div").find_element_by_xpath("//button[contains(text(),'Add key')]").click()
3. driver.execute_script("document.getElementByXPath(\'' + //button[contains(text(), 'Add key')] + '\').click()")
But nothing worked out of these possibilities and throws error that it is unable to locate the required element. The window looks like a pop-up window so I have also tried by switching to the iframe, but that also failed.
 What can I do to click this button. Any help would be appreciated.
 What can I do to click this button. Any help would be appreciated.
 
     
     
     
     
     
    