One of the test method to Create Automated UI for Share Point is:
1. Create the scenario before you attempt to automate the test,it should outline the sequence of steps to complete the operation that we are testing.
2. Record the Web test in the scenario, and then save the Web test.
3. Clean the test environment, and then run the coded test. If the test passes,skip step 4.
4. Create an extraction rule to extract the GUIDs, and then replace the hard-coded GUIDs with the rule. We'lll receive the exception "There is no context parameter with the name …" when you run the recorded test if a GUID needs to be extracted. There might be more than one GUID that needs to be extracted in a test.
5. Generate a coded test for the saved test.
6. Clean the test environment and run the coded test.