title: retrive value of read only field using Selenium Webdriver
body: <p><strong>Update</strong> -- I have added the entire HTML code below for easier understanding of the issue. I have tried using the xpath 
  <code>findElement(By.xpath(".//div[@id='ContainerCell']/span/[@id='StartDate']/input[@id='StartDate_txtInput']")).getText();</code></p>
  
  <p><strong>I still get the error:</strong> </p>
  
  <pre><code>The given selector .//div[@id='ContainerCell']/span/[@id='StartDate']/input[@id='StartDate_txtInput'] is either invalid or does not result in a WebElement. The following error occurred:
  InvalidSelectorError: Unable to locate an element with the xpath expression .//div[@id='ContainerCell']/span/[@id='StartDate']/input[@id='StartDate_txtInput'] because of the following error:
  SyntaxError: The expression is not a legal expression.
  </code></pre>
  
  <p>Using Selenium Webdriver I need to retrieve the value of a read only field.
  This field contains a date which I need to compare to another date. 
  I have tried all methods (find element by id / class name / xpath etc) it always returns <code>element not found</code>. I suspect this is because the input filed resides inside a span which resides inside a div but being new to java I am unable to get to this field.</p>
  
  <p>Value I am looking for is <code>&lt;input id="StartDate_txtInput"&gt;</code></p>
  
  <p>HTML code below. </p>
  
  <pre><code>#document
      &lt;!--
  
      [if lte IE 8]&gt;
      &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD …
  
      --&gt;
      &lt;!--
  
      [if gte IE 9]&gt;
      &lt;!DOCTYPE HTML&gt;
      &lt;![endif]
  
      --&gt;
      &lt;!--
  
      [if !IE]&gt; 
  
      --&gt;
      &lt;!DOCTYPE html&gt;
      &lt;!--
  
       &lt;![endif]
  
      --&gt;
      &lt;html webdriver="true"&gt;
  
  &lt;head id="RuntimeForm"&gt;&lt;/head&gt;
  &lt;body id="RuntimeFormBody" onload="InitialiseRuntimeForm();setInitialSize();" onbeforeunload="return PromptWhenClosing(event)" style="overflow: hidden; margin: 0px;" onresize="resizeContainerCell()" tabindex="-1"&gt;
      &lt;form id="Form1" style="height: 100%;" onkeydown="return FormKeyDown(event)" onkeypress="return FormKeyPress(event)" onsubmit="javascript:return WebForm_OnSubmit();" action="RunTimeForm.aspx?ScreenID=8142758e-269a-41f0-b551-433e56dd1225" method="post" name="Form1"&gt;
  
  &lt;div&gt;&lt;/div&gt;
  &lt;script type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/V14_ST1/WebResource.axd?d=5sNVsMkS2BZs-uoFEc4iQlsiyiLjXyZMN…nDsYTHfbaZu1hg-eY3e5am9_qL4BG_2h5iaVRw1&amp;t=635662391674952392"&gt;&lt;/script&gt;
  &lt;script&gt;&lt;/script&gt;
  &lt;script&gt;&lt;/script&gt;
  &lt;script&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/V14_ST1/WebResource.axd?d=s_BonnG3MwQl_dl8IfLCFCykZO1rmMJx-…odgFonyPZXsgvo4Ui0T7XvpKyRoUhQlSwxeG541&amp;t=635662391674952392"&gt;&lt;/script&gt;
  &lt;script src="/V14_ST1/UltimateSpellInclude/UltimateSpell.core.js" language="javascript" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;&lt;/script&gt;
  &lt;input id="hdAccessKeyArea" type="hidden" value="8" name="hdAccessKeyArea"&gt;&lt;/input&gt;
  &lt;a id="AccessKeyLink" accesskey="0" onactivate="ShowAccessKeyHelp('false',$('#hdAccessKeyArea')[0].value);this.blur();" title="Access Key Help" tabindex="-1" href="javascript:ShowAccessKeyHelp(false,$('#hdAccessKeyArea')[0].value);"&gt;&lt;/a&gt;
  &lt;div id="ValidationSummary" style="color:Red;height:22px;width:197px;z-index:102;left:13px;position:absolute;top:420px;display:none;"&gt;&lt;/div&gt;
  &lt;div id="tblContainer" style="display: block; width: 100%;"&gt;
  
                              &lt;!--
  
                               Header ToolBar 
  
                              --&gt;
                              &lt;div id="trToolbarHeaderContainer" style="height: auto; width: 100%;"&gt;&lt;/div&gt;
                              &lt;!--
  
                               Runtime form content 
  
                              --&gt;
                              &lt;div id="Content" style="position:relative; background-color: #F9FAF5; width: 100%; height: 100%;"&gt;
                                  &lt;!--
  
                                   Runtime form cotrols 
  
                                  --&gt;
                                  &lt;div id="ContainerCell" style="overflow: auto; width: 459px; height: 305px; position: relative; background-color: rgb(250, 250, 250); cursor: default;"&gt;&lt;/div&gt;
                                  &lt;!--
  
                                   Refresh panel 
  
                                  --&gt;
                                  &lt;div id="RefreshPanel" style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; display: none"&gt;&lt;/div&gt;
                                  &lt;!--
  
                                   Footer ToolBar 
  
                                  --&gt;
                                  &lt;div id="trToolbarFooterContainer" style="width: 100%;"&gt;&lt;/div&gt;
                                  &lt;div id="trToolbarMobileContainer" style="width: 100%;"&gt;&lt;/div&gt;
                                  &lt;div id="dialog" title=""&gt;&lt;/div&gt;
                                  ::after
                              &lt;/div&gt;
                              &lt;input id="hdSubRecordDelete" type="hidden" name="hdSubRecordDelete"&gt;&lt;/input&gt;
                              &lt;input id="hdRecordID" type="hidden" value="00000000-0000-0000-0000-000000000000" name="hdRecordID"&gt;&lt;/input&gt;
                              &lt;input id="hdTableName" type="hidden" name="hdTableName"&gt;&lt;/input&gt;
                              &lt;input id="hdNoDisplayScreen" type="hidden" value=" No display screen assigned for the current Grid." name="hdNoDisplayScreen"&gt;&lt;/input&gt;
                              &lt;input id="hdParentRecordID" type="hidden" value="00000000-0000-0000-0000-000000000000" name="hdParentRecordID"&gt;&lt;/input&gt;
                              &lt;input id="hdHelpURL" type="hidden" name="hdHelpURL"&gt;&lt;/input&gt;
                              &lt;input id="hdHelpExists" type="hidden" value="html" name="hdHelpExists"&gt;&lt;/input&gt;
                              &lt;input id="hdSaveRecordFirstMessage" type="hidden" value="You must save the current record before carrying out this action." name="hdSaveRecordFirstMessage"&gt;&lt;/input&gt;
                              &lt;input id="hdDBSearchAddInID" type="hidden" name="hdDBSearchAddInID"&gt;&lt;/input&gt;
                              &lt;input id="ReadOnly" type="hidden" value="1" name="ReadOnly"&gt;&lt;/input&gt;
                              &lt;input id="hdHelpTitle" type="hidden" value=" Help " name="hdHelpTitle"&gt;&lt;/input&gt;
                              &lt;input id="hdDateLastModified" type="hidden" name="hdDateLastModified"&gt;&lt;/input&gt;
                              &lt;input id="ChangesAction" type="hidden" value="0" name="ChangesAction"&gt;&lt;/input&gt;
                              &lt;input id="hdFormLastModified" type="hidden" value="07/01/2015 08:20:11" name="hdFormLastModified"&gt;&lt;/input&gt;
                              &lt;input id="hdIsChangesMade" type="hidden" name="hdIsChangesMade"&gt;&lt;/input&gt;
                              &lt;input id="ImpersonationToken" type="hidden" name="ImpersonationToken"&gt;&lt;/input&gt;
                              &lt;input id="HRImpersonationToken" type="hidden" value="EcwWpmHtjrWmn9UTEYVeW0QB4wsmk2a+IdSkkHq9ENs=" name="HRImpersonationToken"&gt;&lt;/input&gt;
                              &lt;input id="ImpersonationId" type="hidden" name="ImpersonationId"&gt;&lt;/input&gt;
                              &lt;input id="InstanceID" type="hidden" value="0538a35f-03d7-e511-968c-8e001800001f" name="InstanceID"&gt;&lt;/input&gt;
                              &lt;input id="hdScreenId" type="hidden" value="8142758e-269a-41f0-b551-433e56dd1225" name="hdScreenId"&gt;&lt;/input&gt;
                              &lt;input id="hdScreenIdentifiers" type="hidden" name="hdScreenIdentifiers"&gt;&lt;/input&gt;
                              &lt;input id="hdUniqueID" type="hidden" value="d0b819a3-47b6-4cf1-a08b-983e98d0a673" name="hdUniqueID"&gt;&lt;/input&gt;
                              &lt;input id="hdFormDataset" type="hidden" value="AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00…cgZfQnVpbGQJX1JldmlzaW9uAAAAAAgICAgCAAAAAAAAAP//////////Cw==" name="hdFormDataset"&gt;&lt;/input&gt;
                              &lt;input id="hdRecordIDList" type="hidden" name="hdRecordIDList"&gt;&lt;/input&gt;
                              &lt;input id="hdVersion" type="hidden" name="hdVersion"&gt;&lt;/input&gt;
                              &lt;input id="hdAutoCompleteMobileOnly" type="hidden" value="True" name="hdAutoCompleteMobileOnly"&gt;&lt;/input&gt;
                              &lt;input id="hdWorkflowSubmitted" type="hidden" value="false" name="hdWorkflowSubmitted"&gt;&lt;/input&gt;
                              &lt;input id="hEventSource" type="hidden" name="hEventSource"&gt;&lt;/input&gt;
                              &lt;script type="text/javascript"&gt;&lt;/script&gt;
                              &lt;script type="text/javascript"&gt;&lt;/script&gt;
                              &lt;script&gt;&lt;/script&gt;
                              &lt;script type="text/javascript"&gt;&lt;/script&gt;
                              &lt;script language="javascript" type="text/javascript"&gt;&lt;/script&gt;
                              &lt;form target="DOCCONTAINER" action="" name="DocName" method="post"&gt;&lt;/form&gt;
                              &lt;iframe name="DOCCONTAINER" src="javascript:void(0)" style="visibility: hidden; display: none"&gt;&lt;/iframe&gt;
                              &lt;script type="text/javascript"&gt;&lt;/script&gt;
                              &lt;script type="text/javascript" language="javascript"&gt;&lt;/script&gt;
                              &lt;script&gt;&lt;/script&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
                  &lt;/body&gt;
              &lt;/html&gt;
          &lt;/html&gt;
      &lt;/iframe&gt;
      &lt;script defer="" src="FormContainer.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;&lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>