When I start to use Visual Studio Web Performance Test to do automate test to my SharePoint tenant, I face a problem. The VsWebTest capture Guids and unable to detect dynamic content properly. The main issue especially happens during Authentication process. This problem makes my test project is not reusable for other tenant, and I have to records the steps and recreate the steps from begining everytime I need to create a test.
The solution is to decode Authentication process and store in common SpoLogin.webtest. Then I can include the SpoLogin.webtest in the begining of every future test for SharePoint. The SpoLogin.webtest will handle authentication process, and provide authentication cookie for the rest of the test.
- Login using Microsoft Live is now supported through Coded Web Performance Test
-
Declarative SpoLogin.WebTest (Only support AAD Login)
Create new webtest using Web Performane test recording, after finishing the recording, you can replace the authentication part using SpoLogin.WebTest. Right click on the new web test, and select "Add Call to a Web Test". -
Coded Web Test (Support AAD Login and Federated Login such as Windows Live)
Create a new webtest class that inherits fromMicrosoft.VisualStudio.TestTools.WebTesting.WebTest
. Decorate the new class with[IncludeCodedWebTest("Spo.WebTest.SpoLogin", @"SpoLogin.cs")]
Implement abstract methodGetRequestEnumerator()
and callSpoLogin
from the method.
- ExampleWebTest - shows how to use SpoLogin in coded web test.
- Tenant - SharePoint online tenant name for example "libinuko" for libinuko.sharepoint.com
- UserName - Full email address of the username. For example [email protected]
- UserPassword - You know this.
- Log the issue or contact me directly.