Add search_service function in service_functions

This commit is contained in:
cesar991 2016-07-26 09:57:53 +02:00
parent a1c870ba11
commit 9d5edfdefa
1 changed files with 24 additions and 0 deletions

View File

@ -33,3 +33,27 @@ def delete_report(driver,report_name):
driver.find_element_by_id('image-delete2').click()
alert = driver.switch_to_alert()
alert.accept()
def search_service(driver,name,group="All",status="Any",mode="Any",go_to_service=True):
# If go_to_service = False this function can not enter in service
driver.find_element_by_xpath('//a[contains(.,"Filter")]').click()
driver.find_element_by_id("text-free_search").clear()
driver.find_element_by_id("text-free_search").send_keys(name)
if group != None:
driver.find_element_by_xpath('//option[contains(.,"'+group+'")]').click()
if status != "Any":
driver.find_element_by_xpath('//option[contains(.,"'+status+'")]').click()
if mode != "Any":
driver.find_element_by_xpath('//option[contains(.,"'+mode+'")]').click()
driver.find_element_by_id("submit-search").click()
if go_to_service == True:
driver.find_element_by_xpath('//a[contains(.,"'+name+'")]').click()