Splitting Action

We can split an action that is stored with your test into two sibling actions or into parent-child nested actions. When you slit an action, the second action starts with the step that is selected when you perform the split action operation.

When do you split an action in your test that uses a local object repository?

1)    Quick Test makes a copy of the local object repository.
2)    The two actions have identical local object repositories containing all of the objects that were in the original local object repository.
3)    If we add objects to one of the split actions, the new objects are added only to the corresponding local object repository.

Navigation to Split an Action
    Select the step before which you want the new action to begin -> Choose Edit -> Actions -> Split Action -> Choose required options (Independent of each other or Nested) -> modify the name -> Click OK

When Splitting Action is not possible?


Split of action is not possible in following scenarios:
 

1.    An External Action is selected
2.    The first step of an action is selected
3.    while recording test
4.    while running test
5.    Working with read only test.

Script: Write a script to retrieve all Action names
    Set aomObj=CreateObject(“QuickTest.Application”)
    Set aomObjList=aomObj.Test.Actions
    Msgbox aomObjList.Count
    For val=1 to aomObjList.Count
        Msgbox aomObjList(val).Name
    Next


Script: Write a Script to add shared object repository for Action1 during runtime

    Set objAom=CreateObject("QuickTest.Application")
Set objRep=objAom.Test.Actions("Action2").ObjectRepositories
ObjRep.Add "D:\Vamsi\Automation\QTP training\loginflight.tsr"


Script: Write a script to retrieve count all associated shared repository in all actions in a test.
   
    Set aomObj=CreateObject("QuickTest.Application")
cnt1=0
Set aomObjList=aomObj.Test.Actions
msgbox aomObjList.Count
For val=1 to aomObjList.Count
        Set cnt=aomObj.Test.Actions(aomObjList(val).Name).ObjectRepositories
        cnt1=cint1+cnt.Count
Next
msgbox cnt1


Contributed by: Vamshi Gowtham
m.vamsigowtham@gmail.com