title: How to identify button class element?
body: <p>I tried the following to identify elements but I am getting "No element found" message when I run my scripts.</p>
  
  <p>Method1 tried:</p>
  
  <pre><code>self.driver.find_element_by_xpath("//button[text()='Adopt and Initial']").click()
  </code></pre>
  
  <p>Method2 tried:</p>
  
  <pre><code>self.driver.find_element_by_css_selector(".btn-primary.btn.left.item-alt").click()
  </code></pre>
  
  <p>HTML of the button:</p>
  
  <p>Updated Html code for the element. This is for docusign. </p>
  
  <pre><code>    &lt;div class="dialog is-signature-mode" tabindex="0"&gt;
    &lt;header class="dialog-header"&gt;
      &lt;h1 class="dialog-title"&gt;
        &lt;span class="item-alt" data-group="tagType" data-group-item="signature"&gt;Adopt Your Signature&lt;/span&gt;
        &lt;span class="item-alt" data-group="tagType" data-group-item="initials" data-selected=""&gt;Adopt Your Initials&lt;/span&gt;
      &lt;/h1&gt;
      &lt;nav class="icons"&gt;
        &lt;a class="close" data-action="cancelAdoptSignature"&gt;
          &lt;i class="icon-close"&gt;&lt;/i&gt;
        &lt;/a&gt;
      &lt;/nav&gt;
    &lt;/header&gt;
    &lt;section class="dialog-body"&gt;
      &lt;article id="adopt"&gt;
  
          &lt;header class="ds-title p"&gt;
            Confirm your name, initials, and signature.
          &lt;/header&gt;
          &lt;div class="full-name"&gt;
            &lt;div class="wrapper"&gt;
              &lt;label for="full-name"&gt;Full Name&lt;/label&gt; &lt;span class="error hidden"&gt;Name required&lt;/span&gt;
              &lt;br&gt;
              &lt;div class="text-input-wrapper"&gt;
                &lt;input id="full-name" disabled="" value="QAAuto 01Dec2014_10.41.03" name="fullname" type="text" class="required text-input" maxlength="50"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="initials"&gt;
            &lt;div class="wrapper"&gt;
              &lt;label for="initials"&gt;Initials&lt;/label&gt; &lt;span class="error hidden"&gt;Initials required&lt;/span&gt;
              &lt;br&gt;
              &lt;div class="text-input-wrapper"&gt;
                &lt;input id="initials" disabled="" value="Q0" name="initials" type="text" class="required text-input" maxlength="50"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  
  
        &lt;div class="clear-float"&gt;&lt;/div&gt;
      &lt;/article&gt;
      &lt;header class="tab-nav"&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href="#select-style" class="tab tab-select-style selected"&gt;Select Style&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#draw" class="tab tab-draw"&gt;Draw&lt;/a&gt;&lt;/li&gt;
  
  
        &lt;/ul&gt;
      &lt;/header&gt;
  
        &lt;article id="select-style" class="tab-panel panel-select-style selected"&gt;
          &lt;h4 class="normal"&gt;Preview &lt;span class="error"&gt;&lt;/span&gt;&lt;/h4&gt;
          &lt;div class="signature-preview"&gt;
            &lt;div class="signature"&gt;&lt;img alt="" src="https://demo.docusign.net/Signing/image.aspx?ti=56b2faad38e7427a99defd1dfaa258ce&amp;amp;insession=1&amp;amp;i=asig150&amp;amp;force=154&amp;amp;s=QAAuto+01Dec2014_10.41.03&amp;amp;f=7_DocuSign&amp;amp;nochrome=0" height="75px" class="signature-img left"&gt;
  &lt;img alt="" src="https://demo.docusign.net/Signing/image.aspx?ti=56b2faad38e7427a99defd1dfaa258ce&amp;amp;insession=1&amp;amp;i=ainit150&amp;amp;force=155&amp;amp;s=Q0&amp;amp;n=QAAuto+01Dec2014_10.41.03&amp;amp;f=7_DocuSign&amp;amp;nochrome=0" height="75px" class="initials-img right"&gt;
  &lt;div class="clear-float"&gt;&lt;/div&gt;&lt;/div&gt;
            &lt;a class="change-style"&gt;
              Change Style
            &lt;/a&gt;
            &lt;div class="clear-float"&gt;&lt;/div&gt;
          &lt;/div&gt;
        &lt;/article&gt;
  
  
        &lt;article id="draw" class="tab-panel panel-draw"&gt;
          &lt;h4 class="normal"&gt;
            &lt;span class="item-alt-inline" data-group="tagType" data-group-item="signature"&gt;Draw your signature&lt;/span&gt;
            &lt;span class="item-alt-inline" data-group="tagType" data-group-item="initials" data-selected=""&gt;Draw your initials&lt;/span&gt;
            &lt;span class="error"&gt;&lt;/span&gt;
          &lt;/h4&gt;
          &lt;a class="clear" data-ds="clear"&gt;Clear&lt;/a&gt;
          &lt;div class="signature-draw signature"&gt;
  
          &lt;div class="canvas-wrapper"&gt;&lt;canvas class="canvas" width="0" height="0"&gt;&lt;/canvas&gt;&lt;canvas class="canvas" width="0" height="0"&gt;&lt;/canvas&gt;&lt;/div&gt;&lt;/div&gt;
        &lt;/article&gt;
  
  
  
      &lt;p class="legalese"&gt;By clicking Adopt and Sign, I agree that the signature and initials will be the electronic representation of my signature and initials for all purposes when I (or my agent) use them on documents, including legally binding contracts - just the same as a pen-and-paper signature or initial.&lt;/p&gt;
      &lt;hr&gt;
      &lt;button class="btn-primary btn left item-alt" data-group="tagType" data-group-item="signature" type="button" data-ds="submit" value="initials"&gt;Adopt and Sign&lt;/button&gt;
      &lt;button class="btn-primary btn left item-alt" data-group="tagType" data-group-item="initials" type="button" data-ds="submit" value="initials" data-selected=""&gt;Adopt and Initial&lt;/button&gt;
      &lt;button class="close left btn btn-default" type="button" data-action="cancelAdoptSignature"&gt;Cancel&lt;/button&gt;
      &lt;div class="clear-float"&gt;&lt;/div&gt;
    &lt;div class="styles"&gt;&lt;/div&gt;&lt;/section&gt;
  &lt;/div&gt;
  </code></pre>