title: Get element value in Selenium webdriver ruby script
body: <p>I am trying to put some asserts by getting value and then comparing them.
  But, the get value statement always returns nil.</p>
  
  <p>Desired value:- </p>
  
  <pre><code>&lt;span class="contractSalesPrice.contractSalesPrice"&gt;$314,507.30&lt;/span&gt;
  </code></pre>
  
  <p>I tried following ways: - </p>
  
  <pre><code>element1 = browser.find_element(:css,"#total &gt; tbody &gt; tr &gt; td:nth-child(4) &gt; span")
  
  browser.execute_script("return arguments[0]", element1)
  
  browser.find_element(:css,"#total &gt; tbody &gt; tr &gt; td:nth-child(4) &gt; span").attribute('value')
  
  browser.find_element(:css,"#total &gt; tbody &gt; tr &gt; td:nth-child(4) &gt; span").value
  </code></pre>
  
  <p>What could be wrong?</p>
  
  <p>Pls help, Thank You in advance.</p>
  
  <p>Abhishek</p>