Set the value of the text field instantly (without emulated input)

I use the command below to set the text input value to "some value", however the value is not set instantly, instead it is set as if it was entered by the user. This is normal for small values, but I use this method to insert large text inside a text field, and I do not want emulated typing to occur, I would like the value to be set instantly, for example, with copy / paste.

browser.text_field(:attr,"val").set "some value" 
+4
source share
4 answers

Thanks to Shubham's answer, I was able to track the appropriate method (.speed = at watir link ). Fast speed is not copy / paste emulation , although it is very fast. The correct speed option is zippy , and you set it like this:

 browser = Watir::IE.new browser.speed= :zippy 
0
source

I would recommend you use speed: faster for all other text fields, but those that are used in large quantities # value =. If you use: zippy, then no JavaScript events will be fired, and this can cause you painful moments ...

+3
source

Before initializing watir, add this option.

 $FAST_SPEED = 1 
+2
source

This also works:

 browser.text_field(:how => "what").value=("some value") 
+1
source

All Articles