def zidingyicheliang_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1,33,34)[0]).click() time.sleep(2) self.assertEqual('车辆管理',self.dr.find_element_by_xpath(currMenupath).text,'校验车辆管理菜单') self.dr.find_element_by_xpath(sheet_menu.col_values(3,33,34)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,33,34)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(3) self.assertEqual('自定义车辆列表',self.dr.find_element_by_xpath(page_title).text,'校验自定义车辆菜单')
def mdjf_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1,48,49)[0]).click() time.sleep(5) self.assertEqual('社区警务',self.dr.find_element_by_xpath(currMenupath).text, '社区警务') self.dr.find_element_by_xpath(sheet_menu.col_values(3,48,49)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,48,49)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('矛盾纠纷调处列表', self.dr.find_element_by_xpath(page_title).text, '矛盾纠纷调解')
def jykh_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1,79,80)[0]).click() time.sleep(5) self.assertEqual('警员绩效考核',self.dr.find_element_by_xpath(currMenupath).text, '警员绩效考核') self.dr.find_element_by_xpath(sheet_menu.col_values(3,79,80)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,79,80)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('考核指标模板周期列表', self.dr.find_element_by_xpath(page_title).text, '考核指标模板周期列表')
def shebian_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1,10,11)[0]).click() time.sleep(5) self.assertEqual('人口管理',self.dr.find_element_by_xpath(currMenupath).text, '人口管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3,10,11)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,10,11)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('涉边/涉稳/涉恐/涉外人员', self.dr.find_element_by_xpath(page_title).text, '涉边/涉稳/涉恐/涉外人员')
def zhaoshi_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1,17,18)[0]).click() time.sleep(5) self.assertEqual('人口管理',self.dr.find_element_by_xpath(currMenupath).text, '人口管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3,17,18)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,17,18)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('肇事肇祸人员列表', self.dr.find_element_by_xpath(page_title).text, '肇事肇祸人员')
def qjgl_search_test(self): self.login(login_name_test, login_password_test) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 63, 64)[0]).click() time.sleep(5) self.assertEqual('勤务管理', self.dr.find_element_by_xpath(currMenupath).text, '勤务管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 63, 64)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 63, 64)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('人员请假条列表', self.dr.find_element_by_xpath(page_title).text, '人员请假管理')
def jyzp_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 80, 81)[0]).click() time.sleep(5) self.assertEqual('警员绩效考核', self.dr.find_element_by_xpath(currMenupath).text, '警员绩效考核') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 80, 81)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 80, 81)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('警员自评及上级评价列表', self.dr.find_element_by_xpath('/html/body/div[1]/div').text, '警员自评及上级评价')
def qunfangxinxiguanli_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1,31,32)[0]).click() time.sleep(5) self.assertEqual('人口管理',self.dr.find_element_by_xpath(currMenupath).text, '人口管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3,31,32)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,31,32)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('群防信息管理列表', self.dr.find_element_by_xpath(page_title).text, '群防信息管理')
def tongdaobiandong_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1,40,41)[0]).click() time.sleep(5) self.assertEqual('管理防范',self.dr.find_element_by_xpath(currMenupath).text, '管理防范') self.dr.find_element_by_xpath(sheet_menu.col_values(3,40,41)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,40,41)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('通道便道列表', self.dr.find_element_by_xpath('/html/body/div[1]/p').text, '通道便道管理')
def ctqwxdjy_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1,56,57)[0]).click() time.sleep(3) self.assertEqual('勤务管理',self.dr.find_element_by_xpath(currMenupath).text, '勤务管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3,56,57)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,56,57)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(3) self.assertEqual('处突勤务行动纪要列表', self.dr.find_element_by_xpath(page_title).text, '处突勤务行动纪要')
def bianmaodian_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1,42,43)[0]).click() time.sleep(5) self.assertEqual('管理防范',self.dr.find_element_by_xpath(currMenupath).text, '管理防范') self.dr.find_element_by_xpath(sheet_menu.col_values(3,42,43)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,42,43)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('边贸点管理', self.dr.find_element_by_xpath('/html/body/div[1]/p').text, '边贸点管理')
def jcjdj_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1,50,51)[0]).click() time.sleep(5) self.assertEqual('社区警务',self.dr.find_element_by_xpath(currMenupath).text, '社区警务') self.dr.find_element_by_xpath(sheet_menu.col_values(3,50,51)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,50,51)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('接处警登记列表', self.dr.find_element_by_xpath(page_title).text, '接处警登记')
def rydlrz_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath('//*[@id="next"]').click() time.sleep(2) self.dr.find_element_by_xpath(sheet_menu.col_values(1,69,70)[0]).click() time.sleep(5) self.assertEqual('系统管理',self.dr.find_element_by_xpath(currMenupath).text, '系统管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3,69,70)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5,69,70)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('人员日志管理', self.dr.find_element_by_xpath('/html/body/div[1]/div').text, '人员登录日志')
def czrk_search(self): self.login(login_name,login_password) time.sleep(5) self.dr.find_element_by_xpath(sheet_menu.col_values(1,3,4)[0]).click() time.sleep(2) self.assertEqual('人口管理', self.dr.find_element_by_xpath(currMenupath).text, '人口管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3,3,4)[0]).click() time.sleep(2) self.dr.find_element_by_xpath(sheet_menu.col_values(5,3,4)[0]).click() time.sleep(2) self.dr.switch_to.frame('iframeb') self.assertEqual('常住人口', self.dr.find_element_by_xpath(page_title).text, '常住人口')
def bfz_search(self): self.login(login_name, login_password) time.sleep(5) self.dr.find_element_by_xpath(sheet_menu.col_values(1,2,3)[0]).click() time.sleep(2) self.assertEqual('人口管理', self.dr.find_element_by_xpath(sheet_setting.col_values(0,1,2)[0]).text, '人口管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3,2,3)[0]).click() time.sleep(2) self.dr.find_element_by_xpath(sheet_menu.col_values(5,2,3)[0]).click() time.sleep(2) self.dr.switch_to.frame('iframeb') self.assertEqual('边防证列表', self.dr.find_element_by_xpath(sheet_setting.col_values(1,1,2)[0]).text, '边防证办理情况')
def fahui_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 24, 25)[0]).click() time.sleep(5) self.assertEqual('人口管理', self.dr.find_element_by_xpath(currMenupath).text, '人口管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 24, 25)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 24, 25)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('法会列表', self.dr.find_element_by_xpath(page_title).text, '法会')
def gongzuoduixiang_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 20, 21)[0]).click() time.sleep(5) self.assertEqual('人口管理', self.dr.find_element_by_xpath(currMenupath).text, '人口管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 20, 21)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 20, 21)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('工作对象人员', self.dr.find_element_by_xpath(page_title).text, '工作对象人员')
def wfzry_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 8, 9)[0]).click() time.sleep(5) self.assertEqual('人口管理', self.dr.find_element_by_xpath(currMenupath).text, '人口管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 8, 9)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 8, 9)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('违法犯罪人员', self.dr.find_element_by_xpath(page_title).text, '违法犯罪人员')
def erxianzhancheliang_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 36, 37)[0]).click() time.sleep(2) self.assertEqual('车辆管理', self.dr.find_element_by_xpath(currMenupath).text, '校验车辆管理菜单') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 36, 37)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 36, 37)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(3) self.assertEqual('二线站过往记录列表', self.dr.find_element_by_xpath(page_title).text, '二线站车辆过往记录')
def sihei_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 21, 22)[0]).click() time.sleep(5) self.assertEqual('人口管理', self.dr.find_element_by_xpath(currMenupath).text, '人口管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 21, 22)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 21, 22)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual( '四黑人员列表', self.dr.find_element_by_xpath('/html/body/div[1]/p').text, '四黑人员')
def zhibanguanli_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 62, 63)[0]).click() time.sleep(5) self.assertEqual('勤务管理', self.dr.find_element_by_xpath(currMenupath).text, '勤务管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 62, 63)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 62, 63)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual('值班管理列表', self.dr.find_element_by_xpath(page_title).text, '值班管理')
def shexiangtou_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 37, 38)[0]).click() time.sleep(5) self.assertEqual('管理防范', self.dr.find_element_by_xpath(currMenupath).text, '管理防范') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 37, 38)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 37, 38)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual( '摄像头基本信息列表', self.dr.find_element_by_xpath('/html/body/div[1]/p').text, '摄像头基本信息')
def hangyechangsuo_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 38, 39)[0]).click() time.sleep(5) self.assertEqual('管理防范', self.dr.find_element_by_xpath(currMenupath).text, '管理防范') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 38, 39)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 38, 39)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual( '行业管理列表', self.dr.find_element_by_xpath('/html/body/div[1]/p').text, '行业场所管理')
def jiebeijiezhuang_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 39, 40)[0]).click() time.sleep(5) self.assertEqual('管理防范', self.dr.find_element_by_xpath(currMenupath).text, '管理防范') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 39, 40)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 39, 40)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual( '界碑界桩列表', self.dr.find_element_by_xpath('/html/body/div[1]/p').text, '界碑界桩管理')
def zzjggl_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath('//*[@id="next"]').click() time.sleep(2) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 65, 66)[0]).click() time.sleep(5) self.assertEqual('系统管理', self.dr.find_element_by_xpath(currMenupath).text, '系统管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 65, 66)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 65, 66)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual( '组织机构人员列表', self.dr.find_element_by_xpath( '/html/body/div[1]/div[2]/div/div/p').text, '组织机构管理')
def jwxx_search(self): self.login(login_name, login_password) self.dr.find_element_by_xpath('//*[@id="next"]').click() time.sleep(2) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 77, 78)[0]).click() time.sleep(5) self.assertEqual('系统管理', self.dr.find_element_by_xpath(currMenupath).text, '系统管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 77, 78)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 77, 78)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual( '移动警务信息管理列表', self.dr.find_element_by_xpath('/html/body/div[1]/div').text, '警务消息')
def rkgl_search_test(self): self.login(login_name_test, login_password_test) self.dr.find_element_by_xpath('//*[@id="next"]').click() time.sleep(2) self.dr.find_element_by_xpath(sheet_menu.col_values(1, 64, 65)[0]).click() time.sleep(5) self.assertEqual('系统管理', self.dr.find_element_by_xpath(currMenupath).text, '系统管理') self.dr.find_element_by_xpath(sheet_menu.col_values(3, 64, 65)[0]).click() self.dr.find_element_by_xpath(sheet_menu.col_values(5, 64, 65)[0]).click() self.dr.switch_to.frame('iframeb') time.sleep(5) self.assertEqual( '人员列表', self.dr.find_element_by_xpath('/html/body/div[1]/div').text, '人员管理')
import time import os import re from public_package.pubilc_package import url,login_name,login_name_test,login_password,login_password_test from public_package.pubilc_package import sheet_setting, search, reset, currMenupath, page_title, goback, saveBtn,sheet_menu,sheet_prompt_message,work_space from public_package.pubilc_package import TESTCASE import xlrd from selenium.webdriver.common.alert import Alert ''' 用例名称: 用例编号: 用例场景: 用例作者: ''' xlsfile=work_space+r'\\'+sheet_menu.col_values(6,10,11)[0] excel = xlrd.open_workbook(xlsfile) global sheet sheet = excel.sheet_by_name('涉边') class TESTCAST_SHEBIANSHEKONG(TESTCASE): def setUp(self): self.dr = webdriver.Chrome() self.dr.maximize_window() def tearDown(self): # print("脚本执行完成") self.dr.quit() def login(self, username, password):
from selenium.webdriver.support.ui import Select import time import os import re from public_package.pubilc_package import url, login_name, login_name_test, login_password, login_password_test from public_package.pubilc_package import TESTCASE from public_package.pubilc_package import sheet_setting, search, reset, currMenupath, page_title, goback, saveBtn, sheet_menu, sheet_prompt_message, work_space import xlrd ''' 用例名称: 用例编号: 用例场景: 用例作者: ''' xlsfile = work_space + r'\\' + sheet_menu.col_values(6, 27, 28)[0] excel = xlrd.open_workbook(xlsfile) global sheet sheet = excel.sheet_by_name('在逃人员') class TESTCAST_ZAITAO(TESTCASE): def setUp(self): self.dr = webdriver.Chrome() self.dr.maximize_window() def tearDown(self): # print("脚本执行完成") self.dr.quit() def login(self, username, password):
import time import os import re from public_package.pubilc_package import url, login_name, login_name_test, login_password, login_password_test, login_password_test2 from public_package.pubilc_package import sheet_setting, search, reset, currMenupath, page_title, goback, saveBtn, sheet_menu, sheet_prompt_message, work_space from public_package.pubilc_package import TESTCASE import HTMLTestRunner import xlrd ''' 用例名称: 用例编号: 用例场景: 用例作者: ''' xlsfile = work_space + r'\\' + sheet_menu.col_values(6, 64, 65)[0] excel = xlrd.open_workbook(xlsfile) global sheet sheet = excel.sheet_by_name('人员管理') class TESTCAST_RKGL(TESTCASE): def setUp(self): self.dr = webdriver.Chrome() self.dr.maximize_window() def tearDown(self): # print("脚本执行完成") self.dr.quit() def login(self, username, password):