Forum Discussion

Dewayne_Pinion's avatar
Dewayne_Pinion
Contributor
11 years ago
Solved

Can't click button on pop up form

Greetings,

I am using the scripting instead of keyword for testing. I am trying to click a button that is on a pop up form, but I receive an error:



Object doesn't support this property or method: 'M3_AKShell.frmValidationFailureMessageBox.tlpmsgbox.btnOk'

Error location:

Unit: "M3 Automation\M3 Automation\Script\test"

Line: 24 Column: 3.



Looking through the forums, I went ahead and identified ClsFullName:



M3.CustomControls.M3Button



I realize this is a custom button, so I tried object mapping using the full CLSFullName as a class name as well as just btnOK.



None of these have worked so far. I need to be able to click this button to continue. Is there any other route I can go to have testcomplete click the button?
  • When you use the object spy on the button it is called: M3_AKShell.frmValidationFailureMessageBox.tlpmsgbox.btnOk



    to click on it use:

    M3_AKShell.frmValidationFailureMessageBox.tlpmsgbox.btnOk.click()
  • When you use the object spy on the button it is called: M3_AKShell.frmValidationFailureMessageBox.tlpmsgbox.btnOk



    to click on it use:

    M3_AKShell.frmValidationFailureMessageBox.tlpmsgbox.btnOk.click()
  • Hi Dewayne,

    Do you think the problem is that the object can't be found or what you are trying to do with the object is not allowed?



    Looking at the error, it appears to have found the object.  I am guessing that a click method is trying to be run.  The error message maybe indicating that their is no click method on the object btnOK.  Now that seems really strange to me, but the error message is more about trying to do something with the object rather than trying to find it.



    Check to see what the code at is doing at Line 24 and check to ensure that the action is allowed for the object.  Then work on the problem from there.
  • Hey Adrian,



    Thanks for your response. It seems it can't find the control at all, if I am understanding this right... Here is what I have tried:



    M3_AKShell.frmValidationFailureMessageBox.tlpmsgbox

    ^ TestComplete passes by this line without failure



    M3_AKShell.frmValidationFailureMessageBox.tlpmsgbox.btnOk

    ^ Receives an "Object doesn't support this propert or method" error



    M3_AKShell.frmValidationFailureMessageBox.tlpmsgbox.btnOk

    ^ Same error