def set_date(self, date_type, date_value): assert date_type.lower() in ['start', 'end'] input_id = 'billing_searchMonthFrom' if date_type.lower() == 'start' else 'billing_searchMonthTo' date_field = Find(by=By.ID, value=input_id, context=self) date_field.clear() date_field.send_keys(date_value)
def set_date_and_search(self): date_field = Find(by=By.CSS_SELECTOR, value='input[ng-model="billingDateFrom"]', context=self) date_field.clear() date_field.send_keys('2015-01-01') self.search_btn_click() time.sleep(5)