def DistributionlineVoluMonthCalcResult_Fun(self): # 点击理论线损树 time.sleep(1) self.driver.find_element_by_id( self.DistributionlineLossTree_id).click() # 点击配电网计算结果查询 time.sleep(1) self.driver.find_element_by_xpath( self.TheoreticalLineLossCalResult_Xpath).click() time.sleep(1) # 点击月报表 self.driver.find_element_by_xpath( self.DistributionLineMonthlyReport_Xpath).click() time.sleep(1) # 点击配电线路线损表 self.driver.find_element_by_xpath( self.LinelossmeterDistributionline_Xpath).click() time.sleep(1) # 切换frame到配电线路线损表frame self.driver.switch_to.frame(self.DistributionLineCalcResult_frame) time.sleep(1) # 点击左下方的导出按钮 self.driver.find_element_by_id(self.Export_id).click() time.sleep(10) #读取导出文件execl内容,生成列表返回 self.ExportExecl = ExcelData( u"C:\\Users\\" + GetUsername() + u"\\Downloads\\配电线路损耗报表(月).xls", u"配电线路损耗报表(月)") return self.ExportExecl.readExcel()
def TranotherlossmonCalcResult_Fun(self): #进入理论线损模块 self.driver.find_element_by_id(self.TheoreticalLineLoss_ID).click() time.sleep(2) #进入输电网计算结果查询 self.driver.find_element_by_xpath( self.TranotherlossManualcal_Xpath).click() time.sleep(2) #进入月报表 self.driver.find_element_by_xpath( self.TranotherlossmonReport_Xpath).click() time.sleep(2) #进入其他损耗表 self.driver.find_element_by_xpath( self.TranotherlossmonCalcResult_Xpath).click() time.sleep(5) #进入查询frame框 self.driver.switch_to_frame(self.TranotherlossmonCalcResult_frame) time.sleep(3) #点击导出 self.driver.find_element_by_id(self.Daochu_id).click() time.sleep(10) self.data_file = u'C:\\Users\\Admin\Downloads\输电网其他损耗报表(月).xls' self.sheetname = u'输电网其他损耗报表(月)' self.Excel = ExcelData(self.data_file, self.sheetname) self.Excel_Data = self.Excel.readExcel() return self.Excel_Data
def DistributionlinePieSStDay_Fun(self): '''配电线路线损率分段统计结果核对''' #点击线损分析 self.driver.find_element_by_id(self.LineLossAnalysis_ID).click() time.sleep(2) #点击配电网计算结果分析 self.driver.find_element_by_xpath(self.TheoreticalLineLosscalresultAnalysis_Xpath).click() time.sleep(2) #点击日分析 self.driver.find_element_by_xpath(self.DistributionLineDayAnalysis_Xpath).click() time.sleep(2) #点击配电线路线损率分段统计 self.driver.find_element_by_xpath(self.DistributionlineLossRateSegStatistics_Xpath).click() time.sleep(2) #切换到配电线路线损率分段统计的frame中 self.driver.switch_to.frame(self.DistributionlineLossRateSegStatistics_frame) time.sleep(2) self.driver.implicitly_wait(15) #点击导出 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(5) self.data_file=u"C:\\Users\\Admin\Downloads\配电线路线损率分段统计表样一(日).xlsx" self.sheetname="Sheet1" self.Excel=ExcelData(self.data_file,self.sheetname) self.Excel_Data=self.Excel.readExcel() #print self.Excel_Data return self.Excel_Data
def DistributionlineEleQuamoncalcResult_Fun(self): '''620kv月电量法计算结果验证''' #点击理论线损 self.driver.find_element_by_id(self.TheoreticalLineLoss_ID).click() time.sleep(2) #点击配电线路计算结果查询xpath self.driver.find_element_by_xpath( self.TheoreticalLineLossManualcal_Xpath).click() time.sleep(2) #点击配线月报表 self.driver.find_element_by_xpath( self.DistributionLineMonthlyReport_Xpath).click() time.sleep(2) #点击配电线路线损表 self.driver.find_element_by_xpath( self.Linelossmeterofdistributionline_Xpath).click() time.sleep(2) #切换到结果frame self.driver.switch_to_frame(self.DistributionLineCalcResult_frame) self.driver.implicitly_wait(30) #点击导出按钮 self.driver.find_element_by_id(self.Daochu_id).click() time.sleep(10) self.data_path = u'C:\\Users\\' + GetUsername( ) + u'\\Downloads\\配电线路损耗报表(月).xls' self.sheetname = u'配电线路损耗报表(月)' self.Excel = ExcelData(self.data_path, self.sheetname) self.ExcelDataa = self.Excel.readExcel() #return json.dumps(self.ExcelDataa, encoding="UTF-8", ensure_ascii=False) return self.ExcelDataa '''for i in range(self.BeginNum,self.EndNum):
def NewtonMethodWholeLossAnalysisDayTrans_Fun(self,*args): #点击线损分析 self.driver.find_element_by_id(self.LineLossAnalysis_ID).click() time.sleep(1) #点击输电网结果分析 self.driver.find_element_by_xpath(self.WholeLossResultAnalysis_xpath).click() time.sleep(1) #点击日分析 self.driver.find_element_by_xpath(self.MonAnalysis_xpath).click() time.sleep(1) #点击输电网综合分析 self.driver.find_element_by_xpath(self.WholeLossAnalysis_xpath).click() time.sleep(5) #切换到报表的frame self.driver.switch_to_frame(self.WholelossAnalysisIframe_ID) #点击查询 self.driver.find_element_by_id(self.Query_ID).click() time.sleep(5) #点击导线追溯链接 self.driver.find_element_by_xpath(self.Trans_xpath).click() time.sleep(5) self.driver.switch_to.parent_frame() #切换Iframe self.driver.switch_to_frame(self.TransIframe_ID) #点击导出 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(5) self.data_file=u'C:\\Users\\'+GetUsername()+ u'\\Downloads\\输电网高损变压器分析(日).xls' self.sheetname=u'输电网高损变压器分析(日)' self.Excel=ExcelData(self.data_file,self.sheetname) self.Excel_Data=self.Excel.readExcel() #print self.Excel_Data return self.Excel_Data
def DistrictEleQuamoncalcResult_Fun(self): '''400V月电量法计算结果验证''' #点击理论线损 self.driver.find_element_by_id(self.TheoreticalLineLoss_ID).click() time.sleep(2) #点击配电线路计算结果查询xpath self.driver.find_element_by_xpath( self.TheoreticalLineLossManualcal_Xpath).click() time.sleep(2) #点击配线月报表 self.driver.find_element_by_xpath( self.DistributionLineMonthlyReport_Xpath).click() time.sleep(2) #点击台区线路线损表 self.driver.find_element_by_xpath( self.LinelossmeterofDistrict_Xpath).click() time.sleep(2) #切换到结果frame self.driver.switch_to_frame(self.DistrictCalcResult_frame) #self.driver.implicitly_wait(30) time.sleep(4) # a=self.driver.find_element_by_id(self.export_id).text # print a #点击导出按钮 self.driver.find_element_by_id(self.export_id).click() time.sleep(5) self.data_path = u'C:\\Users\\' + GetUsername( ) + u'\\Downloads\\低压台区损耗表报表(月).xls' self.sheetname = u'低压台区损耗表报表(月)' self.Excel = ExcelData(self.data_path, self.sheetname) self.ExcelDataa = self.Excel.readExcel() #return json.dumps(self.ExcelDataa, encoding="UTF-8", ensure_ascii=False) return self.ExcelDataa
def NewtonMethodAclineMonCalcResult_Fun(self, *args): #点击理论线损 self.driver.find_element_by_id(self.LineLoss_ID).click() time.sleep(1) #点击输电网计算结果查询 self.driver.find_element_by_xpath( self.WholelossCalcResultQuery_Xpath).click() time.sleep(1) #点击月报表 self.driver.find_element_by_xpath(self.MonCalcResult_Xpath).click() time.sleep(1) #点击导线损耗表 self.driver.find_element_by_xpath(self.AclineLossResult_Xpath).click() time.sleep(5) #切换到报表的frame self.driver.switch_to_frame(self.AclineLossResultIframe_ID) #点击查询 self.driver.find_element_by_id(self.Query_ID).click() time.sleep(5) #点击导出 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(5) self.data_file = u'C:\\Users\\' + GetUsername( ) + u'\\Downloads\\导线损耗月报表.xls' self.sheetname = u'导线损耗月报表' self.Excel = ExcelData(self.data_file, self.sheetname) self.Excel_Data = self.Excel.readExcel() #print self.Excel_Data return self.Excel_Data
def NewtonMethodWholelossDayVoltCalcResult_Fun(self, *args): #点击理论线损 self.driver.find_element_by_id(self.LineLoss_ID).click() time.sleep(1) #点击输电网计算结果查询 self.driver.find_element_by_xpath( self.WholelossCalcResultQuery_Xpath).click() time.sleep(1) #点击日报表 self.driver.find_element_by_xpath(self.DayCalcResult_Xpath).click() time.sleep(1) #点击输电网分压线损表 self.driver.find_element_by_xpath( self.WholelossDayVoltCalcResult_Xpath).click() time.sleep(5) #切换到报表的frame self.driver.switch_to_frame(self.WholelossDayVoltCalcResultIframe_ID) #点击导出 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(5) self.data_file = u'C:\\Users\\' + GetUsername( ) + u'\\Downloads\\全网分电压损耗报表(日).xls' self.sheetname = u'全网分电压损耗报表(日)' self.Excel = ExcelData(self.data_file, self.sheetname) self.Excel_Data = self.Excel.readExcel() #print self.Excel_Data return self.Excel_Data
def DistributionlineFlowDayCalcResult_Fun(self): '''潮流精确算法配电线路线损表结果验证''' #点击理论线损 self.driver.find_element_by_id(self.TheoreticalLineLoss_ID).click() time.sleep(2) #点击配电网计算结果查询 self.driver.find_element_by_xpath( self.TheoreticalLineLosscalresult_Xpath).click() time.sleep(2) #点击日报表 self.driver.find_element_by_xpath( self.DistributionLineDayReport_Xpath).click() time.sleep(2) #点击配电线路线损表 self.driver.find_element_by_xpath( self.DistributionlinedaycalcResult_Xpath).click() time.sleep(2) #切换到配电线路线损表的frame中 self.driver.switch_to_frame(self.DistributionlinedaycalcResult_frame) time.sleep(5) #点击导出 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(10) self.data_file = u"C:\\Users\\Admin\Downloads\配电线路损耗报表(日).xls" self.sheetname = u"配电线路损耗报表(日)" self.Excel = ExcelData(self.data_file, self.sheetname) self.Excel_Data = self.Excel.readExcel() return self.Excel_Data
def DistrictEleQuamonWirecalcResult_Fun(self): # 点击理论线损计算 self.driver.find_element_by_id(self.TheoreticalLineLoss_ID).click() time.sleep(2) # 点击配电线路计算结果查询 self.driver.find_element_by_xpath(self.TheoreticalLineLossManualcal_Xpath).click() time.sleep(2) # 点击月报表 self.driver.find_element_by_xpath(self.DistributionLineMonthlyReport_Xpath).click() time.sleep(2) # 点击台区线路线损表 self.driver.find_element_by_xpath(self.LinelosswireofDistrict_Xpath).click() time.sleep(2) #切换到结果frame self.driver.switch_to_frame(self.TheoreticalwireResult_frame) time.sleep(5) self.driver.implicitly_wait(30) ##点击电表损耗链接 self.driver.find_element_by_xpath(self.Transformerwire_Xpath).click() time.sleep(5) self.driver.switch_to.parent_frame() ## 跳出当前iframe self.driver.implicitly_wait(10) ##切换到变压器损耗明细结果frame self.driver.switch_to_frame(self.DistrictCalcResult_frame) self.driver.implicitly_wait(30) # 导出按钮id self.driver.find_element_by_id(self.export_id).click() time.sleep(10) self.data_path = u'C:\\Users\\'+GetUsername()+u'\\Downloads\\低压台区导线损耗报表(月).xls' self.sheetname = u'低压台区导线损耗报表(月)' self.Excel = ExcelData(self.data_path, self.sheetname) self.ExcelDataa = self.Excel.readExcel() return self.ExcelDataa
def DistributionlineComAStDay_Fun(self): '''潮流精确算法-配电线路综合分析日报表结果核对''' #点击线损分析 self.driver.find_element_by_id(self.LineLossAnalysis_ID).click() time.sleep(2) #点击配电网计算结果分析 self.driver.find_element_by_xpath( self.TheoreticalLineLosscalresultAnalysis_Xpath).click() time.sleep(2) #点击日分析 self.driver.find_element_by_xpath( self.DistributionLineDayAnalysis_Xpath).click() time.sleep(2) #点击配电线路综合分析 self.driver.find_element_by_xpath( self.DistributionlinedaycalcAnalysis_Xpath).click() time.sleep(2) #切换到配电线路综合分析的frame中 self.driver.switch_to.frame(self.DistributionlinedaycalcAnalysis_frame) time.sleep(2) self.driver.implicitly_wait(15) #点击查询条件中日期的下拉框 self.driver.find_element_by_css_selector(self.DateDropBox_CSS).click() time.sleep(2) self.driver.find_element_by_css_selector(self.DateDropBox_CSS1).click() time.sleep(2) #切换到日期选择框中的frame cf = self.driver.find_element_by_css_selector(self.Date_frame) self.driver.switch_to.frame(cf) time.sleep(5) #点击日期下拉框年的下拉框 self.driver.find_element_by_id(self.DateYearDropBox_ID).click() time.sleep(2) #选择日期下拉框年中的2015 self.driver.find_element_by_xpath(self.YearSelect2015_Xpath).click() time.sleep(2) #点击日期下拉框代表日的下拉框 self.driver.find_element_by_id(self.DateRepresentativeDay_ID).click() time.sleep(2) #选择日期下拉框代表日中的2015-08-01 self.driver.find_element_by_xpath( self.DateRepresentativeDay20150801_Xpath).click() time.sleep(2) #点击日期下拉框中的确定按钮 self.driver.find_element_by_id(self.DateDropBoxSure_ID).click() time.sleep(2) self.driver.switch_to.parent_frame() ##跳出日期下拉框的frame self.driver.implicitly_wait(10) #点击页面中的查询按钮 self.driver.find_element_by_class_name(self.Query_Class).click() time.sleep(7) #点击左下角的导出 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(5) self.data_file = u"C:\\Users\\Admin\Downloads\配电线路线损综合分析报表.xls" self.sheetname = u"配电线路线损综合分析报表" self.Excel = ExcelData(self.data_file, self.sheetname) self.Excel_Data = self.Excel.readExcel() return self.Excel_Data
def DistributionlinePieSSubDay_Fun(self): '''配电线路线损率分段变电站追溯统计结果核对''' #点击线损分析 self.driver.find_element_by_id(self.LineLossAnalysis_ID).click() time.sleep(2) #点击配电网计算结果分析 self.driver.find_element_by_xpath(self.TheoreticalLineLosscalresultAnalysis_Xpath).click() time.sleep(2) #点击日分析 self.driver.find_element_by_xpath(self.DistributionLineDayAnalysis_Xpath).click() time.sleep(2) #点击配电线路线损率分段统计 self.driver.find_element_by_xpath(self.DistributionlineLossRateSegStatistics_Xpath).click() time.sleep(2) #切换到配电线路线损率分段统计的frame中 self.driver.switch_to.frame(self.DistributionlineLossRateSegStatistics_frame) time.sleep(2) self.driver.implicitly_wait(10) #切换到配电线路线损率分段统计查询结果的frame中 self.driver.switch_to.frame(self.DistributionlineLossRateSegStatisticsResult_frame) self.driver.implicitly_wait(10) #点击单位追溯 self.driver.find_element_by_css_selector(self.CompanyRetrospect_css).click() time.sleep(3) self.driver.switch_to.parent_frame() ##跳出结果框的frame time.sleep(5) self.driver.switch_to.default_content() ##跳出最开始的页面frame time.sleep(5) #切换到配电网线损率分段统计追溯报表(分单位日)frame中 self.driver.switch_to.frame(self.CompanyRetrospect_frame) time.sleep(2) self.driver.implicitly_wait(10) #切换到配电网线损率分段统计追溯报表(分单位日)结果frame中 self.driver.switch_to.frame(self.CompanyRetrospectResult_frame) self.driver.implicitly_wait(10) #点击变电站名称追溯 self.driver.find_element_by_link_text(self.SubstationRetrospect_link).click() time.sleep(3) self.driver.switch_to.parent_frame() ##跳出结果框的frame time.sleep(5) self.driver.switch_to.parent_frame() ##跳出分单位的页面frame time.sleep(5) #切换到配电网线损率分段统计追溯报表(分变电站日)frame中 self.driver.switch_to.frame(self.SubstationRetrospectResult_frame) time.sleep(5) #点击导出 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(5) self.data_file=u"C:\\Users\\Admin\Downloads\配电线路线损率分段统计表样三(日).xlsx" self.sheetname="Sheet1" self.Excel=ExcelData(self.data_file,self.sheetname) self.Excel_Data=self.Excel.readExcel() #print self.Excel_Data return self.Excel_Data
def NewtonMethodTransAnalysisMonRetrospect_Fun(self,*args): #点击线损分析 self.driver.find_element_by_id(self.LineLossAnalysis_ID).click() time.sleep(1) #点击输电网结果分析 self.driver.find_element_by_xpath(self.WholeLossResultAnalysis_xpath).click() time.sleep(1) #点击月分析 self.driver.find_element_by_xpath(self.MonAnalysis_xpath).click() time.sleep(1) #点击变压器经济运行分析 self.driver.find_element_by_xpath(self.TransAnalysis_xpath).click() time.sleep(5) #切换到报表的frame self.driver.switch_to_frame(self.TransAnalysisIframe_ID) time.sleep(1) #激活月份选择框 self.driver.find_element_by_id(self.Month_ID).click() time.sleep(1) #选择2015 self.driver.find_element_by_xpath(self.Year_xpath).click() time.sleep(1) #选择八月 self.driver.find_element_by_xpath(self.Month_xpath).click() time.sleep(1) #点击确定 self.driver.find_element_by_id(self.ConfirmButton_ID).click() time.sleep(1) #点击查询 self.driver.find_element_by_id(self.Query_ID).click() time.sleep(5) #点击重载变追溯链接 self.driver.find_element_by_xpath(self.TransRetrospect_xpath).click() time.sleep(5) self.driver.switch_to.parent_frame() #切换Iframe self.driver.switch_to_frame(self.TransRetrospect_Iframe) #点击导出 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(5) self.data_file=u'C:\\Users\\'+GetUsername()+ u'\\Downloads\\输电网变压器损耗明细(月)-重载变.xls' self.sheetname=u'输电网变压器损耗明细(月)-重载变' self.Excel=ExcelData(self.data_file,self.sheetname) self.Excel_Data=self.Excel.readExcel() #print self.Excel_Data return self.Excel_Data
def TranotherlosshourCalcResult_Fun(self): #进入理论线损模块 self.driver.find_element_by_id(self.TheoreticalLineLoss_ID).click() time.sleep(2) #进入输电网计算结果查询 self.driver.find_element_by_xpath( self.TranotherlossManualcal_Xpath).click() time.sleep(2) #进入整点报表 self.driver.find_element_by_xpath( self.TranotherlosshourReport_Xpath).click() time.sleep(2) #进入其他损耗表 self.driver.find_element_by_xpath( self.TranotherlosshourCalcResult_Xpath).click() time.sleep(5) #进入查询frame框 self.driver.switch_to_frame(self.TranotherlosshourCalcResult_frame) time.sleep(3) #打开日期控件 self.driver.find_element_by_id(self.Day_box_xpath).click() time.sleep(2) #选择20140801 self.driver.find_element_by_xpath(self.DayResult_xpath).click() time.sleep(2) #选择零点 self.driver.find_element_by_id(self.ZeroHour_ID).clear() time.sleep(2) self.driver.find_element_by_id(self.ZeroHour_ID).send_keys('0') time.sleep(2) #点击日期控件确定 self.driver.find_element_by_id(self.DayQueding_id).click() time.sleep(2) #点击查询 self.driver.find_element_by_id(self.Chaxun_id).click() time.sleep(3) #点击导出 self.driver.find_element_by_id(self.Daochu_id).click() time.sleep(10) self.data_file = u'C:\\Users\\' + GetUsername( ) + u'\\Downloads\\输电网其他损耗报表(小时).xls' self.sheetname = u'输电网其他损耗报表(小时)' self.Excel = ExcelData(self.data_file, self.sheetname) self.Excel_Data = self.Excel.readExcel() #print self.Excel_Data return self.Excel_Data
def NewtonMethodLosspartVoltHourCalcResult_Fun(self, *args): #点击理论线损 self.driver.find_element_by_id(self.LineLoss_ID).click() time.sleep(1) #点击输电网计算结果查询 self.driver.find_element_by_xpath( self.WholelossCalcResultQuery_Xpath).click() time.sleep(1) #点击整点报表 self.driver.find_element_by_xpath(self.HourCalcResult_Xpath).click() time.sleep(1) #点击分片分压线损表 self.driver.find_element_by_xpath( self.LossPartVoltResult_Xpath).click() time.sleep(5) #切换到报表的frame self.driver.switch_to_frame(self.LossPartVoltResultIframe_ID) #选择开始时间 self.driver.find_element_by_xpath(self.StartTimeWindow_xpath).click() time.sleep(0.2) self.driver.find_element_by_xpath(self.StartTimeDate_xpath).click() time.sleep(0.2) for i in range(0, 23): self.driver.find_element_by_id(self.StartTimeAdjust_ID).click() i = i + 1 time.sleep(0.1) time.sleep(0.2) self.driver.find_element_by_xpath(self.StartTimeButton_xpath).click() #点击查询 self.driver.find_element_by_id(self.Query_ID).click() time.sleep(5) #点击导出 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(5) self.data_file = u'C:\\Users\\' + GetUsername( ) + u'\\Downloads\\全网分片分压线损报表(小时).xls' self.sheetname = u'全网分片分压线损报表(小时)' self.Excel = ExcelData(self.data_file, self.sheetname) self.Excel_Data = self.Excel.readExcel() #print self.Excel_Data return self.Excel_Data
def DistTransformerFlowDayCalcResult_Fun(self): '''潮流精确算法配电变压器损耗结果验证''' #点击理论线损 self.driver.find_element_by_id(self.TheoreticalLineLoss_ID).click() time.sleep(2) #点击配电网计算结果查询 self.driver.find_element_by_xpath( self.TheoreticalLineLosscalresult_Xpath).click() time.sleep(2) #点击日报表 self.driver.find_element_by_xpath( self.DistributionLineDayReport_Xpath).click() time.sleep(2) #点击配电线路线损表 self.driver.find_element_by_xpath( self.DistributionlinedaycalcResult_Xpath).click() time.sleep(2) #切换到配电线路线损表frame中 self.driver.switch_to_frame(self.DistributionlinedaycalcResult_frame) self.driver.implicitly_wait(15) #点击配电变压器损耗值 self.driver.find_element_by_xpath( self.DistTransformerLoss_Xpath).click() time.sleep(2) self.driver.switch_to.parent_frame() ##跳出配电线路线损表frame self.driver.implicitly_wait(10) #切换到配电变压器损耗表(24点)frame中 self.driver.switch_to_frame( self.DistTransformerLossdaycalcResult_frame) self.driver.implicitly_wait(15) #点击左下角的导出 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(10) self.data_file = u"C:\\Users\\Admin\Downloads\配电变压器损耗报表(24点).xls" self.sheetname = u"配电变压器损耗报表(24点)" self.Excel = ExcelData(self.data_file, self.sheetname) self.Excel_data = self.Excel.readExcel() return self.Excel_data
def DistTransformerEleQuaDayCalResult_Fun(self): '''配电日电量法变压器损耗表链接页面结果验证''' #点击理论线损计算 self.driver.find_element_by_id(self.TheoreticalLineLoss_ID).click() time.sleep(2) #点击配电线路计算结果查询 self.driver.find_element_by_xpath( self.TheoreticalLineLossManualcalResult_Xpath).click() time.sleep(2) #点击月报表 self.driver.find_element_by_xpath( self.TheoreticalLineloss620kVMonth_Xpath).click() time.sleep(2) #点击配电线路线损表 self.driver.find_element_by_xpath(self.WiringReport_Xpath).click() time.sleep(2) ###切换到结果frame self.driver.switch_to_frame(self.TheoreticalLinelossResult_frame) time.sleep(2) self.driver.implicitly_wait(30) ##点击变压器损耗链接 self.driver.find_element_by_xpath(self.Transformerlosslj_Xpath).click() time.sleep(3) self.driver.switch_to.parent_frame() ## 跳出当前iframe self.driver.implicitly_wait(10) ##切换到变压器损耗明细结果frame self.driver.switch_to_frame(self.TransformerlossCalcResult_frame) self.driver.implicitly_wait(30) #导出按钮id self.driver.find_element_by_id(self.Daochu_ID).click() time.sleep(10) self.data_path = u"C:\\Users\\" + GetUsername( ) + u"\\Downloads\\配电变压器损耗表报表(日).xls" self.sheetname = u'配电变压器损耗表报表(日)' self.Excel = ExcelData(self.data_path, self.sheetname) self.ExcelDataa = self.Excel.readExcel() return self.ExcelDataa
def DistributionlineVoluDayCalcTransLoss_Fun(self): # 点击理论线损树 time.sleep(1) self.driver.find_element_by_id( self.DistributionlineLossTree_id).click() # 点击配电网计算结果查询 time.sleep(1) self.driver.find_element_by_xpath( self.TheoreticalLineLossCalResult_Xpath).click() time.sleep(1) # 点击月报表 self.driver.find_element_by_xpath( self.DistributionLineDaylyReport_Xpath).click() time.sleep(1) # 点击配电线路线损表 self.driver.find_element_by_xpath( self.LinelossmeterDistributionline_Xpath).click() time.sleep(1) # 切换frame到配电线路线损表frame self.driver.switch_to.frame(self.DistributionLineCalcResult_frame) self.driver.implicitly_wait(30) #点击变压器损耗的连接 self.driver.find_element_by_xpath(self.TransLossLink_Path).click() time.sleep(1) #切换到变压器损耗的frame中 self.driver.switch_to.parent_frame() time.sleep(1) self.driver.switch_to.frame(self.TransLossFrame_id) time.sleep(1) # 点击左下方的导出按钮 self.driver.find_element_by_id(self.Export_id).click() time.sleep(10) #读取导出文件execl内容,生成列表返回 self.ExportExecl = ExcelData( u"C:\\Users\\" + GetUsername() + u"\\Downloads\\配电变压器损耗表报表(日).xls", u"配电变压器损耗表报表(日)") return self.ExportExecl.readExcel()
def DistAclinesegeEleQuaMonCalResult_Fun(self): '''导线损耗表链接页面结果验证''' #点击理论线损计算 self.driver.find_element_by_id(self.TheoreticalLineLoss_ID).click() time.sleep(2) #点击配电线路计算结果查询 self.driver.find_element_by_xpath( self.TheoreticalLineLossManualcalResult_Xpath).click() time.sleep(2) #点击月报表 self.driver.find_element_by_xpath( self.TheoreticalLineloss620kVMonth_Xpath).click() time.sleep(2) #点击配电线路线损表 self.driver.find_element_by_xpath(self.WiringReport_Xpath).click() time.sleep(2) ###切换到结果frame self.driver.switch_to_frame(self.TheoreticalLinelossResult_frame) time.sleep(2) self.driver.implicitly_wait(30) ##点击导线损耗链接 self.driver.find_element_by_xpath(self.WireLosslj_Xpath).click() time.sleep(3) self.driver.switch_to.parent_frame() ## 跳出当前iframe self.driver.implicitly_wait(10) ##切换到导线结果frame self.driver.switch_to_frame(self.WireCalculateResult_frame) self.driver.implicitly_wait(30) #导出按钮id self.driver.find_element_by_id(self.Daochu_ID).click() time.sleep(10) self.data_path = u'C:\\Users\\' + GetUsername( ) + u'\\Downloads\\配电线路导线损耗报表(月).xls' self.sheetname = u'配电线路导线损耗报表(月)' self.Excel = ExcelData(self.data_path, self.sheetname) self.ExcelDataa = self.Excel.readExcel() return self.ExcelDataa
def DistributionlineComAAOLLCDay_Fun(self): '''配线追溯页面结果验证''' #点击线损分析 self.driver.find_element_by_id(self.LineLossAnalysis_ID).click() time.sleep(2) #点击配电网计算结果分析 self.driver.find_element_by_xpath( self.TheoreticalLineLosscalresultAnalysis_Xpath).click() time.sleep(2) #点击日分析 self.driver.find_element_by_xpath( self.DistributionLineDayAnalysis_Xpath).click() time.sleep(2) #点击配电线路综合分析 self.driver.find_element_by_xpath( self.DistributionlinedaycalcAnalysis_Xpath).click() time.sleep(2) #切换到配电线路综合分析的frame中 self.driver.switch_to.frame(self.DistributionlinedaycalcAnalysis_frame) time.sleep(2) self.driver.implicitly_wait(15) #点击查询条件中日期的下拉框 self.driver.find_element_by_css_selector(self.DateDropBox_CSS).click() time.sleep(2) self.driver.find_element_by_css_selector(self.DateDropBox_CSS1).click() time.sleep(2) #切换到日期选择框中的frame cf = self.driver.find_element_by_css_selector(self.Date_frame) self.driver.switch_to.frame(cf) time.sleep(5) #点击日期下拉框年的下拉框 self.driver.find_element_by_id(self.DateYearDropBox_ID).click() time.sleep(2) #选择日期下拉框年中的2015 self.driver.find_element_by_xpath(self.YearSelect2015_Xpath).click() time.sleep(2) #点击日期下拉框代表日的下拉框 self.driver.find_element_by_id(self.DateRepresentativeDay_ID).click() time.sleep(2) #选择日期下拉框代表日中的2015-08-01 self.driver.find_element_by_xpath( self.DateRepresentativeDay20150801_Xpath).click() time.sleep(2) #点击日期下拉框中的确定按钮 self.driver.find_element_by_id(self.DateDropBoxSure_ID).click() time.sleep(2) self.driver.switch_to.parent_frame() ##跳出日期下拉框的frame self.driver.implicitly_wait(10) #点击页面中的查询按钮 self.driver.find_element_by_class_name(self.Query_Class).click() time.sleep(7) #点击配电线路追溯 self.driver.find_element_by_xpath(self.Distributioin_Xpath).click() time.sleep(3) #跳出配电线路线损分析的frame self.driver.switch_to.default_content() self.driver.implicitly_wait(10) #切换到配电线路线损组成分析(日)frame中 self.driver.switch_to.frame(self.DistributioinRetrospect_frame) self.driver.implicitly_wait(7) #点击配线追溯页面的导出 self.driver.find_element_by_class_name(self.Export_Class).click() time.sleep(5) self.data_file = u"C:\\Users\\Administrator\Downloads\配电线路线损组成分析(日).xls" self.sheetname = u"配电线路线损组成分析(日)" self.sheetname1 = u"图表数据" self.Excel = ExcelData(self.data_file, self.sheetname) self.Excel1 = ExcelData(self.data_file, self.sheetname1) self.Excel_Data = self.Excel.readExcel() self.Excel_Data1 = self.Excel.readExcel() return self.Excel_Data return self.Excel_Data1
def DistributionlineEconomicTranDay_Fun(self): '''配电线路综合分析-经济变追溯结果核对''' #点击线损分析 self.driver.find_element_by_id(self.LineLossAnalysis_ID).click() time.sleep(2) #点击配电网计算结果分析 self.driver.find_element_by_xpath( self.TheoreticalLineLosscalresultAnalysis_Xpath).click() time.sleep(2) #点击日分析 self.driver.find_element_by_xpath( self.DistributionLineDayAnalysis_Xpath).click() time.sleep(2) #点击配电线路综合分析 self.driver.find_element_by_xpath( self.DistributionlinedaycalcAnalysis_Xpath).click() time.sleep(2) #切换到配电线路综合分析的frame中 self.driver.switch_to.frame(self.DistributionlinedaycalcAnalysis_frame) time.sleep(2) self.driver.implicitly_wait(15) #点击查询条件中日期的下拉框 self.driver.find_element_by_css_selector(self.DateDropBox_CSS).click() time.sleep(2) self.driver.find_element_by_css_selector(self.DateDropBox_CSS1).click() time.sleep(2) #切换到日期选择框中的frame cf = self.driver.find_element_by_css_selector(self.Date_frame) self.driver.switch_to.frame(cf) time.sleep(6) #点击日期下拉框年的下拉框 self.driver.find_element_by_id(self.DateYearDropBox_ID).click() time.sleep(2) #选择日期下拉框年中的2015 self.driver.find_element_by_xpath(self.YearSelect2015_Xpath).click() time.sleep(2) #点击日期下拉框代表日的下拉框 self.driver.find_element_by_id(self.DateRepresentativeDay_ID).click() time.sleep(2) #选择日期下拉框代表日中的2015-08-01 self.driver.find_element_by_xpath( self.DateRepresentativeDay20150801_Xpath).click() time.sleep(2) #点击日期下拉框中的确定按钮 self.driver.find_element_by_id(self.DateDropBoxSure_ID).click() time.sleep(2) self.driver.switch_to.parent_frame() ##跳出日期下拉框的frame self.driver.implicitly_wait(10) #点击页面中的查询按钮 self.driver.find_element_by_class_name(self.Query_Class).click() time.sleep(7) #点击变压器台数追溯 self.driver.find_element_by_xpath( self.DisttransformerNum_Xpath).click() time.sleep(3) #跳出配电线路综合分析的frame self.driver.switch_to.default_content() self.driver.implicitly_wait(15) #切换到配变运行综合分析(日)frame中 self.driver.switch_to.frame(self.DisttransformerNum_frame) self.driver.implicitly_wait(7) #点击经济变台数 self.driver.find_element_by_xpath(self.EcnomicTranNum_Xpath).click() time.sleep(3) self.driver.switch_to.parent_frame() ##跳出配变运行综合分析(日)frame time.sleep(5) #切换到配变损耗组成分析-经济变frame中 self.driver.switch_to.frame(self.EcnomicTranNum_frame) time.sleep(5) #点击左下角的导出按钮 self.driver.find_element_by_id(self.Export_ID).click() time.sleep(4) self.data_file = u"C:\\Users\\Admin\Downloads\配变损耗组成分析(日)-经济变.xls" self.sheetname = u"配变损耗组成分析(日)-经济变" self.Excel = ExcelData(self.data_file, self.sheetname) self.Excel_Data = self.Excel.readExcel() #print self.Excel_Data return self.Excel_Data
self.driver.switch_to.parent_frame() ## 跳出当前iframe self.driver.implicitly_wait(10) ##切换到变压器损耗明细结果frame self.driver.switch_to_frame(self.TransformerlossCalcResult_frame) self.driver.implicitly_wait(30) #导出按钮id self.driver.find_element_by_id(self.Daochu_ID).click() time.sleep(10) self.data_path = u"C:\\Users\\" + GetUsername( ) + u"\\Downloads\\配电变压器损耗表报表(日).xls" self.sheetname = u'配电变压器损耗表报表(日)' self.Excel = ExcelData(self.data_path, self.sheetname) self.ExcelDataa = self.Excel.readExcel() return self.ExcelDataa if __name__ == "__main__": driver = webdriver.Chrome() Try = Login.Login(driver) Try.Login_Function('lyltest', '000000') Try1 = DistTransformerEleQuaDayCalResult(driver) aaa = Try1.DistTransformerEleQuaDayCalResult_Fun() data_path = u'D:\\svn\\eagle2\\05Test\\Auto\\Project\\EagleProjecttest\\Data\\eagle620kv\\配电变压器损耗表报表(日).xls' sheetname = u'配电变压器损耗表报表(日)' Excel = ExcelData(data_path, sheetname) bbb = Excel.readExcel() a = cmp(aaa, bbb) print a time.sleep(10) driver.quit()