1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| from selenium import webdriver from time import sleep
def input_text(assign, bugType, system, browser, oad, openedBuild="主干", time_out=0.3): elementList = { 'assignedTo_chosen': assign, 'type_chosen': bugType, 'os_chosen': system, 'browser_chosen': browser }
sleep(time_out) driver.find_element('css selector', '[id="openedBuild_chosen"] input').send_keys(openedBuild, '\ue007')
for key, value in elementList.items(): sleep(time_out) driver.find_element('css selector', '[id="'+key+'"]>a>span').click() driver.find_element('css selector', '[id="'+key+'"] input').send_keys(value, '\ue007')
sleep(time_out) driver.find_element('css selector', '[id="contactListGroup"]').click()
for value in oad: sleep(time_out) driver.find_element('css selector', '[id="contactListGroup"] input').send_keys(value, '\ue007')
driver = webdriver.Chrome() driver.get('http://www.gzqylc.com:9999/zentao/my/') input_text('张三', '代码错误', 'windows', 'chrome', "['张三', '王五', '李四']")
|