public void SetArrivingMethod(ArrivingMethod arriving) { try { var container = _driver.FindElement(By.ClassName("b-sb-travelling-types__options")); var radiobuttons = container.FindElements(By.ClassName("b-sb-travelling-types__input")); var executableRadioBtn = radiobuttons[0]; switch (arriving) { case ArrivingMethod.Aeroplane: executableRadioBtn = radiobuttons[0]; break; case ArrivingMethod.Train: executableRadioBtn = radiobuttons[1]; break; case ArrivingMethod.Car: executableRadioBtn = radiobuttons[2]; break; } ((IJavaScriptExecutor)_driver).ExecuteScript("arguments[0].checked = true;", executableRadioBtn); } catch (Exception e) { //loger.Log } }
public HotelsWrapper FindHotels(string location, DateTime fromDate, DateTime toDate, ArrivingMethod arrivingMethod, bool businessTrip = false, int adults = 1, int children = 0) { _bookingAccessor.SetDirection(location.Substring(0, location.Length - 4)); _bookingAccessor.SetTravelingForWork(businessTrip); _bookingAccessor.SetArrivingMethod(arrivingMethod); _bookingAccessor.SetCheckInDate(fromDate); _bookingAccessor.SetVisitors(adults, children); _bookingAccessor.SetCheckOutDate(toDate); return(_bookingAccessor.GetHotels()); }