browser.find_element_by_xpath("//div[@id='createProject']/ul/li/div/div[4]/div").click()
time.sleep(2)
browser.find_element_by_id("project_locations.html").click()
time.sleep(2)
nowhandle=browser.current_window_handle
#aalhandles=browser.window_handles()
browser.find_element_by_id("btnAddLocation").click()//运行到这的时候,下面的脚本根本就不执行了
print"ok"
browser.switch_to_window(browser.current_window_handle())
# win=browser.current_window_handle
# print "win==", win
# win01=browser.window_handles
# print"win01==", win01
#browser.switch_to_window("Index")
#browser.switch_to_window(handle)
#aalhandles=browser.window_handles()
#print len(aalhandles)
# for handle in browser.window_handles:
# if handle!=nowhandle:
# browser.switch_to_window(handle)
# browser.find_element_by_xpath("//div[@id='grid']/tbody/tr[2]/td/div/span").click()
# browser.find_element_by_xpath("//div[@id='outlist']/div/div[3]/div/table/thead/tr/th/div/span").click()
#a= browser.find_element_by_xpath("//div[@id='grid']/tbody/tr[2]/td/div/span")
# time.sleep(2)
#browser.find_element_by_xpath("//div[@id='grid']/tbody/tr[2]/td/div/span").click()
browser.switch_to_window(nowhandle)
time.sleep(2)
browser.find_element_by_id("cb_000005a").click()
browser.find_element_by_id("btnSelect").click()
time.sleep(2)
browser.find_element_by_id("project_companies.html").click()
browser.find_element_by_xpath("//div[@id='content']/div[2]/div/div[3]/div/table/thead/tr/th/div/span").click()