Forum Discussion

hValentina's avatar
hValentina
New Contributor
14 years ago

Custom-build visual components

Hello. I'm using trial version of your product - TestComplete 8.5.

I have faced with some issues.

UI of your application uses custom-build visual components - similar to context menues and toolbars. Their child elements - button  and menu items - are objects of classes, derived from System.ComponentModel.Component, so they are not Windows or Controls and I can't find them in ObjectBrowser.

I need to emulate user actions with this elements (button clicking, working with menu items etc.)

I use follow script:



  ' Get chilld element

  set showForm=Aliases.TestQA.mainForm.customMenuBar.Items.get_Item(0)

 

 ' Method PerformClick shows form customForm.  

  Call showForm.PerformClick()

 

  ' Then I try fill form's fields.

   Aliases.TestQA.CustomForm.tbInfo.SetText("123")      



But this form blocks script execution, and scrip couldn't fill form's fields(script continues to work only after I close form customForm).



How can I process this form?
  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Valentina,


    The components you are using are not supported by TestComplete. Since they are not Windows or Controls, it will not display them in the Object Browser.


    As far as I can see, you are accessing the needed objects through native methods and properties. This is the right solution in your case. You said that the tested form pauses the script execution. This happens, because the form is modal and you use a native method to display it on the screen. The pause occurs as the method you call - PerformClick - does not exit until the form closes.


    To work around the issue, use the Runner.CallObjectMethodAsync method to call the PerformClick method of your form. This will call your method asynchronously, so it will not block the script execution. See Testing Modal Windows for detailed information on this.


    BTW, what controls are you using? You can vote for them in the TestComplete Feature Survey on the SmartBear web site:

    http://smartbear.com/products/qa-tools/automated-testing/survey/. This way, you will inform the TestComplete team that you need special support for these controls, and perhaps, they will implement it in one of future releases.