SessionGetToken Method | |
Gives a session token for test cases
Namespace:
SIC.Test.Helper
Assembly:
SIC.Test.Helper (in SIC.Test.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax public static Guid GetToken(
string pUser,
string pPassword
)
Public Shared Function GetToken (
pUser As String,
pPassword As String
) As Guid
Parameters
- pUser
- Type: SystemString
User name to log in - pPassword
- Type: SystemString
Password to log in
Return Value
Type:
GuidSession token of type GUID (SOWI standard handling). If login fails then triggers an execption.
Remarks
Requirement: existing App_Data\SOWIApp.sconfig at project directory and set the following settings.
Project file setting: "Includ In Project" (Solution Explorer).
File property "Copy to output Directory" set on "Copy always"
Session for SOWI Test Unit see SessionSetting(String, String)
Examples
A simple log in
Guid SessionToken = SIC.Test.Helper.Session.GetToken("UserName", "Password");
This example has more parts.
First part is declaration of variable and defined the login data
Second part executs login.
string lUserName = "...";
string lPassword = "...";
Guid SessionToken = SIC.Test.Helper.Session.GetToken(lUserName, lPassword);
See Also