Invalid input type Error

4 posts, 0 answers
  1. Raj
    Raj avatar
    1 posts
    Member since:
    Apr 2014

    Posted 19 Nov 2014 Link to this post

    Hi,

    I'm getting error saying "Invalid input type 'Text' for this control. Control was expecting 'Number' ", when i convert the recorded step to code and pass value from the data table(excel).

    Steps
    1) Record the step and playback (works fine)
    2) Record the step and convert the step to code (worksfine)
    3) Record the step and Data bind to external excel (worksfine)
    4) Convert the step to code which is data bound (error is thrown)

    I have attached the screen shots of

    1) Control properties
    2) Code

    Error message:

    Failure Information:
    ~~~~~~~~~~~~~~~
    Exception thrown executing coded step: '[Lodge_Monthly_Status_for_MINING_1_CodedStep] : Enter text '566' in 'AvgNumEmployeesText''.
    InnerException:
    System.ArgumentException: Invalid input type 'Text' for this control. Control was expecting 'Number'
       at ArtOfTest.WebAii.Controls.Control.CreateInstance[TControl](Element e, Boolean throwIfNull)
       at ArtOfTest.WebAii.ObjectModel.Element.As[TControl]()
       at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](HtmlFindExpression expr)
       at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](String[] clauses)
       at Pages.SafetyRegulationSystem5Page.get_AvgNumEmployeesText() in C:\Telrik\MSNew\Monthly Status (External)\Pages.g.vb:line 914
       at Monthly_Status__External_.Lodge_Monthly_Status_for_MINING__1_.Lodge_Monthly_Status_for_MINING_1_CodedStep() in C:\Telrik\MSNew\Monthly Status (External)\Mining\Lodge Monthly Status for MINING (1).tstest.vb:line 293


    Please let me know how to resolve this issue.


    Thanks
    Raj
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 21 Nov 2014 Link to this post

    Hello Raj,

    This problem is not with the code or with the CType in the code. It's trying to tell you that when Test Studio ran it expected to find an element in the browsers DOM like this:

    <input type="number">

    But what it found instead was this:

    <input type="text">

    Because the target element is the wrong type it's throwing the error and aborting the test. We need to figure out why Test Studio is finding the wrong element. Is it possible the element is not in input mode? Is it possible the application change such that it used to be type number and now it's type text?


    Regards,
    Cody
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Matthew
    Matthew avatar
    10 posts
    Member since:
    Oct 2015

    Posted 14 Sep Link to this post

    Was there any ever resolution to this?  I'm seeing a very similar error with similar steps.  In my case it is text input.  It works fine for a recorded step with data, but as soon as I convert to a coded step I see the error below.

    Note -> this works fine on elements with input tags, but we should be able to input text into elements with textarea tags as well.  

     

    Failure Information: 

    ~~~~~~~~~~~~~~~
    Exception thrown executing coded step: 'Enter text 'UserID' in 'UserIdText''.
    InnerException:
    System.ArgumentException: Invalid tag name 'textarea' for this control. Control was expecting 'input'
       at ArtOfTest.WebAii.Controls.Control.CreateInstance[TControl](Element e, Boolean throwIfNull)
       at ArtOfTest.WebAii.ObjectModel.Element.As[TControl]()
       at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](HtmlFindExpression expr)
       at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](String[] clauses)
       at AaaS.Pages.Add_UserPage.get_UserIdField() in c:\Users\MD-CS-win7\workspace\acs_web\ACS\Pages.g.cs:line 1098
       at AaaS.Add_user_with_all_required_and_optional_fields.SetUniqueUserID_CodedStep() in c:\Users\MD-CS-win7\workspace\acs_web\ACS\User Onboarding\AaaS-24.tstest.cs:line 61

  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 19 Sep Link to this post

    Hi Matt,

    This is a duplicate post of your ticket 1062456. Please provide us with the additional information in the ticket so we can try reproducing the issue and give you a solution.

    Thank you!

    Regards,
    Boyan Boev
    Telerik by Progress
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top