Click or drag to resize

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
)

Parameters

pUser
Type: SystemString
User name to log in
pPassword
Type: SystemString
Password to log in

Return Value

Type: Guid
Session 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
//* read Win Session *
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.
//---
// TOSET: login for session

//* user name to login *
string lUserName = "...";

//* password to login *
string lPassword = "...";
//---

//* read session token *
Guid SessionToken = SIC.Test.Helper.Session.GetToken(lUserName, lPassword);
See Also