Ask a Question

Property to set Text on Control with Object Type NumberInput

nachiket_kulkar
Occasional Contributor

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 5
Colin_McCrae
Community Hero

Try using .value instead of .keys?
nachiket_kulkar
Occasional Contributor

.Value is not working for that control
Colin_McCrae
Community Hero

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
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
Colin_McCrae
Community Hero

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.
cancel
Showing results for 
Search instead for 
Did you mean: