Forum Discussion

asmatullah's avatar
asmatullah
Contributor
10 years ago

Is it necessary to launch application from Tested Apps to get proper objects ?

Hi ,

 

I have change the sequence of test execution and found that TestComplete 11 is not able to get proper objects and hence all test gets failed .Consider the below scenarios :

 

Scenario 1: 

Batch file starts TestComplete .

TestComplete launch application from Tested apps .

Performs test .

Test Execution is successfull .

 

Scenario 2 :

Batch file launch application first and then TestComplete .

Performs tests .

Test Execution failed because proper object is not found .

 

 

  • NisHera's avatar
    NisHera
    Valued Contributor

    Technically there should not be any deference since TC is looking at processes.

    Which is lunched and available.

    But recently I noticed if I launch application manually, TC would not recognize at first time.

     

    Are there user privilage differencec for TC and application?

    Did you try a delay after lunching application?

    • asmatullah's avatar
      asmatullah
      Contributor

       

       

       

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    Hi Asmatullah,

     

    You might consider using script for declaring and make run executables.

    At first I used a lot TestedApps. But as I use same aliases in different projects, it creates problems.

    Now, my TestedApps list is cleared at every test. I do everything by script.

     

    Regards,

     

    Mehdi

    • djadhav's avatar
      djadhav
      Regular Contributor

      Can you post the code that you use to launch the application?

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    sure, (delphi script)

     

    first I clear everything :

      TestedApps.Clear;

     

    then I add the app :

    TestedApps.Add('my path\myapp.exe', '', 1, true, '');
    TestedApps.myapp.Params.SimpleParams.CommandLineParameters:= '/i put all my eventual parameters here';
    TestedApps.myapp.Run;

     

    notice that you won't have the autocompletion for the app 'myapp.exe' but you could "blindly" use its aliases in the script.

    • djadhav's avatar
      djadhav
      Regular Contributor

      I am assuming this code is for scenario 1. Is that correct?

       

      Please post a screenshot of how you are mapping the application in your name mapping.

       

      Put a breakpoint just before the line where you get the 'Object not found' error. Stop the script and see if TestComplete recognizes the application from NameMapping. Post here what you find.

      • m_essaid's avatar
        m_essaid
        Valued Contributor

        djadhav, I cannot post any screenshot of my namemapping.

         

        but it's quite simple.

         

        when I build the scenario, I use alternatively the recorder with a script transcription or I map myself objects.

        the mapping is set to Aliases.MyApp.etc.etc

         

        When I clear all tested apps, and do not have the .exe launched in memory, the autocompletion don't give me anything.

        But when the app is launched, the mapping knows that it's the right app.

        Just by the process name.