public static void SearchExamByIndex() { IWebElement Country_Drpdwn = utility.driver.FindElement(By.Id("ctl00_Body_ddlCountry")); Console.WriteLine(Country_Drpdwn.Size); Country_Drpdwn.Click(); IWebElement statedropwdwn = utility.driver.FindElement(By.Id("ctl00_Body_ddlRegion")); // exam for country Germany SelectElement oselect = new SelectElement(Country_Drpdwn); oselect.SelectByText("Germany"); Console.WriteLine("Germany country selcted"); IJavaScriptExecutor js = (IJavaScriptExecutor)utility.driver; js.ExecuteScript("window.scrollBy(0,500)"); Thread.Sleep(5000); Console.WriteLine("Germany list is successfully loaded ."); IWebElement searchbtn = utility.driver.FindElement(By.Id("ctl00_Body_btnSearchExams")); searchbtn.Click(); LocateExamByIndex.IsExamResultsDisplayed(); }
//public static IWebDriver driver; static void Main(string[] args) { utility.browserinitiate(); utility.loginpage(); //calling locate exam method LocateExamByIndex obj = new LocateExamByIndex(); obj.ExamRegFlow(); utility.browserclose(); }