Test: Automation test is all about taking screenshots of Video and compare with previous one. I am executing this on Virtual machine (VM) - Windows 10 64bit.
Other Browser Status: Chrome and Firefox are working good whether Desktop is locked or un-locked
Issue : This Automation is not working with Microsoft Edge (latest v42.17) when running on locked virtual machine ( (by closing the RDP session). But I can run this Automation successfully if my VM is not locked.
What happened once VM is locked : Automation try to execute few iteration and takes screenshots (which are all black screenshots ). And After sometime it fails the test case.
Two different Scenario of Test we can conclude here:
When VM is not locked and open on my local where we can see execution is in progress - that's passing the test and expected
When VM is locked and can not see any execution since test execution is in progress under locked desktop - test is keep failing (as well as giving us complete black screenshots) which is not expected
Resources I used :
VS 2017 , Selenium v 3.12 ,C# ,Microsoft Edge 42.17134.1.0 , Nunit v3.10.1 , Microsoft Driver v16.16299
Expectation : We should be able to run the test using Microsoft Edge browser on VM (or any Windows 10 ) whether machine is locked (by closing the RDP session) or un-locked
// this is how I am invoking the browser
else if (browser.Equals(Constant.Edge))
{
EdgeOptions options = new EdgeOptions();
driver = new EdgeDriver(DrivePath, options, TimeSpan.FromSeconds(100));
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
}
// Standard approach to click the screenshots of browser
public static string TakeScreenshot(IWebDriver driver, string directory, int imageIndex)
{
string filename = “Screenshot_” + imageIndex.ToString() ;
Screenshot test_Screenshot = ((ITakesScreenshot)driver).GetScreenshot();
var fullPath = directory + “\” + filename + ".Jpeg";
test_Screenshot.SaveAsFile(fullPath, ScreenshotImageFormat.Jpeg);
return fullPath;
}