This question is locked. New answers and comments are not allowed.
| [Test] |
| public void TestGetSubmitter() |
| { |
| // Launch a browser instance |
| Manager.LaunchNewBrowser(BrowserType.InternetExplorer); |
| // The active browser |
| ActiveBrowser.NavigateTo("http://localhost/ESubmissions/GetSubmitterInfo.aspx"); |
| Assert.IsTrue(ActiveBrowser.ContainsText("Please provide the following information so that we may contact you regarding your electronic submission.")); |
| var input = Find.ByCustom<RadTextBox>(e => e.ID.Contains("SubFirstName_wrapper")); |
| Assert.AreEqual("First Name", input.EmptyMessage); |
| input.TypeText("Daniel", 100); |
| input.Blur(); |
| Assert.AreEqual("Daniel", input.InputValue ); |
| } |
I am trying to set a bunch of fields on this form to automate testing of this web application.
var input is set correctly to the right TextBox...
The Assert.AreEqual for the EmptyMessage succeeds.
However, all that input.TypeText("Daniel", 100); does is to clear the text box.
Thus the last AreEqual fails because InputValue is the empty string.
Ideas?
FYI, My Asp.net page has::
| <td class="formBkgrnd submitterFormLeft" style="margin-left: 80px"> |
| <telerik:RadTextBox ID="SubFirstName" runat="server" EmptyMessage="First Name" MaxLength='<%$ MaxLength:Contact.FirstName %>' |
| TabIndex="11" CssClass="formText"> |
| </telerik:RadTextBox> |
| </td> |
and the HTML rendered is:
| <span id="ctl00_content_SubFirstName_wrapper" class="RadInput RadInput_Default" style="white-space:nowrap;"><input value="First Name" type="text" maxlength="50" size="20" id="ctl00_content_SubFirstName_text" name="ctl00_content_SubFirstName_text" class="riTextBox riEmpty formText" tabindex="11" style="width:125px;" /><input id="ctl00_content_SubFirstName" name="ctl00$content$SubFirstName" class="rdfd_" style="visibility:hidden;margin:-18px 0 0 -1px;width:1px;height:1px;overflow:hidden;border:0;padding:0;" type="text" value="" /><input id="ctl00_content_SubFirstName_ClientState" name="ctl00_content_SubFirstName_ClientState" type="hidden" /></span> |