Complete function create_agent

This commit is contained in:
cesar991 2016-07-05 10:55:56 +02:00
parent af53a72051
commit 487d36936e
1 changed files with 16 additions and 4 deletions

View File

@ -183,10 +183,22 @@ def search_agent(driver,agent_name):
driver.find_element_by_id("submit-srcbutton").click()
driver.find_element_by_css_selector("b").click()
def create_agent(driver,agent_name):
def create_agent(driver,agent_name,ip=None,description=None,group=None,os_id=None):
click_menu_element(driver,"Agent detail")
driver.find_element_by_id("submit-crt").click()
driver.find_element_by_id("text-agente").click()
driver.find_element_by_id("text-agente").clear()
driver.find_element_by_id("text-agente").send_keys(agent_name)
driver.find_element_by_id("submit-crtbutton").click()
if ip != None:
driver.find_element_by_id("text-direccion").clear()
driver.find_element_by_id("text-direccion").send_keys(ip)
if description != None:
driver.find_element_by_id("text-comentarios").clear()
driver.find_element_by_id("text-comentarios").send_keys(description)
if group != None:
Select(driver.find_element_by_id("grupo")).select_by_visible_text(group)
if os_id !=None:
Select(driver.find_element_by_id("id_os")).select_by_visible_text(os_id)