Searching for SessionId

Ask general questions here.
Eamonn
Posts: 63
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Searching for SessionId

Post by Eamonn » Fri Jun 03, 2016 12:25 pm

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?

Eamonn
Posts: 63
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Re: Searching for SessionId

Post by Eamonn » Fri Jun 03, 2016 4:11 pm

Issue resolved, found System.Web.dll on internet, downloaded to local machine and managed to add the library for my solution.