public void SwitchingContexts() { WatsUpUserActions UA = new WatsUpUserActions(); WatsUpUserCheckPoints CP = new WatsUpUserCheckPoints(); try { timer.Restart(); UA.Click_On_Button(WatsUpWelcomePage.termsAndConditionsBtn, CommonActions.LocatorType.byname, "Terms And Conditions", "Terms And Conditions Buttons", 120); testSteps.Add("Successfully clicked on Terms And Conditions"); UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byid, WatsUpWelcomePage.TermaAndConditions.tabSwitcherBtn, "Tab Swicther", 180); testSteps.Add("Successfully waited fot element"); UA.Switching_Contexts(CommonActions.Action.SwitchContext, "WEBVIEW"); testSteps.Add("Successfully switched to WEBVIEW_1"); UA.Click_On_Button(WatsUpWelcomePage.TermaAndConditions.rightMenuBtn, CommonActions.LocatorType.byxpath, "Show Menu", "Show Menu Control"); testSteps.Add("Successfully clicked on Show Menu"); timer.Stop(); ReportLibrary.logResult(ResultStatus.Pass, testSteps, null, null, this.timer.Elapsed.Minutes.ToString() + " Mins"); } catch (Exception ex) { ReportLibrary.logResult(ResultStatus.Fail, testSteps, ex.Message, appiumDriver, this.timer.Elapsed.Seconds.ToString() + " Seconds"); throw ex; } }
public void TapElement() { WatsUpUserActions UA = new WatsUpUserActions(); WatsUpUserCheckPoints CP = new WatsUpUserCheckPoints(); try { timer.Restart(); //UA.Click_On_Button("Terms And Conditions", WatsUpWelcomePage.termsAndConditionsBtn, "Name", "Terms And Conditions Buttons", 120); //testSteps.Add("Successfully clicked on Terms And Conditions"); UA.Click_On_Button(WatsUpWelcomePage.agreeAndContinueBtn, CommonActions.LocatorType.byname, "Agree and continue", "Agree And Continue Button", 120); testSteps.Add("Successfully landed on Country List View"); UA.TapElement(); testSteps.Add("Successfully Taped"); timer.Stop(); ReportLibrary.logResult(ResultStatus.Pass, testSteps, null, null, this.timer.Elapsed.Minutes.ToString() + " Mins"); } catch (Exception ex) { ReportLibrary.logResult(ResultStatus.Fail, testSteps, ex.Message, appiumDriver, this.timer.Elapsed.Seconds.ToString() + " Seconds"); throw ex; } }
public void WebViewAndNativeApp() { CommonUserActions UA = new CommonUserActions(); CommonUserCheckPoints CP = new CommonUserCheckPoints(); try { timer.Restart(); UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byxpath, LinkedInPage.LinkedInHomePage.joinnowBtn, "Join Now", 120); testSteps.Add("Successfully waited for Join Now button"); UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byid, LinkedInPage.LinkedInHomePage.linkedInScreen, "Home Screen", 30); #region Swipe screen left side UA.SwipeActions(CommonActions.Action.SwipeScreenLeft, LinkedInPage.LinkedInHomePage.linkedInScreen, CommonActions.LocatorType.byid); UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byid, LinkedInPage.LinkedInHomePage.linkedInScreen, "Home Screen", 30); UA.SwipeActions(CommonActions.Action.SwipeScreenLeft, LinkedInPage.LinkedInHomePage.linkedInScreen, CommonActions.LocatorType.byid); UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byid, LinkedInPage.LinkedInHomePage.linkedInScreen, "Home Screen", 30); UA.SwipeActions(CommonActions.Action.SwipeScreenLeft, LinkedInPage.LinkedInHomePage.linkedInScreen, CommonActions.LocatorType.byid); UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byid, LinkedInPage.LinkedInHomePage.linkedInScreen, "Home Screen", 30); UA.SwipeActions(CommonActions.Action.SwipeScreenLeft, LinkedInPage.LinkedInHomePage.linkedInScreen, CommonActions.LocatorType.byid); #endregion UA.Click_On_Button(LinkedInPage.LinkedInHomePage.joinnowBtn, CommonActions.LocatorType.xpath, "Join Now", "Join Now"); testSteps.Add("Successfully clicked on Join Now button"); UA.WaitAction(CommonActions.Wait.TimeWait, CommonActions.LocatorType.emptyLocatorType, string.Empty, string.Empty, 120); testSteps.Add("Successfully implimented Implicit Wait"); UA.GetText(CommonActions.Action.GetText, LinkedInPage.LinkedInRegistration.browserURL, CommonActions.LocatorType.byid, "URL"); //UA.Switching_Contexts(CommonActions.Action.SwitchToDefaultContext, string.Empty); //testSteps.Add("Successfully switched from Native App"); //UA.Switching_Contexts(CommonActions.Action.SwitchContext, "WEBVIEW_com.android.browser"); //testSteps.Add("Successfully switched from Native App to WEBVIEW App"); ////UA.Switching_Contexts(CommonActions.Action.SwitchContext, "WEBVIEW"); //testSteps.Add("Successfully switched from Native App to WEBVIEW App"); //UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.name, LinkedInPage.LinkedInRegistration.lastNameTxt, "Last Name", 120); ////UA.Enter_Text(CommonActions.LocatorType.name, LinkedInPage.LinkedInRegistration.firstNameTxt, "First Name", "Praveenreddy"); ////UA.Enter_Text(CommonActions.LocatorType.name, LinkedInPage.LinkedInRegistration.lastNameTxt, "Last Name", "Narala"); ////UA.Enter_Text(CommonActions.LocatorType.id, LinkedInPage.LinkedInRegistration.emailTxt, "Email", "*****@*****.**"); timer.Stop(); ReportLibrary.logResult(ResultStatus.Pass, testSteps, null, null, this.timer.Elapsed.Minutes.ToString() + " Mins"); } catch (Exception ex) { ReportLibrary.logResult(ResultStatus.Fail, testSteps, ex.Message, appiumDriver, this.timer.Elapsed.Seconds.ToString() + " Seconds"); throw ex; } }
public void TestApp() { CommonUserActions UA = new CommonUserActions(); CommonUserCheckPoints CP = new CommonUserCheckPoints(); try { timer.Restart(); UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byname, LinkedInPage.TestApp.buttonStartWebviewCD, "Chrome Button", 120); UA.Click_On_Button(LinkedInPage.TestApp.buttonStartWebviewCD, CommonActions.LocatorType.byname, "Chrome", "ChromeBtn"); UA.Switching_Contexts(CommonActions.Action.SwitchContext, "WEBVIEW"); //UA.GetControlText(CommonActions.Action.GetURL, CommonActions.LocatorType.emptyLocatorType); UA.Enter_Text(CommonActions.LocatorType.byid, LinkedInPage.TestApp.nameTxt, "Testing", "Testing"); timer.Stop(); ReportLibrary.logResult(ResultStatus.Pass, testSteps, null, null, this.timer.Elapsed.Minutes.ToString() + " Mins"); } catch (Exception ex) { ReportLibrary.logResult(ResultStatus.Fail, testSteps, ex.Message, appiumDriver, this.timer.Elapsed.Seconds.ToString() + " Seconds"); throw ex; } }