Forum Discussion

blearyeye's avatar
blearyeye
Contributor
14 years ago

Getting children of a .NET form control

I'm using TestComplete 8 on a winform program written in C# 4.0. I'm a newbie to TestComplete and find the learning curve pretty steep.



On
a form F I need to collect all instances of control C so that I can
check their properties. I need to do this repeatedly in the test cycle,
so the code to do it should be a JavaScript function. It needs to be
integrated with a keyword test. I'm told that a template can help, but
not sure how.



What I need is a sample of the JavaScript code and
something of a step-by-step instruction for integrating it into a
keyword test.

6 Replies

  • Hmmm ... long time, no comment. Is this normal?



    Nick Olivos of SmartBear support provided me with the following sample code.



    function findBoxes()

    {

      var dash = Aliases.MyPgm.Dashboard; // Dashboard is a winform

      statusBoxes = dash.FindAllChildren("ClrFullClassName","MyPgm.StatusBox",1) // StatusBox is a control that inherits from Label

      statusBoxes = (new VBArray(statusBoxes)).toArray();

      for (i = 0;i<statusBoxes.length;i++)

      {

        Log.Message(statusBoxes.InstanceNumber); // InstanceNumber is a property of StatusBox

      }

    }
  • Well, that's refreshingly honest.



    Of course, it does bring up the question of why there should be a forum at all. I certainly won't post any more questions to the forum since it seems to be a dead end.



    Other companies, I might add, take a different approach to this kind of forum, using it as a primary way of helping customers solve problems. That lets everyone benefit from the solutions. It also reduces support costs, since I won't ask a question if I find the answer on the forum.
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Bill,



    Just a personal opinion and see my signature for disclaimer details.



    OK, consider it from another side: this forum is the only means of communication, Support weights all postings equally and you are registered customer who works on the project and have some question. You are posting your question to the forum but it appears to be somewhere in the second dozen of other questions asked by product evaluators (definitely, nothing personal as we all were evaluating TestComplete before use it). Will you be happy to wait for all questions asked before yours to be answered? Wouldn't you post then something like 'I already paid my money and would like to get a prompt answer to continue with my project'?



    This forum is very alive one as well as the http://www.sqaforums.com/postlist.php?Cat=0&Board=UBB43&page=0 one and is monitored and answered by AQA's Support on the regular base. It just have the lower priority (you obviously cannot treat more than one resource *completely equally* and this is their right on how to split their efforts) and I think that the guys from Support believe that we, their customers, will consider our requests and dispatch them appropriately. For example, if the problem is not a showstopper and you believe that somebody from the community may help you before the Support and you like to share the problem and its solution with others then you will post here. If the problem is severe and you would like to get more prompt response but from the Support only or if you would like to keep the privacy and do not post for the community, then you will create a Support request. Something like that...



    And the last thing: the two mentioned forums (as well as the now read-only newsgroup at http://www.automatedqa.com/forums/d.cgi?cmd=xover&group=automatedqa.public.testcomplete&utag=) contain an enormous amount of the information posted, asked and discussed during the past decade and are really worth to be searched for the problem/question somebody have.



    Also:

    TC FAQ: http://www.automatedqa.com/support/faq/

    TC How To: http://www.automatedqa.com/support/howto/


  • "Of course, it does bring up the question of why there should be a forum at all."



    I typically look through the forum to see what problems people have run into, and what real-world solutions other customers have offered. I see this place as a user forum that the company replies to frequently, not a company forum that also has user input.



    All in all I've found it pretty useful.
  • To the question of priority ... (a) evaluators should be given priority equal with paid customers. Snubbing them on support is not a good way to turn them into customers. (b) maintaining two channels (direct email for customers, forum for everyone else) means that interesting stuff happens between customers & support engineers that never sees the light of day on the forum.



    As to using the forum for reference ... I'm certainly not averse and since Google indexes the forum I let it find stuff there that might be useful for me.