I wish to get the 'SessionId' of the Chrome browser instance just opened. I used the following C# code:
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;
string strSessionId = GetSessionId();
}
//get sessionId
public static string GetSessionId()
{
string sessionId = System.Web.HttpContext.Current.Session.SessionID;
string result = sessionId;
return result;
}
I have referenced the System.Web
But I am getting the following error message when I attempt to compile.
Getting error: The type or namespace name 'HttpContext' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) (CS0234) -
When I type System.Web. not getting option for HttpContext in intelliSense.
Please advise on what reference should I use?
Searching for SessionId
Re: Searching for SessionId
Issue resolved, found System.Web.dll on internet, downloaded to local machine and managed to add the library for my solution.