Forum Discussion
Hi,
a) How input is sent to control in your test code?
b) Does it help if you set an input focus (.Click() ) or .SetFocus() ) to the required control before entering the text ?
Hi AlexKaras,
1-- I am trying both - Keys(object ,string) and setText(object, string).
2-- I have not tried it yet. I am going to try setFocus and click()
Thanks,
> I am going to try setFocus and click()
Yes, please. While <object>.Keys() is expected to put required keys sequence into <object>'s input queue, I've seen the cases when the input was sent to (or intercepted by?) some other control. Explicit input focus setting to the required control always solved this problem.
- smartbearrj7 years agoContributor
Hi AlexKaras,
Could you plz suggest how to use setFocus() method . I am finding in my log obj.SetFocus() is not a function.
Thanks,
> I am finding in my log obj.SetFocus() is not a function.
.SetFocus() exists not for all controls.
Check in the Object Browser if it exists for the given control.
P.S.
Some more universal code might be like this:
if (aqObject.IsSupported(<object>, 'SetFocus'))
<object>.SetFocus();
else
<object>.Click();