def test_caiwu_testcase08_citylist_jiagongdian_factorybalance_branch(self): driver = self.driver driver.get(self.base_url + "/") #html body div.container h3.text-center.text-primary a.btn.btn-success.text-center loginclick=driver.find_element_by_css_selector("div.container h3.text-center.text-primary a.btn.btn-success.text-center") ActionChains(driver).double_click(loginclick).perform() driver.find_element_by_id("username").clear() driver.find_element_by_id("username").send_keys(BranchUSER_NAME) driver.find_element_by_id("password").clear() driver.find_element_by_id("password").send_keys(BranchPASS_WORD) driver.find_element_by_id("login-submit").click() print " the testcase test_caiwu_testcase08_citylist_jiagongdian_factorybalance_branch is ",driver.title #self.assertEqual(driver.title, u"财务") time.sleep(2) conn=MySQLdb.connect(host=mysqlhostname,user=mysqlusername,passwd=mysqlpassword,db=mysqlcaiwudb,charset="utf8") global cursor cursor = conn.cursor() #cursor.execute("DELETE FROM outlet_order_cleaning_details") #conn.commit() # cursor.execute("DELETE FROM outlet_order_cleanings") # conn.commit() # # cursor.close() # conn.close() #html body div.navbar.navbar-default.navbar-static-top div.container div.navbar-collapse.collapse.navbar-responsive-collapse ul.nav.navbar-nav li a # driver.find_element_by_css_selector("div.container nav.collapse.navbar-collapse.bs-navbar-collapse ul.nav.navbar-nav li:nth-child(8).active a").click() driver.find_element_by_css_selector("div.container > div > ul > li:nth-child(6) >a").click() self.assertEqual(driver.title, u"财务") #driver.find_element_by_css_selector("div#container.container div.panel.panel-primary.checkout-order table.table.table-striped.city-table tbody tr:nth-child(2) td:nth-child(2).btn-link a:nth-child(9)").click() #html body div#container.container div.panel.panel-primary.checkout-order table.table.table-striped.city-table tbody tr:nth-child(2) td:nth-child(2).btn-link a:nth-child(4).btn.btn-success #self.assertEqual(driver.title, u"财务") #html body div.navbar.navbar-default.navbar-static-top #driver.find_element_by_css_selector("div.container>div.navbar-collapse.collapse.navbar-responsive-collapse>ul.nav.navbar-nav>li:nth-last-child(2)>a").click() #driver.find_element_by_link_text(u"结算管理").click() time.sleep(1) driver.find_element_by_id("title").clear() driver.find_element_by_id("title").send_keys(auto3rd_utiltools.jiagongdianjiesuantestdata) driver.find_element_by_name("commit").click() time.sleep(1) driver.find_element_by_link_text(u"结算").click() self.assertEqual(driver.title, u"财务") #driver.find_element_by_css_selector("div.container>tbody>tr:last-child(2)>td:last-child(2)>a:first-child").click() print str(auto3rd_utiltools.get_day_of_day(1)) #validator some null exception # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_start_time").send_keys("") # #driver.find_element_by_link_text("6").click() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").send_keys("") # driver.find_element_by_name("commit").click() # # time.sleep(1) # # winBeforeHandle = driver.current_window_handle # #print "winBeforeHandle==",winBeforeHandle # winHandles = driver.window_handles # #print "winHandles==",winHandles # for handle in winHandles: # if winBeforeHandle != handle: # driver.switch_to_window(handle) # print " the winBeforeHandle, winHandles is ",winBeforeHandle, winHandles # # validrornullname=driver.find_element_by_class_name("div.container>div.alert.fade.in.alert-danger").text # print " the validrornullname is ",validrornullname driver.find_element_by_id("outlet_jiesuan_form_jiesuan_start_time").send_keys(str(auto3rd_utiltools.today())) #driver.find_element_by_link_text("6").click() driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").send_keys(str(auto3rd_utiltools.get_day_of_day(8))) driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").click() #driver.find_element_by_link_text("20").click() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_start_time").click() # driver.find_element_by_link_text("7").click() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").click() # driver.find_element_by_link_text("10").click() time.sleep(2) #driver.refresh() driver.execute_script("window.scrollBy(0,200)","") driver.execute_script("window.scrollBy(0,document.body.scrollHeight)","") # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_start_time").clear() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_start_time").send_keys(str(auto3rd_utiltools.get_day_of_day(-7))) # #driver.find_element_by_link_text("6").click() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").clear() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").send_keys(str(auto3rd_utiltools.get_day_of_day(3))) time.sleep(1) driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").click() #WebDriverWait(driver, 3).until(lambda driver : driver.title.lower().startswith(u"python")) #WebDriverWait(driver, 3).until(lambda driver : driver.refresh()) driver.execute_script("var doc=document.getElementById('ui-datepicker-div');doc.setAttribute('style','display:block');") #WebDriverWait(driver, 3).until(EC.title_contains(u"财务")) time.sleep(1) #driver.find_element_by_name("commit").click() #driver.find_element_by_link_text(u"生成结算单").click() driver.find_element_by_css_selector("div.container div.orders_container form#jiesuan_form.form-horizontal.new_outlet_jiesuan_form button.button.btn.btn-info.pull-right").click() self.assertEqual(driver.title, u"财务") # winBeforeHandle = driver.current_window_handle # print "winBeforeHandle==",winBeforeHandle # winHandles = driver.window_handles # print "winHandles==",winHandles # for handle in winHandles: # if winBeforeHandle != handle: # driver.switch_to_window(handle) # time.sleep(1) driver.find_element_by_link_text(u"提交审核").click() time.sleep(1) self.assertRegexpMatches(self.close_alert_and_get_its_text(), u"^确认提交审核[\s\S]$") #driver.find_element_by_link_text(u"明细").click() #driver.find_element_by_css_selector("div.btn.btn-success").click() self.assertEqual(driver.title, u"财务") daishenhe=driver.find_element_by_css_selector("div.container table.table.table-striped tbody tr:last-child td:nth-last-child(2)").text print " the daishenhe is ",daishenhe self.assertEqual(daishenhe, u"待审核")
def test_wuliu_testcase08_citylist_jiagongdian_factorybalance(self): driver = self.driver driver.get(self.base_url + "/") loginclick = driver.find_element_by_css_selector( "div#container.container h3.text-center.text-primary a.btn.btn-success.text-center" ) ActionChains(driver).double_click(loginclick).perform() driver.find_element_by_id("username").clear() driver.find_element_by_id("username").send_keys(USER_NAME) driver.find_element_by_id("password").clear() driver.find_element_by_id("password").send_keys(PASS_WORD) driver.find_element_by_id("login-submit").click() time.sleep(2) print " the testcase test_wuliu_testcase08_citylist_jiagongdian_factorybalance is ", driver.title self.assertEqual(driver.title, u"物流") conn = MySQLdb.connect(host=mysqlhostname, user=mysqlusername, passwd=mysqlpassword, db=mysqlrongchangdb, charset="utf8") global cursor cursor = conn.cursor() cursor.execute("DELETE FROM outlet_rules") conn.commit() cursor.close() conn.close() #driver.find_element_by_css_selector("div.container nav.collapse.navbar-collapse.bs-navbar-collapse ul.nav.navbar-nav li:nth-child(8).active a").click() driver.find_element_by_css_selector( "div.container > nav > ul > li:nth-child(8) >a").click() self.assertEqual(driver.title, u"物流") time.sleep(1) driver.find_element_by_css_selector( "div#container.container div.panel.panel-primary.checkout-order table.table.table-striped.city-table tbody tr:nth-child(2) td:nth-child(2).btn-link a:nth-child(9)" ).click() #html body div#container.container div.panel.panel-primary.checkout-order table.table.table-striped.city-table tbody tr:nth-child(2) td:nth-child(2).btn-link a:nth-child(4).btn.btn-success self.assertEqual(driver.title, u"物流") #BJ加工店-长楹天街-店 driver.find_element_by_id("title").clear() driver.find_element_by_id("title").send_keys(u"BJ加工店-长楹天街-店") driver.find_element_by_name("commit").click() time.sleep(1) driver.find_element_by_css_selector( "div#container.container >table.table.table-striped> tbody > tr:nth-child(2) > td:nth-last-child(2) > a:last-child" ).click() #div#container.container > tbody > tr:nth-child(2) > td:nth-last-child(2) > a:last-child #html body div#container.container table.table.table-striped tbody tr#outlets_279 td a.btn.btn-primary.btn-sm self.assertEqual(driver.title, u"物流") Select(driver.find_element_by_id( "outlet_rule_form_category_id")).select_by_visible_text(u"家纺") driver.find_element_by_id("outlet_rule_form_discount").clear() driver.find_element_by_id("outlet_rule_form_discount").send_keys("9") print str(auto3rd_utiltools.today()) driver.find_element_by_id( "outlet_rule_form_start_time_display").send_keys( str(auto3rd_utiltools.today())) #driver.find_element_by_link_text("6").click() driver.find_element_by_id("outlet_rule_form_end_time").send_keys( str(auto3rd_utiltools.get_day_of_day(3))) #driver.find_element_by_link_text("20").click() driver.find_element_by_name("commit").click() self.assertEqual(driver.title, u"物流") time.sleep(2) hell = driver.find_element_by_css_selector( "div#container.container>div#outlet_rule>table.table.table-striped>tbody>tr:last-child>td:last-child>a" ).text print "the hell rules is ", hell #html body div#container.container div#outlet_rule table.table.table-striped tbody tr:last-child td:last-child a.btn.btn-sm.btn-danger #driver.find_element_by_xpath(u"(//a[contains(text(),'删除')])[4]").click() driver.find_element_by_css_selector( "div#container.container>div#outlet_rule>table.table.table-striped>tbody>tr:last-child>td:last-child>a" ).click() #print driver.switch_to_alert().text() time.sleep(2) self.assertRegexpMatches(self.close_alert_and_get_its_text(), u"^确认删除吗[\s\S]$") self.assertEqual(driver.title, u"物流") #driver.find_element_by_link_text(u"创建规则").click() Select(driver.find_element_by_id( "outlet_rule_form_category_id")).select_by_visible_text(u"洗衣") driver.find_element_by_id("outlet_rule_form_discount").clear() driver.find_element_by_id("outlet_rule_form_discount").send_keys("10") driver.find_element_by_id( "outlet_rule_form_start_time_display").send_keys( str(auto3rd_utiltools.today())) #driver.find_element_by_link_text("6").click() driver.find_element_by_id("outlet_rule_form_end_time").send_keys( str(auto3rd_utiltools.get_day_of_day(3))) #driver.find_element_by_link_text("20").click() driver.find_element_by_name("commit").click() self.assertEqual(driver.title, u"物流") time.sleep(2) # driver.find_element_by_id("outlet_rule_form_start_time_display").click() # driver.find_element_by_link_text("6").click() # driver.find_element_by_id("outlet_rule_form_end_time").click() # driver.find_element_by_link_text("20").click() # driver.find_element_by_name("commit").click() Select(driver.find_element_by_id( "outlet_rule_form_category_id")).select_by_visible_text(u"洗鞋") driver.find_element_by_id( "outlet_rule_form_start_time_display").send_keys( str(auto3rd_utiltools.today())) #driver.find_element_by_link_text("6").click() driver.find_element_by_id("outlet_rule_form_end_time").send_keys( str(auto3rd_utiltools.get_day_of_day(3))) #driver.find_element_by_link_text("20").click() driver.find_element_by_id("outlet_rule_form_discount").clear() driver.find_element_by_id("outlet_rule_form_discount").send_keys("2") driver.find_element_by_name("commit").click() self.assertEqual(driver.title, u"物流") time.sleep(2) #Select(driver.find_element_by_id("outlet_rule_form_category_id")).select_by_visible_text(u"奢侈品") Select(driver.find_element_by_id( "outlet_rule_form_category_id")).select_by_visible_text(u"家纺") driver.find_element_by_id("outlet_rule_form_discount").clear() driver.find_element_by_id("outlet_rule_form_discount").send_keys("8") driver.find_element_by_id( "outlet_rule_form_start_time_display").send_keys( str(auto3rd_utiltools.today())) #driver.find_element_by_link_text("6").click() driver.find_element_by_id("outlet_rule_form_end_time").send_keys( str(auto3rd_utiltools.get_day_of_day(3))) #driver.find_element_by_link_text("20").click() driver.find_element_by_name("commit").click() self.assertEqual(driver.title, u"物流")
def test_wuliu_testcase08_citylist_jiagongdian_factorybalance(self): driver = self.driver driver.get(self.base_url + "/") loginclick=driver.find_element_by_css_selector("div#container.container h3.text-center.text-primary a.btn.btn-success.text-center") ActionChains(driver).double_click(loginclick).perform() driver.find_element_by_id("username").clear() driver.find_element_by_id("username").send_keys(USER_NAME) driver.find_element_by_id("password").clear() driver.find_element_by_id("password").send_keys(PASS_WORD) driver.find_element_by_id("login-submit").click() time.sleep(2) print " the testcase test_wuliu_testcase08_citylist_jiagongdian_factorybalance is ",driver.title self.assertEqual(driver.title, u"物流") conn=MySQLdb.connect(host=mysqlhostname,user=mysqlusername,passwd=mysqlpassword,db=mysqlrongchangdb,charset="utf8") global cursor cursor = conn.cursor() cursor.execute("DELETE FROM outlet_rules") conn.commit() cursor.close() conn.close() #driver.find_element_by_css_selector("div.container nav.collapse.navbar-collapse.bs-navbar-collapse ul.nav.navbar-nav li:nth-child(8).active a").click() driver.find_element_by_css_selector("div.container > nav > ul > li:nth-child("+auto3rd_utiltools.jiagongdianjiesuan_balancetab+") >a").click() self.assertEqual(driver.title, u"物流") time.sleep(1) driver.find_element_by_css_selector("div#container.container div.panel.panel-primary.checkout-order table.table.table-striped.city-table tbody tr:nth-child(2) td:nth-child(2).btn-link a:nth-child(9)").click() #html body div#container.container div.panel.panel-primary.checkout-order table.table.table-striped.city-table tbody tr:nth-child(2) td:nth-child(2).btn-link a:nth-child(4).btn.btn-success self.assertEqual(driver.title, u"物流") #BJ加工店-长楹天街-店 driver.find_element_by_id("title").clear() driver.find_element_by_id("title").send_keys(auto3rd_utiltools.jiagongdianjiesuantestdata) driver.find_element_by_name("commit").click() time.sleep(1) driver.find_element_by_css_selector("div#container.container >table.table.table-striped> tbody > tr:nth-child(2) > td:nth-last-child(2) > a:last-child").click() #div#container.container > tbody > tr:nth-child(2) > td:nth-last-child(2) > a:last-child #html body div#container.container table.table.table-striped tbody tr#outlets_279 td a.btn.btn-primary.btn-sm self.assertEqual(driver.title, u"物流") Select(driver.find_element_by_id("outlet_rule_form_category_id")).select_by_visible_text(auto3rd_utiltools.kuaixicode) driver.find_element_by_id("outlet_rule_form_discount").clear() driver.find_element_by_id("outlet_rule_form_discount").send_keys("19") time.sleep(1) print str(auto3rd_utiltools.today()) driver.find_element_by_id("outlet_rule_form_start_time_display").send_keys(str(auto3rd_utiltools.today())) #driver.find_element_by_link_text("6").click() driver.find_element_by_id("outlet_rule_form_end_time").send_keys(str(auto3rd_utiltools.get_day_of_day(3))) #driver.find_element_by_link_text("20").click() driver.find_element_by_name("commit").click() self.assertEqual(driver.title, u"物流") time.sleep(2) hell=driver.find_element_by_css_selector("div#container.container>div#outlet_rule>table.table.table-striped>tbody>tr:last-child>td:last-child>a").text print "the hell rules is ",hell #html body div#container.container div#outlet_rule table.table.table-striped tbody tr:last-child td:last-child a.btn.btn-sm.btn-danger #driver.find_element_by_xpath(u"(//a[contains(text(),'删除')])[4]").click() driver.find_element_by_css_selector("div#container.container>div#outlet_rule>table.table.table-striped>tbody>tr:last-child>td:last-child>a").click() #print driver.switch_to_alert().text() time.sleep(2) self.assertRegexpMatches(self.close_alert_and_get_its_text(), u"^确认删除吗[\s\S]$") self.assertEqual(driver.title, u"物流") #driver.find_element_by_link_text(u"创建规则").click() Select(driver.find_element_by_id("outlet_rule_form_category_id")).select_by_visible_text(auto3rd_utiltools.xiyicode) driver.find_element_by_id("outlet_rule_form_discount").clear() driver.find_element_by_id("outlet_rule_form_discount").send_keys("10") driver.find_element_by_id("outlet_rule_form_start_time_display").send_keys(str(auto3rd_utiltools.today())) #driver.find_element_by_link_text("6").click() driver.find_element_by_id("outlet_rule_form_end_time").send_keys(str(auto3rd_utiltools.get_day_of_day(3))) #driver.find_element_by_link_text("20").click() driver.find_element_by_name("commit").click() self.assertEqual(driver.title, u"物流") time.sleep(2) # driver.find_element_by_id("outlet_rule_form_start_time_display").click() # driver.find_element_by_link_text("6").click() # driver.find_element_by_id("outlet_rule_form_end_time").click() # driver.find_element_by_link_text("20").click() # driver.find_element_by_name("commit").click() Select(driver.find_element_by_id("outlet_rule_form_category_id")).select_by_visible_text(auto3rd_utiltools.xixiecode) driver.find_element_by_id("outlet_rule_form_start_time_display").send_keys(str(auto3rd_utiltools.today())) #driver.find_element_by_link_text("6").click() driver.find_element_by_id("outlet_rule_form_end_time").send_keys(str(auto3rd_utiltools.get_day_of_day(3))) #driver.find_element_by_link_text("20").click() driver.find_element_by_id("outlet_rule_form_discount").clear() driver.find_element_by_id("outlet_rule_form_discount").send_keys("2") driver.find_element_by_name("commit").click() self.assertEqual(driver.title, u"物流") time.sleep(2) #Select(driver.find_element_by_id("outlet_rule_form_category_id")).select_by_visible_text(u"奢侈品") Select(driver.find_element_by_id("outlet_rule_form_category_id")).select_by_visible_text(auto3rd_utiltools.kuaixicode) driver.find_element_by_id("outlet_rule_form_discount").clear() driver.find_element_by_id("outlet_rule_form_discount").send_keys("8") driver.find_element_by_id("outlet_rule_form_start_time_display").send_keys(str(auto3rd_utiltools.today())) #driver.find_element_by_link_text("6").click() driver.find_element_by_id("outlet_rule_form_end_time").send_keys(str(auto3rd_utiltools.get_day_of_day(3))) #driver.find_element_by_link_text("20").click() driver.find_element_by_name("commit").click() self.assertEqual(driver.title, u"物流")
def test_caiwu_testcase08_citylist_jiagongdian_factorybalance_branch(self): driver = self.driver driver.get(self.base_url + "/") #html body div.container h3.text-center.text-primary a.btn.btn-success.text-center loginclick = driver.find_element_by_css_selector( "div.container h3.text-center.text-primary a.btn.btn-success.text-center" ) ActionChains(driver).double_click(loginclick).perform() driver.find_element_by_id("username").clear() driver.find_element_by_id("username").send_keys(BranchUSER_NAME) driver.find_element_by_id("password").clear() driver.find_element_by_id("password").send_keys(BranchPASS_WORD) driver.find_element_by_id("login-submit").click() print " the testcase test_caiwu_testcase08_citylist_jiagongdian_factorybalance_branch is ", driver.title #self.assertEqual(driver.title, u"财务") time.sleep(2) conn = MySQLdb.connect(host=mysqlhostname, user=mysqlusername, passwd=mysqlpassword, db=mysqlcaiwudb, charset="utf8") global cursor cursor = conn.cursor() #cursor.execute("DELETE FROM outlet_order_cleaning_details") #conn.commit() # cursor.execute("DELETE FROM outlet_order_cleanings") # conn.commit() # # cursor.close() # conn.close() #html body div.navbar.navbar-default.navbar-static-top div.container div.navbar-collapse.collapse.navbar-responsive-collapse ul.nav.navbar-nav li a # driver.find_element_by_css_selector("div.container nav.collapse.navbar-collapse.bs-navbar-collapse ul.nav.navbar-nav li:nth-child(8).active a").click() driver.find_element_by_css_selector( "div.container > div > ul > li:nth-child(6) >a").click() self.assertEqual(driver.title, u"财务") #driver.find_element_by_css_selector("div#container.container div.panel.panel-primary.checkout-order table.table.table-striped.city-table tbody tr:nth-child(2) td:nth-child(2).btn-link a:nth-child(9)").click() #html body div#container.container div.panel.panel-primary.checkout-order table.table.table-striped.city-table tbody tr:nth-child(2) td:nth-child(2).btn-link a:nth-child(4).btn.btn-success #self.assertEqual(driver.title, u"财务") #html body div.navbar.navbar-default.navbar-static-top #driver.find_element_by_css_selector("div.container>div.navbar-collapse.collapse.navbar-responsive-collapse>ul.nav.navbar-nav>li:nth-last-child(2)>a").click() #driver.find_element_by_link_text(u"结算管理").click() time.sleep(1) driver.find_element_by_id("title").clear() driver.find_element_by_id("title").send_keys(u"BJ加工店-长楹天街-店") driver.find_element_by_name("commit").click() time.sleep(1) driver.find_element_by_link_text(u"结算").click() self.assertEqual(driver.title, u"财务") #driver.find_element_by_css_selector("div.container>tbody>tr:last-child(2)>td:last-child(2)>a:first-child").click() print str(auto3rd_utiltools.get_day_of_day(1)) #validator some null exception # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_start_time").send_keys("") # #driver.find_element_by_link_text("6").click() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").send_keys("") # driver.find_element_by_name("commit").click() # # time.sleep(1) # # winBeforeHandle = driver.current_window_handle # #print "winBeforeHandle==",winBeforeHandle # winHandles = driver.window_handles # #print "winHandles==",winHandles # for handle in winHandles: # if winBeforeHandle != handle: # driver.switch_to_window(handle) # print " the winBeforeHandle, winHandles is ",winBeforeHandle, winHandles # # validrornullname=driver.find_element_by_class_name("div.container>div.alert.fade.in.alert-danger").text # print " the validrornullname is ",validrornullname driver.find_element_by_id( "outlet_jiesuan_form_jiesuan_start_time").send_keys( str(auto3rd_utiltools.today())) #driver.find_element_by_link_text("6").click() driver.find_element_by_id( "outlet_jiesuan_form_jiesuan_end_time").send_keys( str(auto3rd_utiltools.get_day_of_day(8))) driver.find_element_by_id( "outlet_jiesuan_form_jiesuan_end_time").click() #driver.find_element_by_link_text("20").click() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_start_time").click() # driver.find_element_by_link_text("7").click() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").click() # driver.find_element_by_link_text("10").click() time.sleep(2) #driver.refresh() driver.execute_script("window.scrollBy(0,200)", "") driver.execute_script("window.scrollBy(0,document.body.scrollHeight)", "") # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_start_time").clear() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_start_time").send_keys(str(auto3rd_utiltools.get_day_of_day(-7))) # #driver.find_element_by_link_text("6").click() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").clear() # driver.find_element_by_id("outlet_jiesuan_form_jiesuan_end_time").send_keys(str(auto3rd_utiltools.get_day_of_day(3))) time.sleep(1) driver.find_element_by_id( "outlet_jiesuan_form_jiesuan_end_time").click() #WebDriverWait(driver, 3).until(lambda driver : driver.title.lower().startswith(u"python")) #WebDriverWait(driver, 3).until(lambda driver : driver.refresh()) #WebDriverWait(driver, 3).until(EC.title_contains(u"财务")) driver.find_element_by_name("commit").click() time.sleep(1) self.assertEqual(driver.title, u"财务") # winBeforeHandle = driver.current_window_handle # print "winBeforeHandle==",winBeforeHandle # winHandles = driver.window_handles # print "winHandles==",winHandles # for handle in winHandles: # if winBeforeHandle != handle: # driver.switch_to_window(handle) # driver.find_element_by_link_text(u"提交审核").click() time.sleep(1) self.assertRegexpMatches(self.close_alert_and_get_its_text(), u"^确认提交审核[\s\S]$") #driver.find_element_by_link_text(u"明细").click() #driver.find_element_by_css_selector("div.btn.btn-success").click() self.assertEqual(driver.title, u"财务") daishenhe = driver.find_element_by_css_selector( "div.container table.table.table-striped tbody tr:last-child td:nth-last-child(2)" ).text print " the daishenhe is ", daishenhe self.assertEqual(daishenhe, u"待审核")