Forum Discussion

Desktopapptesti's avatar
Desktopapptesti
Occasional Contributor
3 years ago

BtnOK is not responding on click

Hi Everyone, 

I am fairly new to TestComplete. So, I have the btnOK button  on a pop up window. The object is identified and mapped correctly. The button works when I click on it manually or through keyword testing but not through script testing. 

 

ButtonOK= NameMapping.Sys.NLS.dlgTransactionEntry.Window("Button", "OK", 6)
ButtonOK.ClickButton()
#if ButtonOK.Exists:
# ButtonOK.Keys("Space")
# ButtonOK.Keys("Enter")
# ButtonOK.ClickButton()
# else:
# Log.Message("button doesnt exists") 

 

or 

transaction_okay_btn = Aliases.dlgTransactionEntry.btnOK
Aliases.dlgTransactionEntry.btnOK.VisibleOnScreen
if (Aliases.dlgTransactionEntry.btnOK.WaitProperty("VisibleOnScreen", True, 2000)):
Log.Message("button is active")
transaction_okay_btn.ClickButton()

 

I tried deleting the button and adding it again. To avoid any conflict.  I used Visibleonscreen and keys(enter)  as suggested in posts. Nothing works. Any suggestions would be appreciated. 

 

Thank you.