Micro Focus QTP (UFT) Forums
Button is not getting enabled - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Button is not getting enabled (/Thread-Button-is-not-getting-enabled)



Button is not getting enabled - estherindu - 10-14-2009

In my web application,there is edit box followed by a web button.once you enter text in editbox the button will enabled.but problem is though I am passing the text,button is not enabled.I have tried using the send keys also but it did not work out?

Any idea plzzzz let me know.


RE: Button is not getting enabled - Saket - 10-14-2009

does it works manually? if yes then try sending 'Tab' key after passing the text.


RE: Button is not getting enabled - Tarik Sheth - 10-14-2009

Hi,

I guess in your case (estherindu) the button needs focus to get it enabled so if you try set focus after tab it should work.


RE: Button is not getting enabled - manabh - 10-14-2009

Hi,
I guess the button enable process is called on either edit box's "Text_change" event or "Lost_focus" events. Try to fire those events, after entering value in edit box.


RE: Button is not getting enabled - basanth27 - 10-14-2009

Estherindu -
QTP's interaction layer with the AUT comprising of webobjects is a chain command's of events. In your case although the naked eye sees the text entered the webedit still in its internal state cannot identify the text. So you will need to wake it up. Try this,

Code:
Browser().page().frame().webedit().Set "abc"
Browser().page().frame().webedit().Click
'..whatever code you have for clciking on button.

I am just suspecting that once the webedit identifys the text it triggers the next event of button_enable. Hope the above works..if it does not then try this as well,

Code:
Settings.Webpackage("ReplayType") = 2
Browser().page().frame().webedit().Set "abc"
Browser().page().frame().webedit().Click
Settings.Webpackage("ReplayType") =1
'..whatever code you have for clciking on button.

Does any of this helps ?