Forum Discussion

steven_yetter's avatar
steven_yetter
Contributor
2 years ago

TestComplete Windows Keyword Tests Waiting for MessageBox Title or message.txt

In TestComplete, when you wait for a windows message box (or other object/window), you are given a Wizard to pick the object on the application under test, which is convenient.  But it always generates a wait for the messagebox class which is not sufficient.  If there are multiple different possible message boxes, it waits for messagebox1, then messagebox2, then messagebox3.   We want it to wait for a messagebox with a specific title or messagetext.  Any old message box will not do because application winds up out of synch.   Furthermore, the title can be "Export complete for e:\expor\name.csv" and we want it to match on "Export complete for" followed by any path.

 

Is there a way to get past the Wizard and actually give it a value to look for.   (This Wizard based approach also has the downside that when we want to change things we have to go back into the Wizard and pick again.  We can't just alter the text or if we are testing a region image, just replace the image with a file.)

 

Is this a limitation of keyword tests?  Do we need to resort to code/script?  We are using another test tool that easily allows for this kind of messagebox search and does it by default so it makes us wonder how people can get by with this restriction in Test Complete.

17 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    It was possible before TC had the wizards so, yes it is possible without it.  🙂

     

    Let's see the code you are getting from the wizard and see about altering that.

    • steven_yetter's avatar
      steven_yetter
      Contributor

      Thanks  Marsha_R.  Sorry to take so long.  I am struggling to accurately describe my error and I may have misunderstood "let's see the code from the Wizard".   I should have mentioned that our application is a QT application.   I put some screen shots in a document.  I thought I could insert a word document as an attachment.  Now I see I can't'  I think I can use insert photo for a screen shot.

       

      Latest test was that message box came up, but Testcomplete didn't see it, so I assume it timed out.  So I changed the timeout value. (Adding the second column to field chooser).  I had to redefine a test step, which puts me in the Wizard again and I had to use a checkpoint on the QText object of the MessageBox to get it's text.  I am still not sure what your mean by "get the code"

         

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        I would like to see screenshots similar to the one you posted but I want to see the line that is generated by the Wizard and the contents of all the columns.