Forum Discussion

colinkelly's avatar
colinkelly
Occasional Contributor
8 years ago

Tests not entering correct figure in text box.

We have an C++ application with Telerik controls and Test Complete looks to be recording the test fine but on play back its truncating some of the SetText entries.

 

The test records entering 10 into a text box, but playback will truncate it to 1 for some reason.

 

This is happening on numerous forms.

 

Example of code:
Set radTextBox = radWizard.panel5.tboxAddress1
Call radTextBox.HostedTextBoxBase.Click(24, 5)
Call radTextBox.SetText("")
Call radTextBox.SetText("Address ")
Call radWizard.Click(400, 426)
Set radMaskedEditBox = radWizard.panel2.mboxDiscountPercent
Call radMaskedEditBox.mboxDiscountPercent.Click(0, 11)
Call radMaskedEditBox.SetText("10.00")


Error from TC:

The editor cannot contain more than 1 symbols.
The text '10.00' has been truncated to '1'.

 

3 Replies

  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3

    You can try using Keys instead of SetText.  Often that works out better.

     

    If it does not, take a look at that field with Object Spy and post the Extended properties for us to see.

     

    • colinkelly's avatar
      colinkelly
      Occasional Contributor

      Ya, its the exact same issue with a Keyword test.

      I had already tried that.

       

      Do you just want a list of everything under Extended from the Object Spy?

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Actually, what Marsha_R mentioned is not about a Keyword test but using the Keys method instead of SetText.

         

        So, basically change your code to this (note the BOLD text) and see if this works.

         

        Set radTextBox = radWizard.panel5.tboxAddress1
        Call radTextBox.HostedTextBoxBase.Click(24, 5)
        Call radTextBox.SetText("")
        Call radTextBox.SetText("Address ")
        Call radWizard.Click(400, 426)
        Set radMaskedEditBox = radWizard.panel2.mboxDiscountPercent
        Call radMaskedEditBox.mboxDiscountPercent.Click(0, 11)
        Call radMaskedEditBox.Keys("10.00[Enter]")