Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
Test ScriptsBack to Auto Scripts
The script 'Alfresco 1.4 Actions' contains several QTP reusable actions that are used in the automated tests.
There are some new actions:
Some actions have been changed slightly:
Input Parameters: URL to Alfresco
Output Parameters: none
Usage: RunAction 'LoginAsAdmin', oneIteration, 'http:<url to alfresco>'
What it does:
Summary
Loads up IE, connects to the URL passed and logs in as Admin.
Detail
Input Parameters: None
Output Parameters: None
Usage: RunAction 'CreateTestUser', oneIteration
What it does:
Summary
Creates a User called 'Test User' with a home space of 'TestUser' and login details of username = 'Test' and password = 'User'
Detail
Assumes that Alfresco is logged in as Admin (use the LoginAsAdmin action)
Input Parameters: None
Output Parameters: None
Usage: RunAction 'Cleanup', oneIteration
What it does:
Summary
Removes the Test User and deletes their Home Space.
Detail
Input Parameters: Item Name, Clipboard action
Output Parameters: None
Usage: RunAction 'ClipboardActions', oneIteration, 'CopySpace', 'Paste Item'
What it does:
Summary
Locates the Item in the Clipboard that matches the passed in Item Name and clicks on the matching Clipboard action for that item. E.g, using above example, finds the Item called 'CopySpace' and clicks the 'Paste Item' action.
Detail
Input Parameters: Space Name, Space Action, Negative Check
Output Parameters: Result
Usage (check that the space Exists): RunAction 'BSSpaceActions', oneIteration, 'MySpace', 'Exist' ,, retValue
Usage (Click on the space to navigate into it) : RunAction 'BSSpaceActions', oneIteration, 'MySpace', 'Click' ,, retValue
Usage (click the 'View Details' action): RunAction 'BSSpaceActions', oneIteration, 'MySpace', 'View Details' ,, retValue
Usage (check that the space does not have a discussion): RunAction 'BSSpaceActions', oneIteration, 'MySpace', 'View Discussions' ,'0', retValue
What it does:
Summary
Performs the specified Space Action on the specified Space Name in the Icon View (the default view), and returns the Result. The action will attempt to find the specified Space Name on the page and if it can't be found it will navigate to the next page (if there are
any) until it either finds the Space Name or get's to the end of the spaces.
E.g click the View Details action on the space MySpace.
Detail
This action uses descriptive programming to locate the Space. The reason behind this is that the Actions for spaces are identifiable (e.g. 'View Details'), but they are not unique - there is one for every space shown in the Browse Spaces display.
However, the Spaces and their Actions are all contained within their own WebTable within the Browse Spaces table.
See this image for an example:
So, if we want to perform an action on the CutSpace we are interested in working on the WebTable that contains the CutSpace space.
The WebTable is named after the Space it is for, so for the above example the WebTable is called 'CutSpace'. So, we can find this WebTable knowing the Space Name we are looking for, without it having to reside in the Object Repository.
Once we have located the correct WebTable, to perform an action on it we need to get some details about the Cells that are in the WebTable, namely the Cell that contains the Actions. As you can see from the image below, the Actions are contained in the Cell that is in the last Row (can be Row 3 or Row 4 if the Space has a Description) and the last Column (currently always column 2).
With this information, we can get the list of Images in the Cell that contains the Actions. The Images all have defined ALT text that matches the Action, so we can just itterate through the Images until we find one whose ALT text matches the required Space Action and Click on it.
However, the Actions contained in the More dropdown menu are all Links with associated Images, but the Images are not Clickable - only the Links are. So, if we have got to the More menu Image before we have found the Action we want to perform, the More menu is opened and then the list of Links are obtained.
These Links are again named after the Action they are for, so these are itterated through until a match is found and this is Clicked on.
If no match is found an error is logged in the test results.
The action checks at the start to ensure that the Browse Space view is on the first page of Spaces, and if not navigates back to the first page.
The 'Space Action' that can be performed are:
The action passed in to be performed must match the 'alt text' of the action image, or the text of the action link. Any future actions added to Spaces will automatically be usable from this test.
The Return values for a normal (positive) test are:
'1' = Space found, or Space found and Action performed (pass)
'0' = Space not found or Action not performed (fail)
The Return values for a negative test are are:
'1' = Space not found or Action not performed (pass)
'0' = Space found, or Space found and Action performed (fail)
Input Parameters: Content Item, Content Action, Negative Check
Output Parameters: Result
Usage (check that the content exists): RunAction 'CIContentActions', oneIteration, 'MyContent', 'Exist' ,, retValue
Usage (view the content) : RunAction 'CIContentActions', oneIteration, 'MyContent', 'Click' ,, retValue
Usage (click View Details): RunAction 'CIContentActions', oneIteration, 'MyContent', 'View Details' ,, retValue
Usage (check that 'Check Out' is not available): RunAction 'CIContentActions', oneIteration, 'MyContent', 'Check Out' , '0', retValue
What it does:
Summary
Performs the specified Content Action on the specified Content Item in the Icon View (the default view), and returns the Result.
The action will attempt to find the specified Content Item on the page and if it can't be found it will navigate to the next page (if there are any) until it either finds the Content Item or get's to the end of the spaces. If it detects that it isn't starting its search on the first page it will navigate to the first page before it starts looking for the Content Item.
If a Negative check is performed it will return a pass if either the Content Item or the requested Action is NOT found (e.g. so that Locked documents can be checked to ensure they do not have the Actions that a non-locked document will have such as 'check out', or to check that the 'Working Copy' no longer exists after a 'Check In')
E.g click the Check Out action on the Content Item 'MyContent'.
Detail
This action uses the descriptive programming techniques described in the 'BSSpaceActions' reusable action.
The 'Content Action' that can be performed are:
The action passed in to be performed must match the 'alt text' of the action image, or the text of the action link. Any future actions added to Content will automatically be usable from this test.
The Return values for a normal (positive) test are:
'1' = Content found, or Content found and Action performed (pass)
'0' = Content not found or Action not performed (fail)
The Return values for a negative test are are:
'1' = Content not found or Action not performed (pass)
'0' = Content found, or Content found and Action performed (fail)
Input Parameters: Space Name, Space Title, Space Description, Space Icon, Negative Check
Output Parameters: None
Usage: RunAction 'CreateSpace', oneIteration, 'TestSpace', 'I am a title', 'I am a description','space-icon-star'
Usage (negative check): RunAction 'CreateSpace', oneIteration, 'TestSpace', 'I am a title', 'I am a description' ,,'0'
What it does:
Summary
Creates a Space using the information provided
Detail
Creates a Space using the information provided. Sets the space name to the 'Space Name' parameter, the title to the 'Space Title' parameter, the description to the 'Space Description' parameter and the icon to the 'Space Icon' paremeter.
The available choices for the Space Icon are:
The 'Negative Check' parameter specifies whether the space creation is completed or cancelled - default is completion but specifying '0' will cancel the space creation.
Input Parameters: Content Action, Action To Perform, Action Check
Output Parameters: Result
Usage (check that the 'Check Out' action exists): RunAction 'DContentActions', oneIteration, 'Check Out', 'Exist'
Usage (Click the 'Create Shortcut' action): RunAction 'DContentActions', oneIteration, 'Create Shortcut', 'Click'
Usage (check that the 'Check In' action does not exist): RunAction 'DContentActions', oneIteration, 'Check In', 'Exist', '0', retValue
What it does:
Summary
Within the Document Details screen for an item of content, this will look for the 'Content Action' (e.g. Check Out) and perform the action upon it specified by 'Action To Perform' (e.g. Exist, or Click). Exist will check to see if the Action exists, and Click will click the specified Content Action. Specifying an Action Check of '0' will check that the Action does not Exist and can not be Clicked.
Detail
The test aquires the list of Actions present on the Document Details screen and attempts to match the Content Action specified to the list of Actions. If it finds a match it will perform the 'Action To Perform' on the matching Action.
The 'Content Action' that can be performed are:
The 'Action To Perform' that can be performed are:
The action passed in to be performed must match the 'text' of the action link. Any future actions added to Content will automatically be usable from this test.
The Return values for a normal (positive) test are:
'1' = Action found, or Action found and Action performed (pass)
'0' = Action not found or Action not performed (fail)
The Return values for a negative test are are:
'1' = Action not found or Action not performed (pass)
'0' = Action found, or Action found and Action performed (fail)
Input Parameters: Space Action, Action To Perform, Action Check
Output Parameters: Result
Usage (check that the 'Delete' action exists): RunAction 'DSpaceActions', oneIteration, 'Delete', 'Exist'
Usage (Click the 'Manage Space Users' action): RunAction 'DSpaceActions', oneIteration, 'Manage Space Users', 'Click'
Usage (check that the 'Take Ownership' action does not exist): RunAction 'DSpaceActions', oneIteration, 'Take Ownership', 'Exist', '0', retValue
What it does:
Summary
Within the Space Details screen for a Space, it will look for the 'Space Action' (e.g. Take Ownership) and perform the action upon it specified by 'Action To Perform' (e.g. Exist, or Click). Exist will check to see if the Action exists, and Click will click the specified Space Action. Specifying an Action Check of '0' will check that the Action does not Exist and can not be Clicked.
Detail
The test aquires the list of Actions present on the Space Details screen and attempts to match the Content Action specified to the list of Actions. If it finds a match it will perform the 'Action To Perform' on the matching Action.
The 'Space Action' that can be performed are:
The 'Action To Perform' that can be performed are:
The action passed in to be performed must match the 'text' of the action link. Any future actions added to Spaces will automatically be usable from this test.
The Return values for a normal (positive) test are:
'1' = Action found, or Action found and Action performed (pass)
'0' = Action not found or Action not performed (fail)
The Return values for a negative test are are:
'1' = Action not found or Action not performed (pass)
'0' = Action found, or Action found and Action performed (fail)