public void navigateToWeatherPage() { NDTVWeatherApp n = new NDTVWeatherApp(driver); n.showExtendedMenu(); n.openWeatherPage(); }
public void searchCity(Dictionary <string, string> prop) { if (!(prop["CityName"] == "Mumbai" | prop["CityName"] == "Srinagar" | prop["CityName"] == "New Delhi" | prop["CityName"] == "Lucknow" | prop["CityName"] == "Patna" | prop["CityName"] == "Kolkata" | prop["CityName"] == "Visakhapatnam" | prop["CityName"] == "Hyderabad" | prop["CityName"] == "Bengaluru" | prop["CityName"] == "Chennai")) { WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5)); IWebElement element = wait.Until(ExpectedConditions.ElementToBeClickable(By.Id("searchBox"))); // NDTVWeatherApp.searchCity(prop); NDTVWeatherApp.selectCity(); } }
public float readCityWeatherDetails(Dictionary <string, string> prop) { string tempInDegrees = NDTVWeatherApp.getTemperature(); // IWebElement selectTempDegrees = driver.FindElement(By.XPath("//div[contains(text(),'" + prop["CityName"] + "')]/../div/span[1]")); // string tempInDegrees = selectTempDegrees.Text; tempInDegrees = tempInDegrees.Remove(tempInDegrees.Length() - 1, 1); Console.WriteLine("Temperature from Webpage = " + tempInDegrees + " degrees celcius."); float temp = float.Parse(tempInDegrees); LogManager.WriteLog("Response validation: Temperature in Degrees: " + temp); LogManager.WriteLog("Response validation: City Name: " + prop["CityName"]); Excelhelper.WriteToExcelLog(prop["CityName"], temp); return(temp); }