Hi All,
Though i call up driver.Quit(); at the end of each test.
i still see browser sessions visible when i execute as a test suite.
Can anyone let me know how in there framework implentation they has dealt with it.
This most often happens when the driver fails to indetify an object & the test fails but the browser session remain.
here's how i have written.
Am on C# WebDriver -Selenium across browsers.
[Test]
public void TestSomething()
{
Drivercontext context = null;
try
{
context = Drivercontext.Create("HomePageTests", BaseModule.GetobjLookup());
HomeModule homeModule = new HomeModule();
homeModule.GetHomepage().FollowUS(context, BaseModule.ObjectLookup["faceBookUI"]);
}finally{
if (context != null){context.Cleanup();}
}
}
my ccleanup () looks like below.
public void Cleanup()
{
Console.WriteLine("CleanUp and quit Driver.....");
if (driver != null)
{
driver.Manage().Cookies.DeleteAllCookies();
// driver.Quit(); //stopping the driver
driver.Dispose();
}
}