How to trigger event when enterring value in textfield using .value,
inputtag ab = "xpath";
ab.value="testing";
ab.presskeys("{TAB}");
delay.ms(2000);
keyboard.press("{TAB}");
...not able to trigger the (javascript)
Thank you in advance
textfield.value doesn't trigger the event
Re: textfield.value doesn't trigger the event
Setting the value that way, as you found out, does not trigger the fire event the developer has put in the input.
The best and easiest solution, in my mind, is to exactly mimic user's behavior and click into the input, type the chars and exit the input. Just as a user would do, since you are doing functional testing that is supposed to duplicate user's behavior.
Otherwise, you need to learn about how to call your javascript yourself and make sure you call it each and every time that you use the set value method (which may be impossible in some cases). Which, in my mind again, is the wrong way to test since you are circumventing the way the AUT has been developed and designed by your dev team and product management.
The best and easiest solution, in my mind, is to exactly mimic user's behavior and click into the input, type the chars and exit the input. Just as a user would do, since you are doing functional testing that is supposed to duplicate user's behavior.
Otherwise, you need to learn about how to call your javascript yourself and make sure you call it each and every time that you use the set value method (which may be impossible in some cases). Which, in my mind again, is the wrong way to test since you are circumventing the way the AUT has been developed and designed by your dev team and product management.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
Re: textfield.value doesn't trigger the event
Thank you Ciege, i did click on input box, didn't try yet typing chars instead of ab.value="testing";
Tipu
Re: textfield.value doesn't trigger the event
try something like this...
Code: Select all
inputtag ab = "xpath";
ab.Click(Location.Center, 1000);
Keyboard.Press("Testing{TAB}");
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
Re: textfield.value doesn't trigger the event
Thank you again for helping this out, sending one char worked , had to put some delay
Tipu