public void StartStreamingOnRealDevice(string devicemode = null) { SetCapabilities(); RemoteWebDriver(devicemode); MailRepository.ReadEmail("*****@*****.**", "Password@123"); remotedriver.Navigate().GoToUrl(MailRepository.FirstCaller.ElementAt(0)); Thread.Sleep(1000); if (IsDialogPresent(remotedriver)) { IAlert alert = remotedriver.SwitchTo().Alert(); alert.Accept(); } Thread.Sleep(1000); remotedriver.FindElement(By.CssSelector("div#home-buttons > div > button[data-i18n='startStreamButtonText']")).Click(); Thread.Sleep(1000); // Logger.Message("Clicked on Start Button"); if (IsDialogPresent(remotedriver)) { IAlert alert1 = remotedriver.SwitchTo().Alert(); alert1.Accept(); } Thread.Sleep(5000); if (IsDialogPresent(remotedriver)) { IAlert alert1 = remotedriver.SwitchTo().Alert(); alert1.Accept(); } // remotedriver.Quit(); }
public void KMSOperatorLogOff(string devicemode = null) { SetCapabilities(); RemoteWebDriver(devicemode); MailRepository.ReadEmail("*****@*****.**", "Password@123"); remotedriver.Navigate().GoToUrl(MailRepository.FirstCaller.ElementAt(0)); Thread.Sleep(10000); if (IsDialogPresent(remotedriver)) { IAlert alert = remotedriver.SwitchTo().Alert(); alert.Accept(); } Thread.Sleep(3000); remotedriver.FindElement(By.CssSelector("div#home-buttons > div > button[data-i18n='startStreamButtonText']")).Click(); Thread.Sleep(10000); // Logger.Message("Clicked on Start Button"); if (IsDialogPresent(remotedriver)) { IAlert alert1 = remotedriver.SwitchTo().Alert(); alert1.Accept(); } Thread.Sleep(5000); if (IsDialogPresent(remotedriver)) { IAlert alert1 = remotedriver.SwitchTo().Alert(); alert1.Accept(); } remotedriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); Thread.Sleep(7000); logging.KMSLogout(); }
//will need to break this method into two- start first caller stream-> start second caller stream-> stop first caller stream -> stop second caller stream // we can also set different capabilities for second caller //AddStream("*****@*****.**"); //MailRepository.ReadEmail("*****@*****.**", "Password@123"); public void StartAndStopStreamingOnRealDevice1(string devicemode = null, bool heavymedia = false) { SetCapabilities(); RemoteWebDriver(devicemode); MailRepository.ReadEmail("*****@*****.**", "Password@123"); remotedriver.Navigate().GoToUrl(MailRepository.FirstCaller.ElementAt(0)); Thread.Sleep(7000); if (IsDialogPresent(remotedriver)) { IAlert alert = remotedriver.SwitchTo().Alert(); alert.Accept(); } Thread.Sleep(3000); remotedriver.FindElement(By.CssSelector("div#home-buttons > div > button[data-i18n='startStreamButtonText']")).Click(); Thread.Sleep(7000); if (IsDialogPresent(remotedriver)) { IAlert alert1 = remotedriver.SwitchTo().Alert(); alert1.Accept(); } IWebElement stopButton; Thread.Sleep(5000); if (IsDialogPresent(remotedriver)) { IAlert alert1 = remotedriver.SwitchTo().Alert(); alert1.Accept(); } //if (heavymedia) //{ // //for (int i = 0; i < 1; i++) // // { // string text = remotedriver.FindElement(By.CssSelector("div.stop-stream > button[data-i18n='stopStreamButtonText']")).Text; // remotedriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15); // Thread.Sleep(TimeSpan.FromSeconds(15)); // // } //} //else //{ // remotedriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); // Thread.Sleep(7000); //} //VerifyStreamingStatus(); stopButton = remotedriver.FindElement(By.CssSelector("div.stop-stream > button[data-i18n='stopStreamButtonText']")); remotedriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); Thread.Sleep(7000); stopButton.Click(); remotedriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); Thread.Sleep(5000); remotedriver.Quit(); }
public void KMSKillingBrowser(string killer, string devicemode = null) { SetCapabilities(); RemoteWebDriver(devicemode); MailRepository.ReadEmail("*****@*****.**", "Password@123"); remotedriver.Navigate().GoToUrl(MailRepository.FirstCaller.ElementAt(0)); Thread.Sleep(1000); if (IsDialogPresent(remotedriver)) { IAlert alert = remotedriver.SwitchTo().Alert(); alert.Accept(); } Thread.Sleep(3000); remotedriver.FindElement(By.CssSelector("div#home-buttons > div > button[data-i18n='startStreamButtonText']")).Click(); Thread.Sleep(1000); // Logger.Message("Clicked on Start Button"); if (IsDialogPresent(remotedriver)) { IAlert alert1 = remotedriver.SwitchTo().Alert(); alert1.Accept(); } Thread.Sleep(5000); if (IsDialogPresent(remotedriver)) { IAlert alert1 = remotedriver.SwitchTo().Alert(); alert1.Accept(); } remotedriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); Thread.Sleep(1000); //VerifyStreamingStatus(); if (killer.Equals("Operator")) { ExtentReportUtil.report.Log(Status.Info, "Operator killing browser:"); driver.Close(); ExtentReportUtil.report.Log(Status.Info, "Operator browser Killed."); driver.Quit(); new Common().LaunchBrowser("CHROME"); } else { ExtentReportUtil.report.Log(Status.Info, "Caller killing browser:"); remotedriver.Close(); ExtentReportUtil.report.Log(Status.Info, "Caller browser Killed."); remotedriver.Quit(); Wait(5); } }