public static void SelectBrand(string brand) { ICollection <IWebElement> elements = SeleniumGetMethods.GetElements(Properties.driver, "//div[@id='w3-w12']//span[1]", "xpath"); foreach (IWebElement element in elements) { if (element.Text.ToLower().Trim().Equals(brand)) { element.Click(); return; } } }
public static void SelectSize(string size) { ICollection <IWebElement> elements = SeleniumGetMethods.GetElements(Properties.driver, "//*[@id=\"w3\"]/li[1]/ul/li[2]/ul/li[1]/ul//span[1]", "xpath"); foreach (IWebElement element in elements) { if (element.Text.ToLower().Trim().Equals(size)) { element.Click(); return; } } PrintResults("Number of Results: " + SeleniumGetMethods.GetText(Properties.driver, "srp-controls__count-heading", "Class")); }