I am automating the functionalities in hybrid mobile application and problem i am facing is below -
My application has a web page which has 3 fields- username ,password and login button. Now I am able to find all the objects in the page but when i am trying to send the string in the password box after successfully sending in username box, password is not being entered in the password box instead it is inserted in the username itself.
Please suggest what might be the reason.
I had the same issue in desktop mode at long time back but i can not recall what i had done to solve the issue.
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 ?
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()
> 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.
Could you plz suggest how to use setFocus() method . I am finding in my log obj.SetFocus() is not a function.
> 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.
Some more universal code might be like this:
if (aqObject.IsSupported(<object>, 'SetFocus'))
No Its is not havng SetFocus( ) method.
Also one more thing whcih i am seeing in my object browser -
However I can find the controls in the object browser with all its properties and methods , I can not see the control in the object preview .And I think this is the reason why keys are not sent ot the control!
I have attached the Screen shot below.
> I think this is the reason why keys are not sent ot the control!
While it is strange that nothing is shown in the object preview and you may ask Support difectly about this via the https://support.smartbear.com/message/?prod=TestComplete form, I do not think that this is the reason for the input problem.
Have you tried to .Click() this textbox? Does this resolved the problem with the input text? Can you see Click and/or SetFocus methods on the Methods pane of the Object Browser?
You can try recording a keyword test that does what you want and see what TC creates from that. You can then convert that to a script to get even closer to what you need.
I have tried both. Also I put wait after the operation but problem not resolved.