public static void allPageSetUp() { AllPageBase.AddAllPages(); //Setting up Extend report var htmlReporter = new ExtentHtmlReporter("C:\\Users\\Aditya Gautam\\source\\repos\\SpecflowProjectV2\\ExtentReport.html"); htmlReporter.Config.Theme = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark; extent = new ExtentReports(); extent.AttachReporter(htmlReporter); }
// Get URL variable of currect page as per the object we set public static string GetStoredPageUrl() { AllPageBase allPages = GetObject(); Type type = allPages.GetType(); var property = type.GetProperty("url"); var propertType = property.PropertyType; var propertyValue = property.GetValue(allPages); if (propertType == typeof(string)) { return(propertyValue as string); } else { return(null); } }
// Get Web element value of currect page as per the object we set public static IWebElement GetWebElement(string elementName) { // removing White spaces from Page Name elementName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(elementName); elementName = Regex.Replace(elementName, @"\s+", string.Empty); AllPageBase allPages = GetObject(); Type type = allPages.GetType(); var property = type.GetProperty(elementName); var propertType = property.PropertyType; var propertyValue = property.GetValue(allPages); if (propertType == typeof(IWebElement)) { return(propertyValue as IWebElement); } else { return(null); } }
public static void allPageSetUp() { AllPageBase.AddAllPages(); }