Forum Discussion

nachiket_kulkar's avatar
nachiket_kulkar
Occasional Contributor
10 years ago

Property to set Text on Control with Object Type NumberInput

Hi Team,



I am working on mobile testing on virtual browser on Chrome.

In my application there is a text box which is identified by Test Complete as ObjectType:NumberInput.  I want to set some value in NumberInput by deleting the existing value.



the .Keys method appends the value in the box.

Please help me with some relevant answers.



Thanks in advance.



Regards,

Nachi

5 Replies

  • You're right. It doesn't.



    Send the control this:


    .keys("[Esc]")



    ... before sending your normal .keys to it. The [Esc] sends an escape keypress to the control which clears it. I've tried it and it works for me.



    Or just add [Esc] to the start of the string you are already sending it which will clear it then enter your text. Again, tried and working for me.


  • nachiket_kulkar's avatar
    nachiket_kulkar
    Occasional Contributor
    Hi,



    I tried using Esc but still it does not clear the text, it still appends the text in the NumberInput box.



    Please help me with some other solution.



    Regards,

    nachiket
  • Did you format it correctly?



    I should be - [Esc] - without the square brackets, it won't work.



    I tried it on a NumberInput type field and it worked perfectly.



    Try it manually. Enter some numbers into the box and press escape. If the field clears, then send it an [Esc] should work.