public void Button() { NavigationHelper.NavigateToUrl(ObjectRepository.Config.GetWebsite()); LinkHelper.ClickLink(By.XPath("//*[@id='authentication-link' and @class='login']")); LinkHelper.ClickLink(By.XPath("//div[@class='Qk3sp3k23b-uqHOY6J1-E']")); TextboxHelper.TypeInTextbox(By.XPath("//*[@id='email']"), ObjectRepository.Config.GetUserName()); TextboxHelper.TypeInTextbox(By.XPath("//*[@id='password']"), ObjectRepository.Config.GetPassword()); //IWebElement ele = ObjectRepository.Driver.FindElement(By.XPath("//*[@class='bpk-button-IZE-J ProgressionButton__button-3U-H6']")); //ele.Click(); Console.WriteLine("Enabled : {0}", ButtonHelper.IsButonEnabled(By.XPath("//*[@class='bpk-button-IZE-J ProgressionButton__button-3U-H6']"))); //Console.WriteLine("Label : {0}", ButtonHelper.GetButtonText(By.XPath("//button[@data-testid='login-button']"))); //in this case doesnt wrk but if we had got the value in the span then it would hv worked or in value locator Console.WriteLine("Label : {0}", ButtonHelper.GetButtonText_alt(By.XPath("//button[@data-testid='login-button']")));//other way of extracing the text ButtonHelper.ClickButton(By.XPath("//*[@class='bpk-button-IZE-J ProgressionButton__button-3U-H6']")); }
public void TestRadio() { NavigationHelper.NavigateToUrl(ObjectRepository.Config.GetWebsite()); Console.WriteLine("Return buttons status is :{0}", RadioButtonHelper.IsRadioButtonchecked(By.Id("fsc-trip-type-selector-return"))); Console.WriteLine("Return buttons text is :{0}", RadioButtonHelper.GetRadioButtonText(By.XPath("//*[@id='flights-search-controls-root']/div/div/form/div[1]/div/label[1]/span"))); RadioButtonHelper.ClickRadioButton(By.Id("fsc-trip-type-selector-one-way")); //IWebElement ele = ObjectRepository.Driver.FindElement(By.Id("fsc-trip-type-selector-one-way")); //ele.Click(); LinkHelper.ClickLink(By.XPath("//*[@id='authentication-link' and @class='login']")); LinkHelper.ClickLink(By.XPath("//div[@class='Qk3sp3k23b-uqHOY6J1-E']")); TextboxHelper.TypeInTextbox(By.XPath("//*[@id='email']"), ObjectRepository.Config.GetUserName()); TextboxHelper.TypeInTextbox(By.XPath("//*[@id='password']"), ObjectRepository.Config.GetPassword()); Console.WriteLine("Enabled : {0}", ButtonHelper.IsButonEnabled(By.XPath("//*[@class='bpk-button-IZE-J ProgressionButton__button-3U-H6']"))); ButtonHelper.ClickButton(By.XPath("//*[@class='bpk-button-IZE-J ProgressionButton__button-3U-H6']")); }