Ask a Question

Automatically close or click the ok button of the window that was created using ShowMessage() method

joaobc
Occasional Contributor

Automatically close or click the ok button of the window that was created using ShowMessage() method

Hello, I want autoclose the window that was created by method ShowMessage() from BuiltIn routines. Is there a way to do this? (https://support.smartbear.com/testcomplete/docs/reference/program-objects/builtin/showmessage.html)

 

function TestDialog()
{
   // var i;
   // i = MkSet(mbYes, mbYesToAll, mbNo, mbCancel);
   // i = MessageDlg("Message text", mtConfirmation, i, 0);
   BuiltIn.ShowMessage("Message text")
}

 

 

2021-08-11 10_03_37-TestComplete - D__PSTestComplete_PetroShow.pjs.png

We did some validations through the video instead of checking the log itself, and it would be interesting to have a message at which stage of the test is being executed. But using this method forces some user to click the button. I tried to use the Spy feature, but testcomplete is blocked when window appear, I can only click on the OK and close buttons

Thx

 
2 REPLIES 2
mattb
Staff

Re: Automatically close or click the ok button of the window that was created using ShowMessage() me

Hello,

How is the object identified? Is it considered an overlapping window, an unexpected window? If we classify it as an unexpected window we could use the unexpected window event handler to click ok to continue our test. https://support.smartbear.com/testcomplete/docs/testing-with/running/handling-errors/unexpected-wind... 

joaobc
Occasional Contributor

Re: Automatically close or click the ok button of the window that was created using ShowMessage() me

I cannot inspect the element as I mentioned. I even tried to simulate pressing Enter after the message. But it is not possible to open the spy tool or open the object browser. From the window you either click OK manually or not press pause or stop is possible

cancel
Showing results for 
Search instead for 
Did you mean: