Currently we are testing Web Application with Web Module using TestComplete. I has a simple test case that login HeadOffice through login page.
Here is my script:
URL = "http://qa1-merch1/merchant/headoffice/test/login"
If Not Sys.WaitBrowser("chrome", 10000).Exists Then
Set Browser = Sys.Browser("chrome")
Set Panelroot = Browser.Page(URL).Panel("container").Panel("root")
Set form = Panelroot.Panel(1).Panel(0).Form(0)
Set User = form.Panel(0).Panel(0).Panel(0).Panel(0).Panel(0).Textbox(0)
Set Password = form.Panel(0).Panel(1).Panel(0).Panel(0).Panel(0).PasswordBox(0)
Set LoginButton = form.Button("loginSubmitButton")
I am using Keys Method to enter user and password, it doesn't work anymore. I replace it with SetText, it works fine. So it seems Keys Method no longer works for our web application, but it works fine with Desktop module. Is there any reason, and how can fix it?
Solved! Go to Solution.
If you didn't change TestComplete versions, the problem is not with TestComplete. The "Keys" method is not broken.
My expectation is that something changed in your web application with security hardening of the login page. There are any number of security items that would prevent a"scripted" entry of the password SPECIFICALLY to prevent exactly what TestComplete is doing... utilizing a non-hardware keyboard method of entering the password into a login form. This is why "SetText" probably works because it sets the text internally on the property of the object rather than attempting to use "Keys".
Further to @tristaanogre :
Did the textbox itself change from a textbox to a password box ? They behave differently including, as @tristaanogre suggested, disable scripting on the object. Attacched is a screenshot of my object tree to illustrate the difference
Sometimes the simplest option is simply the one that works