//For Gas Only public YourEnergyPage ValidateGass(string postCode, string supplier) { HaveNoBill.Click(); Gas.Click(); PostCodeImputField.SendKeys(postCode); FindPostCodeButton.Click(); Thread.Sleep(TimeSpan.FromHours(10)); var selectDropdown = Driver.FindElement(By.ClassName("chosen-results")); var dropDown = new SelectElement(selectDropdown); dropDown.SelectByText(supplier); NextButton.Click(); return(new YourEnergyPage(Driver)); }
//For Both Gas and Electricity Scenarios public YourEnergyPage Validate(string postCode, string supplier) { PostCodeImputField.SendKeys(postCode); FindPostCodeButton.Click(); Thread.Sleep(TimeSpan.FromHours(10)); HaveBill.Click(); GasAndElectricity.Click(); //Supplier Radio Buttons Only Scenarios var supplierButtons = Driver.FindElement(By.ClassName("radio-buttons")); var buttons = new SelectElement(supplierButtons); buttons.SelectByText(supplier); NextButton.Click(); return(new YourEnergyPage(Driver)); }