def make_bid(self): is_found = False for i in range(1, 150): try: wait_until_visible(self.driver, all_bids) self.driver.find_element_by_xpath(all_bids).click() is_found = True break except (TimeoutException, NoSuchElementException, ElementNotVisibleException): sleep(15) self.driver.refresh() if not is_found: return False self.driver.find_element_by_xpath(all_bids).click() wait_until_visible(self.driver, input_bid_amount) self.driver.find_element_by_xpath(input_bid_amount).send_keys(10000) file_to_upload = service.relative2absolute('./doc1.docx') self.driver.find_element_by_xpath(input_bid_doc).send_keys( file_to_upload) self.driver.find_element_by_xpath(submit_bid_doc).click() wait_until_visible(self.driver, submit_bid_button) return True
def make_bid(self): # "LOAD_TEST_Below_Threshold" is_found = False for i in range(1, 100): try: wait_until_visible(self.driver, input_bid_amount, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector( input_bid_amount).click() is_found = True break except (TimeoutException, NoSuchElementException, ElementNotVisibleException): sleep(15) self.driver.refresh() self.driver.execute_script("window.scrollTo(0, 3238);") if not is_found: return False self.driver.execute_script("window.scrollTo(0, 3238);") self.driver.find_element_by_css_selector(input_bid_amount).send_keys( 10000) wait_until_visible(self.driver, submit_bid_button, select_type=By.CSS_SELECTOR) file_to_upload = service.relative2absolute('./doc1.docx') self.driver.find_element_by_xpath(add_doc).send_keys(file_to_upload) return True
def make_bid(self): # "LOAD_TEST_Below_Threshold" is_found = False for i in range(1, 100): try: wait_until_visible(self.driver, make_bid_button, select_type=By.XPATH) self.driver.find_element_by_xpath(make_bid_button).click() is_found = True break except (TimeoutException, NoSuchElementException, ElementNotVisibleException): sleep(10) self.driver.refresh() if not is_found: return False wait_before_click(self.driver, make_bid_button, select_type=By.XPATH) self.driver.find_element_by_xpath(make_bid_button).click() self.driver.execute_script("window.scrollTo(0, 273);") wait_until_visible(self.driver, input_bid_amount, select_type=By.XPATH) self.driver.find_element_by_xpath(input_bid_amount).send_keys(3000) file_to_upload = service.relative2absolute('./doc1.docx') wait_until_visible(self.driver, add_bid_doc, select_type=By.XPATH) self.driver.find_element_by_xpath(add_bid_doc).click() wait_until_visible(self.driver, upload_document, select_type=By.XPATH) self.driver.find_element_by_xpath(upload_document).send_keys( file_to_upload) self.driver.find_element_by_xpath(select_doc_type).click() self.driver.find_element_by_xpath(select_doc_type_1).click() wait_until_visible(self.driver, upload_bid_verif, select_type=By.XPATH) return True
def make_bid(self): wait_until_visible(self.driver, select_bids, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(select_bids).click() # "LOAD_TEST_Below_Threshold" is_found = False for i in range(1, 100): try: wait_until_visible(self.driver, make_bid_button, select_type=By.CSS_SELECTOR) is_found = True break except (TimeoutException, NoSuchElementException, ElementNotVisibleException): sleep(15) self.driver.refresh() if not is_found: return False self.driver.find_element_by_css_selector(make_bid_button).click() wait_until_visible(self.driver, select_lot, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(select_lot).click() wait_until_visible(self.driver, input_bid_amount, select_type=By.XPATH) self.driver.execute_script( """$('input[id*="Value_Amount"]').data("kendoNumericTextBox").value("3000.00");""" ) file_to_upload = service.relative2absolute('./doc1.docx') self.driver.find_element_by_css_selector(input_bid_doc).send_keys( file_to_upload) return True
def create_tender(self): self.driver.execute_script("window.scrollTo(0, 730);") sleep(1) wait_before_click(self.driver, input_value_amount, select_type=By.CSS_SELECTOR) sleep(4) self.driver.find_element_by_css_selector(input_value_amount).send_keys( 10000) self.driver.find_element_by_css_selector(input_min_step).send_keys(100) self.driver.execute_script("window.scrollTo(0, 1601);") self.driver.find_element_by_css_selector(input_title).send_keys( 'LOAD_TEST_Below_Threshold') self.driver.find_element_by_css_selector(input_description).send_keys( 'LOAD_TEST_Below_Threshold') file_to_upload = service.relative2absolute('./doc1.docx') self.driver.find_element_by_xpath(add_doc).send_keys(file_to_upload) wait_until_visible(self.driver, input_item_description, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector( input_item_description).send_keys('LOAD_TEST_Below_Threshold') self.driver.find_element_by_css_selector(input_quantity).send_keys(10) self.driver.execute_script("window.scrollTo(0, 2214);") self.driver.find_element_by_css_selector(select_cpv).click() wait_until_visible(self.driver, select_cpv_1item, select_type=By.XPATH) self.driver.find_element_by_xpath(select_cpv_1item).click() wait_for_presence(self.driver, confirm_cpv, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(confirm_cpv).click() self.driver.execute_script("window.scrollTo(0, 2926);") wait_until_visible(self.driver, select_country, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(select_country).click() wait_until_visible(self.driver, select_dropdown_region, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector( select_dropdown_region).click() self.driver.find_element_by_css_selector(input_locality).send_keys( u"Ковель") self.driver.find_element_by_css_selector( input_delivery_address).send_keys("Random Valid Address, 7741") self.driver.find_element_by_css_selector(input_postal_code).send_keys( '02010') self.driver.execute_script("window.scrollTo(0, 3509);") self.driver.find_element_by_css_selector( input_delivery_start_date).click() self.driver.find_element_by_css_selector( input_delivery_start_date).clear() delivery_start = service.time_service()[3] wait_until_visible(self.driver, input_delivery_start_date, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector( input_delivery_start_date).send_keys(delivery_start) self.driver.find_element_by_css_selector( input_delivery_end_date).click() self.driver.find_element_by_css_selector( input_delivery_end_date).clear() delivery_end = service.time_service()[4] self.driver.find_element_by_css_selector( input_delivery_end_date).send_keys(delivery_end) self.driver.execute_script("window.scrollTo(0, 3999);") self.driver.find_element_by_css_selector(input_end_enquiry).click() self.driver.find_element_by_css_selector(input_end_enquiry).clear() enquiry_end = service.time_service()[0] self.driver.find_element_by_css_selector(input_end_enquiry).send_keys( enquiry_end) self.driver.find_element_by_css_selector(input_start_tender).click() self.driver.find_element_by_css_selector(input_start_tender).clear() tender_start = service.time_service()[1] self.driver.find_element_by_css_selector(input_start_tender).send_keys( tender_start) self.driver.find_element_by_css_selector(input_end_tender).click() self.driver.find_element_by_css_selector(input_end_tender).clear() tender_end = service.time_service()[2] self.driver.find_element_by_css_selector(input_end_tender).send_keys( tender_end) self.driver.find_element_by_css_selector( input_procuring_entity).click() self.driver.execute_script("window.scrollTo(0, 4641);") wait_until_visible(self.driver, submit_create_tender, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(submit_create_tender).click()
def create_tender(self): wait_for_presence(self.driver, create_tender_button) self.driver.find_element_by_xpath(create_tender_button).click() wait_until_visible(self.driver, below_threshold_button) self.driver.find_element_by_xpath(below_threshold_button).click() self.driver.find_element_by_xpath(input_title).send_keys( 'LOAD_TEST_Below_Threshold') self.driver.find_element_by_xpath(input_description).send_keys( 'LOAD_TEST_Below_Threshold') self.driver.find_element_by_xpath(input_value_amount).send_keys(10000) self.driver.find_element_by_xpath(input_min_step).send_keys(100) self.driver.execute_script("window.scrollTo(0, 180);") self.driver.execute_script(input_start_enquiry) self.driver.execute_script(input_end_enquiry) self.driver.execute_script(input_start_tender) self.driver.execute_script(input_end_tender) wait_before_click(self.driver, '//*[@id="date_tender_end"]') self.driver.find_element_by_xpath('//*[@id="date_tender_end"]').click() self.driver.find_element_by_xpath(input_value_amount).click() wait_before_click(self.driver, next_button) self.driver.find_element_by_xpath(next_button).click() self.driver.implicitly_wait(5) self.driver.execute_script("window.scrollTo(0, 749);") wait_for_presence(self.driver, add_item) self.driver.find_element_by_xpath(add_item).click() # self.driver.switch_to_alert().accept() wait_before_click(self.driver, input_item_description) self.driver.find_element_by_xpath(input_item_description).send_keys( 'LOAD_TEST_Below_Threshold') self.driver.find_element_by_xpath(input_quantity).send_keys(10) self.driver.find_element_by_xpath(select_unit).click() self.driver.find_element_by_xpath(input_unit).send_keys(u'ящик') self.driver.find_element_by_xpath(select_unit_1).click() wait_until_invisible(self.driver, select_unit_1) self.driver.find_element_by_xpath(click_cpv_button).click() wait_until_visible(self.driver, select_cpv_1item) self.driver.find_element_by_xpath(select_cpv_1item).click() self.driver.find_element_by_xpath(confirm_cpv).click() self.driver.find_element_by_xpath(select_dkpp).click() wait_until_visible(self.driver, select_dkpp_1item) self.driver.find_element_by_xpath(select_dkpp_1item).click() self.driver.find_element_by_xpath(confirm_dkpp).click() self.driver.execute_script(input_delivery_start) self.driver.execute_script(input_delivery_end) wait_before_click(self.driver, delivery_checkbox) self.driver.find_element_by_xpath(delivery_checkbox).click() modal = self.driver.find_element_by_xpath('//*[@id="HideShow_div"]') self.driver.execute_script("return arguments[0].scrollIntoView(true);", modal) self.driver.find_element_by_xpath(click_dropdown_country).click() self.driver.find_element_by_xpath(select_country).click() wait_until_invisible(self.driver, select_country) self.driver.find_element_by_xpath(click_dropdown_region).click() wait_for_presence(self.driver, input_region) self.driver.find_element_by_xpath(input_region).send_keys(u"м. Київ") self.driver.find_element_by_xpath(select_region).click() wait_until_invisible(self.driver, select_region) wait_before_click(self.driver, input_postal_code) self.driver.find_element_by_xpath(input_postal_code).click() self.driver.find_element_by_xpath(input_postal_code).send_keys(11111) self.driver.find_element_by_xpath(input_locality).send_keys(u'Київ') self.driver.find_element_by_xpath(input_delivery_address).send_keys( 'Some street 10') self.driver.find_element_by_xpath(input_latitude).send_keys('50.15') self.driver.find_element_by_xpath(input_longitude).send_keys('50.10') self.driver.find_element_by_xpath(input_height).send_keys('0') try: wait_until_visible(self.driver, save_changes) self.driver.find_element_by_xpath(save_changes).click() except NoSuchElementException: sleep(3) self.driver.find_element_by_xpath(save_changes).click() self.driver.implicitly_wait(5) self.driver.execute_script("window.scrollTo(0, 730);") wait_until_visible(self.driver, add_tender_doc) self.driver.find_element_by_xpath(add_tender_doc).click() wait_until_visible(self.driver, select_type) self.driver.find_element_by_xpath(select_type).click() self.driver.find_element_by_xpath(select_doc_type).click() sleep(1) file_to_upload = service.relative2absolute('./doc1.docx') self.driver.find_element_by_xpath(file_input).send_keys(file_to_upload) sleep(2) wait_until_visible(self.driver, submit_tender_doc_upload) self.driver.find_element_by_xpath(submit_tender_doc_upload).click() self.driver.implicitly_wait(5) self.driver.execute_script("window.scrollTo(0, 730);") wait_until_visible(self.driver, create_tender_draft) self.driver.find_element_by_xpath(create_tender_draft).click() wait_until_visible(self.driver, submit_create_tender) self.driver.find_element_by_xpath(submit_create_tender).click() wait_until_visible(self.driver, submit_popup) self.driver.find_element_by_xpath(decline_electr_signature).click() self.driver.find_element_by_xpath(submit_popup).click()
def create_tender(self): self.driver.find_element_by_css_selector(input_title).send_keys( 'LOAD_TEST_Below_Threshold') self.driver.find_element_by_css_selector(input_description).send_keys( 'LOAD_TEST_Below_Threshold') enquiry_start = service.time_service()[0] self.driver.find_element_by_css_selector( input_start_enquiry).send_keys(enquiry_start) enquiry_end = service.time_service()[1] self.driver.find_element_by_css_selector(input_end_enquiry).send_keys( enquiry_end) tender_start = service.time_service()[2] self.driver.find_element_by_css_selector(input_start_tender).send_keys( tender_start) tender_end = service.time_service()[3] self.driver.find_element_by_css_selector(input_end_tender).send_keys( tender_end) self.driver.find_element_by_css_selector(save_draft).click() wait_until_visible(self.driver, add_lot, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(add_lot).click() wait_until_visible(self.driver, input_lot_title, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(input_lot_title).send_keys( 'LOAD_TEST_Below_Threshold LOT') self.driver.find_element_by_css_selector( input_lot_description).send_keys('LOAD_TEST_Below_Threshold LOT') self.driver.execute_script( """$('#Value_Amount').data("kendoNumericTextBox").value('3000.00');""" ) self.driver.execute_script( """$('#MinimalStep_Amount').data("kendoNumericTextBox").value('30.00');""" ) self.driver.find_element_by_css_selector(save_draft2).click() self.driver.execute_script('location.href = "{}";'.format(add_item)) wait_until_visible(self.driver, add_item, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(add_item).click() self.driver.execute_script( 'location.href = "{}";'.format(input_item_description)) self.driver.find_element_by_css_selector( input_item_description).send_keys('LOAD_TEST_Below_Threshold ITEM') self.driver.find_element_by_css_selector(select_cpv).click() wait_before_click(self.driver, select_cpv_1item, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(select_cpv_1item).click() sleep(2) wait_before_click(self.driver, cpv_selected, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(select_cpv).click() wait_until_invisible(self.driver, select_cpv_1item, select_type=By.CSS_SELECTOR) self.driver.execute_script('location.href = "{}";'.format(select_unit)) self.driver.find_element_by_css_selector(select_unit).click() wait_until_visible(self.driver, select_unit1, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(select_unit1).click() self.driver.find_element_by_css_selector(input_quantity).send_keys(10) self.driver.execute_script( 'location.href = "{}";'.format(input_delivery_start_date)) delivery_start = service.time_service()[4] self.driver.find_element_by_css_selector( input_delivery_start_date).send_keys(delivery_start) delivery_end = service.time_service()[5] self.driver.find_element_by_css_selector( input_delivery_end_date).send_keys(delivery_end) self.driver.execute_script( 'location.href = "{}";'.format(input_delivery_address)) wait_until_visible(self.driver, input_dropdown_region, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector( input_dropdown_region).send_keys(u"Волинська область") self.driver.find_element_by_css_selector(input_postal_code).send_keys( 02010) self.driver.find_element_by_css_selector(input_locality).send_keys( u"Ковель") self.driver.find_element_by_css_selector( input_delivery_address).send_keys("Random Valid Address, 7741") self.driver.find_element_by_css_selector(save_draft3).click() self.driver.execute_script( 'location.href = "{}";'.format(add_doc_button)) self.driver.find_element_by_css_selector(add_doc_button).click() # self.driver.find_element_by_css_selector(doc_title).click() self.driver.find_element_by_css_selector(doc_title).send_keys( "Tender Doc") file_to_upload = service.relative2absolute('./doc1.docx') self.driver.find_element_by_css_selector(doc_input).send_keys( file_to_upload) self.driver.find_element_by_css_selector(save_draft4).click() self.driver.execute_script( 'location.href = "{}";'.format(submit_create_tender)) wait_until_visible(self.driver, submit_create_tender, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(submit_create_tender).click()
def create_tender(self): self.driver.get(create_tender_url) wait_until_visible(self.driver, input_title, select_type=By.CSS_SELECTOR) self.driver.find_element_by_css_selector(input_title).send_keys( 'LOAD_TEST_Below_Threshold') self.driver.find_element_by_css_selector(input_description).send_keys( 'LOAD_TEST_Below_Threshold') self.driver.execute_script("window.scrollTo(0, 442);") self.driver.execute_script(input_start_enquiry) self.driver.execute_script(input_end_enquiry) self.driver.execute_script(input_start_tender) self.driver.execute_script(input_end_tender) self.driver.find_element_by_css_selector(acceleration_on).click() self.driver.find_element_by_css_selector(step1_button).click() self.driver.execute_script("window.scrollTo(0, 161);") wait_until_visible(self.driver, input_lot_title, select_type=By.XPATH) self.driver.find_element_by_xpath(input_lot_title).send_keys( 'LOAD_TEST_Below_Threshold') self.driver.find_element_by_xpath(input_lot_description).send_keys( 'LOAD_TEST_Below_Threshold') self.driver.find_element_by_xpath(input_value_amount).send_keys(3000) self.driver.find_element_by_xpath(input_min_step).send_keys(30) self.driver.execute_script("window.scrollTo(0, 720);") wait_until_visible(self.driver, input_item_description, select_type=By.XPATH) self.driver.find_element_by_xpath(input_item_description).send_keys( 'LOAD_TEST_Below_Threshold') self.driver.find_element_by_xpath(input_quantity).send_keys(10) self.driver.find_element_by_xpath(select_cpv).click() wait_until_visible(self.driver, select_cpv_1item, select_type=By.XPATH) self.driver.find_element_by_xpath(select_cpv_1item).click() wait_for_presence(self.driver, confirm_cpv, select_type=By.XPATH) self.driver.find_element_by_xpath(confirm_cpv).click() sleep(3) self.driver.find_element_by_xpath(click_delivery_checkbox).click() self.driver.execute_script("window.scrollTo(0, 986);") self.driver.find_element_by_xpath(click_dropdown_region).click() wait_until_visible(self.driver, select_region, select_type=By.XPATH) self.driver.find_element_by_xpath(input_postal_code).send_keys('02010') self.driver.find_element_by_xpath(input_locality).send_keys(u"Київ") self.driver.find_element_by_xpath(input_delivery_address).send_keys( "Random Valid Address, 7741") self.driver.find_element_by_xpath(input_delivery_start_date).click() self.driver.find_element_by_xpath(input_delivery_start_date).clear() delivery_start = service.time_service()[4] wait_until_visible(self.driver, input_delivery_start_date, select_type=By.XPATH) self.driver.find_element_by_xpath(input_delivery_start_date).send_keys( delivery_start) self.driver.find_element_by_xpath(input_delivery_end_date).click() self.driver.find_element_by_xpath(input_delivery_end_date).clear() delivery_end = service.time_service()[5] wait_until_visible(self.driver, input_delivery_start_date, select_type=By.XPATH) self.driver.find_element_by_xpath(input_delivery_end_date).send_keys( delivery_end) self.driver.execute_script("window.scrollTo(0, 160);") wait_until_visible(self.driver, step2_button, select_type=By.XPATH) self.driver.find_element_by_xpath(step2_button).click() wait_until_visible(self.driver, step3_button, select_type=By.XPATH) self.driver.find_element_by_xpath(step3_button).click() file_to_upload = service.relative2absolute('./doc1.docx') sleep(1) self.driver.find_element_by_xpath(add_doc).click() sleep(2) wait_for_presence(self.driver, upload_document, select_type=By.XPATH) self.driver.find_element_by_xpath(upload_document).send_keys( file_to_upload) self.driver.find_element_by_xpath(select_doc_type).click() self.driver.find_element_by_xpath(select_doc_type_1).click() wait_until_visible(self.driver, upload_verif, select_type=By.XPATH) self.driver.find_element_by_css_selector(submit_create_tender).click() wait_until_visible(self.driver, close_popup_window, select_type=By.XPATH) self.driver.find_element_by_xpath(close_popup_window).click()