Forum Discussion

jimbot1981's avatar
jimbot1981
Occasional Contributor
14 years ago

Closing Excel when running keyword tests

Hi,  i am fairly new to using Test Complete 7, i have been tasked with providing smoke tests for our Delphi app, there are around 90 reports that the app produces and each report can be exported to excel or via a PDF format. I have been recording keyword scripts which seem to be opening up the reports when i click on the excel icon, excel fires up ok and the report is displayed in Excel. I then close excel and stop the recording. When i re run the script by pressing the green play button the report fires off, excel opens, report is displayed. the test finsihes but the report stays open in excel.



Any ideas what i am doing wrong?

thanks

4 Replies


  • Hi James,





    Please make sure that the recorded test contains operations that close Excel, and that these operations are executed during the playback.





    If you cannot find out what happens in your case, please execute your test, pack the entire project suite folder, and send us the archive directly via the Contact Support form. We will look into your test.
  • jimbot1981's avatar
    jimbot1981
    Occasional Contributor
    Hi David,



    When  you say make sure that  the recorded test contains operations that close excel, during the recording of the script i have closed excel using right click close, closing on the X in the top right hand corner. I have noticed that the Excel window and Report Viewer window seem to deactivate (the tool bar changes from blue to grey), not sure if this has anything to do with excel not closing. The steps in the script do mention CloseExcel so i presume it is trying. I am also using two monitors. Would this affect the closing?

    Thanks



    james
  • jimbot1981's avatar
    jimbot1981
    Occasional Contributor
    Hi, i have tried again excel still doesn't close on playback however i do get a failure:-



    The Object Does Not Exist



    An error occurred when executing the "Close" method or property of the
    "NetUIHWND" object.

    The object or one of its parent objects was not found in
    the system.



    Tested Object

    ------------------

    Alias:
    Aliases.EXCEL.wndXLMAIN.EXCEL2.tb_Ribbon.Ribbon.NUIPane.NetUIHWND

    Mapping
    item:
    NameMapping.Sys.EXCEL.wndXLMAIN.EXCEL2.tb_Ribbon.Ribbon.NUIPane.NetUIHWND



    Missing
    Object

    ------------------

    Alias: Aliases.EXCEL

    Mapping item:
    NameMapping.Sys.EXCEL



    Any ideas?

    Thanks James

  • Hi James,





    It seems that TestComplete cannot find the Excel process by its mapped name. I would appreciate it if you reproduced the problem, packed the entire project suite folder, and sent me the archive via the Contact Support form.