Forum Discussion

PingS's avatar
PingS
Occasional Contributor
7 years ago

Imported Keyword test does not work

I am developing some autotest for a web site. All the tests will start from login page and login with user name and password. I planed to have to projects in the project suite: Project A to Project B. In Project A, I recorded a keyword test i to perform the login actions. In Project B, I imported the LoginTest of Project A. Then I created a keyword test (DashBoardTest) in Project B. The first step of the DashBoardTest is to run LoginTest.

 

I run the LoginTest in Project A, it works fine.

 

I run the DashBoard test in Project B, it launched the LoginPage but it can not find the Username input box and then it stops working.

 

This is a simple test to test the importing keyword test from one project to another. But it seems not working well.

What have I missed? I also notice, there is no "Reload" right click menu context. I am using Test Complete 12. How do I refresh the imported test?

  • PingS's avatar
    PingS
    7 years ago

    Thank you very much! I will start to review the 101.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The keyword test is probably referencing name mapped objects.  So, you may have copied the keyword test to the new project but it is dependant upon the NameMapping scheme as well.  Try sharing the name mapping between projects as well.

    • PingS's avatar
      PingS
      Occasional Contributor

      I am new to Test Complete. How do I share the Name mapping? 

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        One of two ways:

        1) Right click on the project and select "Add -> Existing Item" and navigate to the NameMapping.tcNM from Project A and add it to Project B.  The benefit of doing it this way is that, anytime you update object identification in either project, it will immediately update it in the other project.  Requires Project B to not have a pre-existing NameMapping node... can be removed/deleted from the project if you desire to go this route.

         

        2) Right click on the NameMapping node of Project B and select "Merge" then navigate to the NameMapping file from Project A and complete the merge.  The benefit of doing it this way is that you can isolate the NameMapping for the two projects so that changes in one don't affect the other.

         

        On a side note:

        Please find and view a TestComplete 101 webinar... you can attend one live or watch the recording of one.  Either way, this will give you the basics of TestComplete.  NameMapping is one of the core pieces of TestComplete and is the default behavior for object identification.  Everything dealing with onscreen components references NameMapping.  SO, get an understanding of NameMapping and you'll have a good portion of TestComplete known... and the webinars cover a good bit of this.