public ProductPage GoToRandomProductPageAndAssertItSwitchedCorrectly() { var size = products.Count; var random = new Random().Next(0, size); IWebElement element = products.ElementAt(random); string productName = Regex.Replace(element.Text, removeDashesRegex, ""); ClickElement(element, nameof(element)); ProductPage productPage = PageObjectFactory.CreateProductPage(driver); AssertEquals(productName, productPage.GetProductName()); return(productPage); }