public void ValidateUsageStatistics(bool isON) { var switchUsageStatistics = KeywordImplementation.UIObject(By.Id("toggleButton"), TimeSpan.FromSeconds(1)); if ((isON.Equals(true) && switchUsageStatistics.Text.Equals("On")) || (isON.Equals(false) && switchUsageStatistics.Text.Equals("Off"))) { Logger.logSuccess("Usage statistics is " + switchUsageStatistics.Text); } else { Logger.logFailure("Usage statistics is " + switchUsageStatistics.Text); } Logger.logSnapshot(); }
public void ValidateMuteUnmute(bool on) { string message = null; if (KeywordImplementation.UIObject(By.Id("btnVolumeMute")).GetAttribute("selected").Equals(Convert.ToString(on), StringComparison.CurrentCultureIgnoreCase)) { message = on?"HI is Mute ":"HI is Unmute"; Logger.logSuccess(message); } else { message = on?"HI is Unmute":"HI is Mute "; Logger.logFailure(message); } }
public void TapOnRecommendedHearingAid(string objectName) { var size = Accessor.getDriver().Manage().Window.Size; int starty = (int)(size.Height * 0.50); int endy = (int)(size.Height * 0.20); int startx = size.Width / 2; int count = 0; while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Txt_HIRecommended"), TimeSpan.FromSeconds(1)))) { ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500); count++; } KeywordImplementation.Click(By.Name(objectName)); }
public void ValidateUsageStatistics(bool isON) { string message = null; var switchUsageStatistics = KeywordImplementation.UIObject(By.Id("switchSettingUsage"), TimeSpan.FromSeconds(1)); if ((isON.Equals(true) && (switchUsageStatistics.GetAttribute("value").Equals("1") || switchUsageStatistics.GetAttribute("value").Equals("true"))) || (isON.Equals(false) && (switchUsageStatistics.GetAttribute("value").Equals("0") || switchUsageStatistics.GetAttribute("value").Equals("false")))) { message = isON? "Usage statistics is On" :"Usage statistics is Off"; Logger.logSuccess(message); } else { message = isON? "Usage statistics is Off":"Usage statistics is On"; Logger.logFailure(message); } }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { //Set HI names based on brand of APP BrandBasedHINames(); string applicationName = TestSuite.Current.Parameters["AppName"]; // string appActivity="md56f35e8d86ebdc1429f36073ae400eed3.SplashActivity"; string appPath = TestSuite.Current.Parameters["AppPath"]; KeywordImplementation.LaunchiOSApp(new Uri("http://" + TestSuite.Current.Parameters["Uri"] + ":4723/wd/hub"), TestSuite.Current.Parameters["Device"], applicationName, appPath); //KeywordImplementation.LaunchiOSApp(new Uri("http://"+TestSuite.Current.Parameters["Uri"]+":4723/wd/hub"),TestSuite.Current.Parameters["Device"],applicationName,appPath); if (KeywordImplementation.waitForObjectExist(By.Id("OK"), TimeSpan.FromSeconds(5))) { KeywordImplementation.Click(By.Id("OK")); } }
public static Image CaptureSnapshot(By by) { Bitmap savedImage = null; Rectangle section = Rectangle.Empty; // if(Accessor.driverIsForIOS()) // if(TestSuite.Current.Parameters["isTablet"].Equals("True",StringComparison.CurrentCultureIgnoreCase)) // if(!TestSuite.Current.Parameters["Version"].Equals("10",StringComparison.CurrentCultureIgnoreCase)) // ((IOSDriver<IOSElement>)Accessor.getDriver()).Orientation=ScreenOrientation.Landscape; // if(Accessor.driverIsForIOS()) // if(!TestSuite.Current.Parameters["Version"].Equals("10",StringComparison.CurrentCultureIgnoreCase)) // ((IOSDriver<IOSElement>)Accessor.getDriver()).Orientation=ScreenOrientation.Landscape; if (by != null) { var elem = KeywordImplementation.UIObject(by); var size = elem.Size; var x = elem.Location.X; var y = elem.Location.Y; //((IOSDriver<IOSElement>)Accessor.getDriver()).Rotate(ScreenOrientation.Landscape); Bitmap source = new Bitmap(getSnapshotFileInfo(Accessor.getDriver()).ToString()); if (Accessor.driverIsForIOS()) { var width = Accessor.getDriver().Manage().Window.Size.Width; if (width == 414) { section = new Rectangle(x * 3, y * 3, size.Width * 3, size.Height * 3); } else { section = new Rectangle(x * 2, y * 2, size.Width * 2, size.Height * 2); } } else { section = new Rectangle(x, y, size.Width, size.Height); } savedImage = CropImage(source, section); } else { savedImage = new Bitmap(getSnapshotFileInfo(Accessor.getDriver()).FullName); } return(savedImage); }
public void ValidateSliderSteps() { string [] sliderSteps = null; for (int i = 0; i < 16; i++) { KeywordImplementation.Click(By.Id("imgViewVolumeUp")); } sliderSteps = KeywordImplementation.UIObject(By.Id("seekBarVolume")).GetAttribute("name").Split('_'); if ((sliderSteps[1].Equals(sliderSteps[2])) && (sliderSteps[2].Equals("15"))) { Logger.logInfo("Volume slider has 16 steps", true); } else { Logger.logFailure("Volume slider does not have 16 steps", false); } }
public void ScrollUp() { var size = Accessor.getDriver().Manage().Window.Size; //Swipe from Bottom to Top and Top to bottom //Find swipe start and end point from screen's width and height. int starty = (int)(size.Height * 0.50); int endy = (int)(size.Height * 0.20); int startx = size.Width / 2; int count = 0; while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Accept & Continue"), TimeSpan.FromSeconds(1)))) { ((IOSDriver <IOSElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500); count++; } }
public void EditNotes(string notes) { Logger.logInfo("Edit the notes field"); KeywordImplementation.Click(By.Id("Notes")); KeywordImplementation.TypeText(By.Id("Txtnotes"), notes); if (TestSuite.Current.Parameters["Version"].Equals("10", StringComparison.CurrentCultureIgnoreCase)) { KeywordImplementation.Click(By.XPath("//XCUIElementTypeOther/XCUIElementTypeButton[contains(@name,'Done')]")); } else if (TestSuite.Current.Parameters["Version"].Equals("9", StringComparison.CurrentCultureIgnoreCase)) { KeywordImplementation.Click(By.XPath("//UIAWindow[2]//UIAButton[contains(@name,'Done')]")); } else { KeywordImplementation.Click(By.XPath("//UIAScrollView//UIAButton[contains(@name,'Done')]")); } }
public void ValidateContentsContains(string contents, bool isFound) { string[] contentsArray = contents.Split(';'); var size = Accessor.getDriver().Manage().Window.Size; /*****************************/ //Swipe from Bottom to Top //Find swipe start and end point from screen's width and height. int starty = (int)(size.Height * 0.50); int endy = (int)(size.Height * 0.20); int startx = size.Width / 2; foreach (string str in contentsArray) { bool check = false; int count = 0; while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@value,'" + str + "')]"), TimeSpan.FromSeconds(1)))) { ((IOSDriver <IOSElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 50); count++; } if (KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@value,'" + str + "')]"), TimeSpan.FromSeconds(1))) { check = true; } string message = null; if (check == isFound) { message = isFound?string.Format("Information '{0}' text has found", str):string.Format("Information '{0}' text has not found", str); Logger.logSuccess(message); } else { message = isFound?string.Format("Information '{0}' text has not found", str):string.Format("Information '{0}' text has found", str); Logger.logFailure(message); } } Logger.logSnapshot(); }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; string applicationName = TestSuite.Current.Parameters["AppName"]; string appActivity = "md5887522972be76f398b6ce0dd53353466.MainActivity"; //appActivity="md56f35e8d86ebdc1429f36073ae400eed3.SplashActivity"; KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"], applicationName, appActivity); if (KeywordImplementation.waitForObjectExist(By.Name("Skip"), TimeSpan.FromSeconds(15))) { KeywordImplementation.Click(By.Name("Skip")); } Report.Info(TestSuite.Current.Parameters["Device"]); }
public void ValidateMuteUnmute(bool muteUnmute) { string message = null; var buttonMuteUnmute = KeywordImplementation.UIObject(By.Id("MuteUnmuteButton"), TimeSpan.FromSeconds(1)); if (buttonMuteUnmute.GetAttribute("label").Equals(muteUnmute.ToString(), StringComparison.CurrentCultureIgnoreCase)) { message = muteUnmute?"HI is mute":"HI is unmute"; Logger.logSuccess(message); } else { message = muteUnmute?"HI is unmute":"HI is mute"; Logger.logFailure(message); } // Logger.logFailure("HI is "+muteUnmute); // if(KeywordImplementation.UIObject(By.Id("MuteUnmuteButton")).GetAttribute("label").Equals(muteUnmute,StringComparison.CurrentCultureIgnoreCase)) // Logger.logSuccess("HI is "+muteUnmute); // else // Logger.logFailure("HI is "+muteUnmute); }
public void ValidateContents(string contents) { string[] contentsArray = contents.Split(';'); foreach (string str in contentsArray) { bool check = false; //KeywordImplementation.SwipeVerticle(3,0.60,0.20,By.Name(str)); KeywordImplementation.SwipeVerticle(3, 0.60, 0.20, By.XPath("//*[contains(@text,'" + str + "')]")); if (KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@text,'" + str + "')]"), TimeSpan.FromSeconds(1))) { check = true; Logger.logSuccess(string.Format("Information '{0}' text has found", str)); } if (!check) { Logger.logFailure(string.Format("Information '{0}' text has not found", str)); } } Logger.logSnapshot(); }
public void ValidateContentsWithContentDesc(string objectName, bool isFound) { int swipeCnt = 0; bool check = false; string[] validationObjectArray = objectName.Split(';'); foreach (string obj in validationObjectArray) { while (swipeCnt != 3) { if (KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@content-desc,'" + obj + "')]"), TimeSpan.FromSeconds(1))) { check = true; break; } if (!check) { KeywordImplementation.SwipeVerticle(swipeCnt, 0.50, 0.20, By.XPath("//*[contains(@content-desc,'" + obj + "')]")); swipeCnt++; } else { break; } } string message = null; if (check == isFound) { message = isFound?string.Format("'{0}' is found", obj):string.Format("'{0}' is not found", obj); Logger.logSuccess(message); } else { message = isFound?string.Format("'{0}' is not found", obj):string.Format("'{0}' is found", obj); Logger.logFailure(message); } } Logger.logSnapshot(); }
public void ValidateRateOurApp(string AppRate, bool isPopup, int runCount) { //bool check=false; for (int i = 1; i <= runCount; i++) { StartApp(false); Logger.logInfo(string.Format("{0} Run of App", i)); if (isPopup.Equals(true)) { if (i == runCount && KeywordImplementation.waitForObjectExist(By.Name("Rate our app"), TimeSpan.FromSeconds(2))) { Logger.logSuccess(string.Format("Rate the app pop-up found at {0}th iteration", i), true); ValidateContents("Not now;No rating;Rate the App Now"); KeywordImplementation.Click(By.Name(AppRate)); // check=true; break; } else if (i == runCount && !KeywordImplementation.waitForObjectExist(By.Name("Rate our app"), TimeSpan.FromSeconds(2))) { Logger.logFailure("Rate the app - automatic pop-up not found"); break; } } else if (isPopup.Equals(false)) { if (KeywordImplementation.waitForObjectExist(By.Name("Rate our app"), TimeSpan.FromSeconds(2))) { Logger.logFailure(string.Format("Rate the app - automatic pop-up found at {0} itteration", i)); break; } else if (i == runCount) { Logger.logSuccess("Rate the app - automatic pop-up not found"); } } CloseApp(); } }
public void VerifyTextHighlighted(string objectName) { //Logger.logWarn("Information has to be added to identify highlighted text"); var size = Accessor.getDriver().Manage().Window.Size; int starty = (int)(size.Height * 0.50); int endy = (int)(size.Height * 0.20); int startx = size.Width / 2; int count = 0; while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Name(objectName), TimeSpan.FromSeconds(1)))) { ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500); count++; } if (KeywordImplementation.UIObject(By.Id("Active Step")).GetAttribute("value").Equals(objectName, StringComparison.CurrentCultureIgnoreCase)) { Logger.logSuccess(string.Format("'{0}' is highlighted", objectName)); } else { Logger.logFailure(string.Format("'{0}'is not highlighted", objectName)); } }
public static Image CaptureSnapshot(By by) { Bitmap savedImage = null; Rectangle section = Rectangle.Empty; if (by != null) { var size = KeywordImplementation.UIObject(by).Size; var x = KeywordImplementation.UIObject(by).Location.X; var y = KeywordImplementation.UIObject(by).Location.Y; //((IOSDriver<IOSElement>)Accessor.getDriver()).Rotate(ScreenOrientation.Landscape); Bitmap source = new Bitmap(getSnapshotFileInfo(Accessor.getDriver()).ToString()); if (!Accessor.driverIsForIOS()) { section = new Rectangle(x, y, size.Width, size.Height); } else { var width = Accessor.getDriver().Manage().Window.Size.Width; if (width == 414) { section = new Rectangle(x * 3, y * 3, size.Width * 3, size.Height * 3); } else { section = new Rectangle(x * 2, y * 2, size.Width * 2, size.Height * 2); } } savedImage = CropImage(source, section); } else { savedImage = new Bitmap(getSnapshotFileInfo(Accessor.getDriver()).FullName); } return(savedImage); }
public void ValidateAudiogramPointsOnCustomerOverviewScreen(string side, string points, bool isExist) { // Logger.logWarn("Aaudiogram point summary has to be added in Audiogram Layout object field for verification"); if (isExist) { var size = Accessor.getDriver().Manage().Window.Size; int starty = (int)(size.Height * 0.50); int endy = (int)(size.Height * 0.80); int startx = size.Width / 2; ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 1000); IWebElement audiogramGrid = null; if (side.Equals("right", StringComparison.CurrentCultureIgnoreCase)) { audiogramGrid = KeywordImplementation.UIObject(By.Id("AudiogramGrid_RightEar")); } else if (side.Equals("left", StringComparison.CurrentCultureIgnoreCase)) { audiogramGrid = KeywordImplementation.UIObject(By.Id("AudiogramGrid_LeftEar")); } if (audiogramGrid.GetAttribute("label").Contains(points)) { Logger.logSuccess("Audiogram point validation passed on customer overview screen"); } else { Logger.logFailure("Audiogram point validation failed on customer overview scxreen", true); } } else { Logger.logInfo(string.Format("'{0}' side audiogram points does not exist in customer overview screen", side)); } }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { string applicationName = TestSuite.Current.Parameters["AppName"]; string appPath = TestSuite.Current.Parameters["AppPath"]; KeywordImplementation.LaunchiOSApp(new Uri("http://" + TestSuite.Current.Parameters["Uri"] + ":4723/wd/hub"), TestSuite.Current.Parameters["Device"], applicationName, appPath); if (KeywordImplementation.waitForObjectExist(By.Id("OK"), TimeSpan.FromSeconds(5))) { KeywordImplementation.Click(By.Id("OK")); } if (isPopup) { if (KeywordImplementation.waitForObjectExist(By.Name("Not now"), TimeSpan.FromSeconds(1))) { KeywordImplementation.Click(By.Name("Not now")); } else if (KeywordImplementation.waitForObjectExist(By.Name("Später vielleicht"), TimeSpan.FromSeconds(1))) { KeywordImplementation.Click(By.Name("Später vielleicht")); } } }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { //initialising HI values globally based on the AppBrand. BrandBasedHINames(); Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; string applicationName = TestSuite.Current.Parameters["AppName"]; string appActivity = "md56f35e8d86ebdc1429f36073ae400eed3.SplashActivity"; try { KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"], applicationName, appActivity); // KeywordImplementation.LaunchAndroidApp(TestSuite.Current.Parameters["Device"], applicationName, appActivity); Report.Info("Platform Version " + ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Capabilities.GetCapability("platformVersion")); ////..getCapabilities().getCapability("platformVersion") Report.Info("Device Name " + ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Capabilities.GetCapability("deviceName")); if (KeywordImplementation.waitForObjectExist(By.Name("OK"), TimeSpan.FromSeconds(5))) { KeywordImplementation.Click(By.Name("OK")); } var size = Accessor.getDriver().Manage().Window.Size; //Swipe from Bottom to Top and Top to bottom //Find swipe start and end point from screen's width and height. int starty = 0, endy = 0, startx = 0; bool isTablet = size.Width >= 600; starty = (int)(size.Height * 0.50); endy = (int)(size.Height * 0.20); startx = size.Width / 2; int count = 0; while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Btn_AppInfo_Accept"), TimeSpan.FromSeconds(1)))) { ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500); count++; } Report.Success("Welcome Page screen is available"); Logger.logSnapshot(); KeywordImplementation.Click(By.Id("CheckBox_AcceptTAndC")); KeywordImplementation.Click(By.Id("Btn_AppInfo_Accept")); Delay.Seconds(15); // For SSO // ((AndroidDriver<OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 0); // ((AndroidDriver<OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 0); // // KeywordImplementation.SwipeVerticle(3,0.50,0.20,By.XPath("//*[contains(@content-desc,'Yes, Allow')]")); // KeywordImplementation.Click(By.XPath("//*[contains(@content-desc,'Yes, Allow')]")); // if (KeywordImplementation.waitForObjectExist(By.Name("Country"), TimeSpan.FromSeconds(3))) { KeywordImplementation.Click(By.Name("Done")); } KeywordImplementation.TypeText(By.Id("Txt_Legitimation_Code1"), "8981"); KeywordImplementation.TypeText(By.Id("Txt_Legitimation_Code2"), "9313"); KeywordImplementation.TypeText(By.Id("Txt_Legitimation_Code3"), "9666"); Report.Success("Access code screeen is available"); Logger.logSnapshot(); KeywordImplementation.Click(By.Name("Done")); Delay.Seconds(3); Ranorex.Report.Success(Accessor.getDriver().FindElement(By.Id("Txt_Legitimation_Msg")).Text); Logger.logSnapshot(); while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Continue"), TimeSpan.FromSeconds(1)))) { ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500); count++; } KeywordImplementation.Click(By.Name("Continue")); if (applicationName.Equals("com.connexx.fit2go", StringComparison.CurrentCultureIgnoreCase)) { KeywordImplementation.Click(By.Name("Done")); } Ranorex.Report.Success("Customer Ear Molds screen is available"); Logger.logSnapshot(); count = 0; while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Btn_CustomMolds_Continue"), TimeSpan.FromSeconds(1)))) { ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500); count++; } KeywordImplementation.Click(By.Id("Btn_CustomMolds_Continue")); //Selecting the HIs from the list available for recommendation //SwitchToChooseHI(); if (KeywordImplementation.waitForObjectExist(By.Id("Txt_CommonAlert_Title"), TimeSpan.FromSeconds(3))) { Ranorex.Report.Success("Security alert has popped up"); Logger.logSnapshot(); KeywordImplementation.Click(By.Name("OK")); } Logger.logSnapshot(); if (TestSuite.Current.Parameters["isTablet"].Equals("True", StringComparison.CurrentCultureIgnoreCase)) { KeywordImplementation.Click(By.Id("Tab_Cutomer_Settings")); } else { TearDown.CloseApplication(); TestModuleRunner.Run(new STSAndBasic.AndroidSetUp()); KeywordImplementation.Click(By.Id("Btn_ActionBar_Right"), "Click on Settings"); } Delay.Seconds(2); SwitchSettingOmniture(false); } finally { if (Accessor.getDriver() != null) { Accessor.getDriver().Quit(); } } }
private void DrawPTEAudiogramPoints(string side, string points) { Logger.logInfo(string.Format("Draw audiogram points \"{0}\"", points)); if (KeywordImplementation.UIObject(By.Id("Txt_ActionBar_Title"), TimeSpan.FromSeconds(5)).Text.Equals("Pure Tone Estimation")) { Logger.logInfo("PTE page is selected"); if (side.Equals("right", StringComparison.CurrentCultureIgnoreCase)) { if (KeywordImplementation.UIObject(By.Id("Btn_ActionBar_Right")).GetAttribute("name").Contains("Right") && KeywordImplementation.UIObject(By.Id("Txt_PureToneTest_FreqWithoutBg")).Text.Contains("500 Hz")) { Logger.logInfo("PTE right side is selected"); } } if (side.Equals("left", StringComparison.CurrentCultureIgnoreCase)) { if (KeywordImplementation.UIObject(By.Id("Btn_ActionBar_Right")).GetAttribute("name").Contains("Right") && KeywordImplementation.UIObject(By.Id("Txt_PureToneTest_FreqWithoutBg")).Text.Contains("500 Hz")) { KeywordImplementation.Click(By.Id("Img_PureToneInst_Skip")); Logger.logInfo("Selecting the PTE left side"); } if (KeywordImplementation.UIObject(By.Id("Btn_ActionBar_Right")).GetAttribute("name").Contains("Left") && KeywordImplementation.UIObject(By.Id("Txt_PureToneTest_FreqWithoutBg")).Text.Contains("500 Hz")) { Logger.logInfo("PTE left side is selected"); } } //IWebElement elementImgBtnPteIncrease = Accessor.getDriver().FindElement(By.Id("ImgBtn_PureToneTest_Increase")); string[] aPoints = points.Split(';'); foreach (string point in aPoints) { int audValue = 0; audValue = (int.Parse(point) - 30) / 5; IWebElement elementImgBtnPteIncrease = Accessor.getDriver().FindElement(By.Id("ImgBtn_PureToneTest_Increase")); for (int i = 0; i < audValue; i++) { elementImgBtnPteIncrease.Click(); //KeywordImplementation.Click(By.Id("ImgBtn_PureToneTest_Increase")); } if (audValue >= 13) { KeywordImplementation.Click(By.Id("ImgBtn_PureToneTest_HeardUnHeard")); } KeywordImplementation.Click(By.Id("ImgBtn_PureToneInst_Next")); } } }
private void SkipInstructions() { KeywordImplementation.Click(By.Id("ImgBtn_PureToneInst_Next")); KeywordImplementation.Click(By.Id("Img_PureToneInst_Skip")); }
private void TapOnMonauralHearingSystem() { KeywordImplementation.Click(By.Id("Layout_Monaural_HearingSystem")); }
public void ValidateDateEmpty(bool empty) { //string message=null; Logger.ConditionalValidation(KeywordImplementation.UIObject(By.Id("txtDOB")).GetAttribute("value").Contains("yy"), empty, "DOB details has not found", string.Format("DOB details '{0}' has found", KeywordImplementation.UIObject(By.Id("txtDOB")).Text)); }
public void ValidatePatientExist(string lastName, string firstName) { Logger.logSnapshot(); if (KeywordImplementation.UIObject(By.Id("txtLastName")).Text.Contains(lastName) && KeywordImplementation.UIObject(By.Id("txtFirstName")).Text.Contains(firstName)) { Logger.logSuccess(string.Format("Patient details '{0}, {1}' has found", lastName, firstName)); } else { Logger.logFailure(string.Format("Patient details '{0}, {1}' has not found", lastName, firstName)); } }
public void TapOnIdontKnow() { KeywordImplementation.Click(By.Id("buttonNotKnown")); }
public void ClearDateField() { Logger.logInfo("Clear the date field"); KeywordImplementation.Click(By.Id("txtDOB")); KeywordImplementation.Click(By.Id("Clear")); }
public void ValidatePrePopulatedEmail() { if (KeywordImplementation.UIObject(By.Id("toField")).GetAttribute("value").Contains("@sivantos.com")) //&& KeywordImplementation.UIObject(By.Id("toField")).Text.Contains(".")) { Logger.logSuccess(string.Format("Pre-populated mail id is'{0}'", KeywordImplementation.UIObject(By.Id("toField")).GetAttribute("value"))); } else { Logger.logFailure(string.Format("Pre-populated e-mail id '{0}' is not correct", KeywordImplementation.UIObject(By.Id("toField")).GetAttribute("value"))); } if (KeywordImplementation.UIObject(By.Id("subjectField")).GetAttribute("value").Length != 0) { Logger.logSuccess(string.Format("Pre-populated mail subject is '{0}'", KeywordImplementation.UIObject(By.Id("subjectField")).Text)); } else { Logger.logFailure("Pre-populated subject is empty"); } if (KeywordImplementation.UIObject(By.Id("Message body")).GetAttribute("value").Length != 0) { Logger.logSuccess(string.Format("Pre-populated mail contents is'{0}'", KeywordImplementation.UIObject(By.Id("Message body")).GetAttribute("value"))); } else { Logger.logFailure("Pre-populated mail content is empty"); } Logger.logSnapshot(); }
public void TapEnterAudiogram() { Logger.logInfo("Tap 'Enter Audiogram'"); KeywordImplementation.Click(By.Id("Txt_Fitting_EnterAudiogram")); }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { BrandBasedHINames(); try { Report.Info("Brand " + TestSuite.Current.Parameters["Brand"]); Report.Info("Device " + TestSuite.Current.Parameters["Device"]); Report.Info("App " + TestSuite.Current.Parameters["AppName"]); string applicationName = TestSuite.Current.Parameters["AppName"]; string appPath = TestSuite.Current.Parameters["AppPath"]; KeywordImplementation.LaunchiOSApp(new Uri("http://" + TestSuite.Current.Parameters["Uri"] + ":4723/wd/hub"), TestSuite.Current.Parameters["Device"], applicationName, appPath); if (KeywordImplementation.waitForObjectExist(By.Id("OK"), TimeSpan.FromSeconds(5))) { KeywordImplementation.Click(By.Id("OK")); } var size = Accessor.getDriver().Manage().Window.Size; /*****************************/ //Swipe from Bottom to Top //Find swipe start and end point from screen's width and height. int starty = (int)(size.Height * 0.70); int endy = (int)(size.Height * 0.20); int startx = size.Width / 2; int count = 0; while (count != 3 && (!KeywordImplementation.waitForObjectExist(By.Id("Accept & Continue"), TimeSpan.FromSeconds(1)))) { ((IOSDriver <IOSElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 1000); count++; } Report.Success("Welcome Page screen is available"); KeywordImplementation.Click(By.Id("AgreeCheckBox")); Logger.logSnapshot(); KeywordImplementation.Click(By.Id("Accept & Continue")); Delay.Seconds(15); if (KeywordImplementation.waitForObjectExist(By.Id("Country"), TimeSpan.FromSeconds(3))) { Logger.logSuccess("Country selection screen is shown"); Logger.logSnapshot(); while (count <= 25 && (!KeywordImplementation.waitForObjectExist(By.Id("Rest of World"), TimeSpan.FromSeconds(1)))) { ((IOSDriver <IOSElement>)Accessor.getDriver()).Swipe(startx, starty, startx, endy, 500); count++; } KeywordImplementation.Click(By.Id("Rest of World")); KeywordImplementation.Click(By.Id("Done")); } KeywordImplementation.TypeText(By.Id("Passcode1"), "8981"); KeywordImplementation.TypeText(By.Id("Passcode2"), "9313"); KeywordImplementation.TypeText(By.Id("Passcode3"), "9666"); Report.Success("Access code screeen is available"); Logger.logSnapshot(); KeywordImplementation.Click(By.Id("Done")); Delay.Seconds(10); Ranorex.Report.Success(Accessor.getDriver().FindElement(By.Id("Code entered successfully.")).Text); Logger.logSnapshot(); KeywordImplementation.Click(By.Id("Continue")); if (TestSuite.Current.Parameters["Brand"].Equals("Connexx", StringComparison.CurrentCultureIgnoreCase)) { KeywordImplementation.Click(By.Name("Done")); } Ranorex.Report.Success("Customer Ear Molds screen is available"); Logger.logSnapshot(); KeywordImplementation.Click(By.Id("Continue")); //KeywordImplementation.Click(By.Id("Continue")); if (KeywordImplementation.waitForObjectExist(By.XPath("//UIAAlert[@name='Sensitive Client Data']"), TimeSpan.FromSeconds(3))) { Ranorex.Report.Success("Security alert has popped up"); Logger.logSnapshot(); KeywordImplementation.Click(By.Id("OK")); } Logger.logSnapshot(); if (TestSuite.Current.Parameters["isTablet"].Equals("True", StringComparison.CurrentCultureIgnoreCase)) { KeywordImplementation.Click(By.Id("SettingsIcon")); } else { KeywordImplementation.Click(By.Id("NavBarRight")); } SwitchSettingOmniture(false); // } } finally { if (Accessor.getDriver() != null) { Accessor.getDriver().Quit(); } } }