Forum Discussion
12 Replies
Sort By
- paul_scroceFrequent ContributorI would try changing SetText to the Keys action on a login screen to trigger any event handlers.
See the remarks in this article
http://support.smartbear.com/viewarticle/30039/
If your tested application uses event handlers to detect and handle text changes or keyboard input in a control, keep in mind that the SetText action raises only text change events and does not raise keystroke events. If the expected events do not occur when you use the SetText action to change a control’s text, use the Keys action instead. - i404ContributorHi Guys,
I have not got any progress for this issue that I encountered.
Basically I have a login page, the login button is disabled. The button will only becoming visible when username field and password field are filled. It recorded the test using KeywordTests and I can see the script when I converted it. It will then failed when I ran the test because the login button is not enabled/visible.
Is there a way I can overcome this? in QTP, you can replay the events using the mouse and keyboard simulation. Please help!!
TIA
Cheers,
Ian - i404ContributorUpdate:
I spoke to one of my colleague and he said it could be due to the script run too quickly, if we can slow down the action, the login button may become enabled (when this failed, the attribute for the button enabled is set to False).
Is there a way we can slow down the action entering username & password?
Cheers
Ian - tristaanogreEsteemed ContributorSearch help for "Waiting for Object State". This, I believe, is what you're looking for. Essentially, after you record, you'll want to edit your test to include a "WaitNNN" function as described to pause the test until the object has a certain state.
- AlexeyKSmartBear Alumni (Retired)
Ian,
To insert a delay, you can use the aqUtils.Delay(...) method. It pauses the test execution for the specified number of milliseconds. Also, I'd suggest that you try the WaitProperty(Property, Value, Timeout) method. It pauses the test until the property gets the needed value or until the timeout is over.
If YourButtonObject.WaitProperty("Enabled", True, 5000) Then
' Success
Else
' Error
End IfAnd like Robert said, you can find examples in this topic: Waiting for Object State Changes.
- i404ContributorHi Guys,
Have tried all the moethod you mention and button is still not set "Enabled" to True. What I believe it that the login page did not see the changes made in the username and password field, therefore it is not setting the button attribute "Enable" to True. Whilst I was on the login page (when execute failed), I click on either username or password box and put a space inside it, the button state changed "Enable" to "True".
Do you think TestComplete implementation of mouse or keyboard action is slightly different?
I had trouble to do that in QTP until I found this:
Setting.WebPackage("ReplayType") = 2
type username
type password
Setting.WebPackage("ReplayType") = 1
click button
where it indicates how mouse operations should be run. The value can be one of the following:
1 - Runs mouse operations using browser events.
2 - Runs mouse operations using the mouse.
Default is 1
Is there anything that's similar to this?
Thanks
Regards
Ian - i404ContributorHi Guys,
I got a work around :-) , i.e. insert key "[Tab]" after entering username or password. That manage to trick the web browser to think the state changed and have the button enabled now.
Regards,
Ian - AlexeyKSmartBear Alumni (Retired)
Ian,
This is what I was going to tell you. :-) ("Simulate Tab or Shift+Tab after typing the password...")
Glad to hear the problem is solved. :-) - christopher_ochNew ContributorHello, I am also having the same issue with button being disabled after entering the userid/password. I have tried the waiting property, as well as the tab, shift tab solutions but nothing has worked for me.
I'm asking if anyone has a newer solution for this issue, I would greatly appreciate it.
Thanks,
Christopher Ochoa - paul_scroceFrequent ContributorAre you using the Keys action or the SetText action in your script?