Beispiel #1
0
 public static void afterFeature()
 {
     DownloadReportiumReportLink();
     Console.WriteLine("Report-Url: " + reportingClient.getReportUrl());
     driver.Close();
     driver.Quit();
 }
        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();
        }
Beispiel #3
0
        public void tearDown()
        {
            driver.Close();
            var visioProcesses = Process.GetProcesses().
                                 Where(pr => pr.ProcessName.Contains("visio")); // without '.exe'

            foreach (var process in visioProcesses)
            {
                process.Kill();
            }
        }
        public void DriverQuit(bool forceNoUninstall = false)
        {
            Thread.Sleep(1000);

            try
            {
                if (_deviceTarget.Platform == DevicePlatform.IOs)
                {
                    if (IsBrowser(_packagePath))
                    {
                        AppiumDriver.Close();
                    }
                    else
                    {
                        AppInteraction.CloseApp();
                    }
                    AppiumDriver.Dispose();
                    AppiumDriver.Quit();
                }

                if (_deviceTarget.Platform == DevicePlatform.Android)
                {
                    if (IsBrowser(_packagePath))
                    {
                        AppiumDriver.Close();
                    }
                    else
                    {
                        AppInteraction.CloseApp();
                        if (!String.IsNullOrEmpty(_installedPackageName) && UnInstallOnDriverQuit)
                        {
                            Console.WriteLine("Uninstall app : " + _installedPackageName);
                            AppInteraction.RemoveApp(_installedPackageName);
                        }
                        else
                        {
                            Console.WriteLine("INFO : app not uninstalled !");
                        }
                    }
                    if (!forceNoUninstall)
                    {
                        AppiumDriver.Dispose();
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Beispiel #5
0
 public void TearDown()
 {
     driver.Close();
     driver.Quit();
 }
 public void CloseAppiumDriver(AppiumDriver <AndroidElement> appiumDriver)
 {
     appiumDriver?.Close();
     appiumDriver?.Quit();
 }
 public static void afterFeature()
 {
     Console.WriteLine("Report-Url: " + reportingClient.GetReportUrl());
     driver.Close();
     driver.Quit();
 }
 public void Cleanup()
 {
     // Close and quit WebDriver
     driver.Close();
     driver.Quit();
 }
Beispiel #9
0
 public void CloseTestCase()
 {
     server.respondTo("DELETE", "/window", null);
     driver.Close();
 }