Forum Discussion

prabhjot88singh's avatar
prabhjot88singh
Contributor
6 years ago

How to work with Keyword testing and scripting together

Hello Team,

 

Could somene advise on how does Keyword testing and scripting works together in Testcomplete?

 

This means, lets say we have a test case with 10 steps, and first 4 test steps i want to create using keyword tests and final 6 test steps I want to create scripts, then how to order them and put a sequence in Test Complete,.i.e keyword execution first and then script test execution. or vice versa etc.

 

Best,

Prabhjot

  • to bring all the Keyword tests and scripts together, you use the TestItems window on the project level by adding items from both keywords and scripts

    Take a look at the screenshot below to see the combination between the two at the project level for execution

     

    You can also call a Keyword test programmatically from a script like:

    KeywordTests.Test1.Run();

    or call a script from a Keyword Test by using the Call Script operation like in the second screenshot below

     

    Good luck

    -Lino

  • LinoTadros's avatar
    LinoTadros
    Community Hero

    to bring all the Keyword tests and scripts together, you use the TestItems window on the project level by adding items from both keywords and scripts

    Take a look at the screenshot below to see the combination between the two at the project level for execution

     

    You can also call a Keyword test programmatically from a script like:

    KeywordTests.Test1.Run();

    or call a script from a Keyword Test by using the Call Script operation like in the second screenshot below

     

    Good luck

    -Lino

    • prabhjot88singh's avatar
      prabhjot88singh
      Contributor

      Great, thank you.

       

      One quick question, hHOW TO ENABLE testitems window in testcomplete at Project Level,

       

      Currently I am unable to see testitems  window at Project Level, 

      Please share the path where I can enable this,

       

      Best,

      Prabhjot

      • LinoTadros's avatar
        LinoTadros
        Community Hero

        Double click the Project name in the Project Explorer, then you will see the workspace changing and you will be on the Test Items window.  You will the see the name at the bottom of the workspace on the left.

         

        Cheers

        Lino