Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
Test ScriptsBack to Auto Scripts
The script 'Alfresco 1.3 Actions' contains several QTP reusable actions that are used in the automated tests.
These are:
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
Output Parameters: Result
Usage: RunAction 'BSSpaceActions', oneIteration, 'MySpace', 'View Details' , retValue
What it does:
Summary
Performs the specified Space Action on the specified Space Name in the Browse 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 Return values are:
'1' = Space found and Action performed
'0' = Space not found or Action not performed
This 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.
Input Parameters: Content Item, Content Action, Negative Check
Output Parameters: Result
Usage: RunAction 'CIContentActions', oneIteration, 'MyContent', 'View Details' ,, retValue
Usage (negative check): RunAction 'CIContentActions', oneIteration, 'MyContent', 'Check Out' , '0', retValue
What it does:
Summary
Performs the specified Content Action on the specified Content Item in the Browse 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 Return values for a normal (positive) test are:
'1' = 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 found and Action performed (fail)
'0' = Content not found or Action not performed (pass)
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.