public static void PerfectoCloseConnection(AppiumDriver <IWebElement> driver) { string model = "unknown"; try { //get our model and executionId before we close driver model = GetDeviceModel(driver); String executionId = GetExecutionId(driver); StopStartedVitals(); driver.Close(); Dictionary <String, Object> param = new Dictionary <String, Object>(); driver.ExecuteScript("mobile:execution:close", param); string currentPath = TestRunLocation; //Directory.GetCurrentDirectory(); string newPath = Path.GetFullPath(Path.Combine(currentPath, @"..\..\..\RunReports\")); driver.DownloadReport(DownloadReportTypes.pdf, newPath + "\\" + model + " " + TestCaseName + " report"); //driver.DownloadAttachment(DownloadAttachmentTypes.video, newPath + "\\" + model + " " + TestCaseName + " video", "flv"); //driver.DownloadAttachment(DownloadAttachmentTypes.image, "C:\\test\\report\\images", "jpg"); LogDeviceExecution(executionId); } catch (Exception ex) { HandleGeneralException(ex, model, false); } driver.Quit(); }