def __init__(self, driver): '''潮流精确算法配电线路线损表结果验证''' self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectFilePath + "\Page_object\Data\DistributionlineFlowDayCalcResult.yaml") self.Page_Data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_Data['DistributionlineFlowDayCalcResult'] #点击理论线损 self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #点击配电网计算结果查询 self.TheoreticalLineLosscalresult_Xpath = self.Data[ 'TheoreticalLineLosscalresult_Xpath'] #点击日报表 self.DistributionLineDayReport_Xpath = self.Data[ 'DistributionLineDayReport_Xpath'] #点击配电线路线损表 self.DistributionlinedaycalcResult_Xpath = self.Data[ 'DistributionlinedaycalcResult_Xpath'] #切换到配电线路线损表的frame中 self.DistributionlinedaycalcResult_frame = self.Data[ 'DistributionlinedaycalcResult_frame'] #点击导出 self.Export_ID = self.Data['Export_ID']
def __init__(self, driver): '''潮流精确算法配电变压器损耗结果验证''' self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data = open( self.ProjectFilePath + "\Page_object\Data\DistTransformerFlowDayCalcResult.yaml") self.Page_data = yaml.load(self.Page_object_data) self.Page_object_data.close() self.Data = self.Page_data['DistTransformerFlowDayCalcResult'] #点击理论线损 self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #点击配电网计算结果查询 self.TheoreticalLineLosscalresult_Xpath = self.Data[ 'TheoreticalLineLosscalresult_Xpath'] #点击日报表 self.DistributionLineDayReport_Xpath = self.Data[ 'DistributionLineDayReport_Xpath'] #点击配电线路线损表 self.DistributionlinedaycalcResult_Xpath = self.Data[ 'DistributionlinedaycalcResult_Xpath'] #切换到配电线路线损表frame中 self.DistributionlinedaycalcResult_frame = self.Data[ 'DistributionlinedaycalcResult_frame'] #点击配电变压器损耗值 self.DistTransformerLoss_Xpath = self.Data['DistTransformerLoss_Xpath'] #切换到配电变压器损耗表(24点)frame中 self.DistTransformerLossdaycalcResult_frame = self.Data[ 'DistTransformerLossdaycalcResult_frame'] #点击左下角的导出 self.Export_ID = self.Data['Export_ID']
def __init__(self, driver): '''400V月电量法计算结果验证''' #self.driver=webdriver.Chrome() self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectFilePath + "\Page_object\Data\DistrictEleQuamoncalcResult.yaml") self.Page_Data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_Data['DistrictEleQuamoncalcResult'] #理论线损id self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #点击配电线路计算结果查询xpath self.TheoreticalLineLossManualcal_Xpath = self.Data[ 'TheoreticalLineLossManualcal_Xpath'] #点击配线月报表 self.DistributionLineMonthlyReport_Xpath = self.Data[ 'DistributionLineMonthlyReport_Xpath'] #点击台区线损表 self.LinelossmeterofDistrict_Xpath = self.Data[ 'LinelossmeterofDistrict_Xpath'] #切换到结果frame self.DistrictCalcResult_frame = self.Data['DistrictCalcResult_frame'] #点击导出 self.export_id = self.Data['export_id']
def __init__(self, driver): '''导线损耗表链接页面结果验证''' #self.driver=webdriver.Chrome() self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectFilePath + "\Page_object\Data\DistAclinesegeEleQuaMonCalResult.yaml") self.Page_Data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_Data['DistAclinesegeEleQuaMonCalResult'] #点击理论线损计算 self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #点击配电线路计算结果查询 self.TheoreticalLineLossManualcalResult_Xpath = self.Data[ 'TheoreticalLineLossManualcalResult_Xpath'] ##点击月报表 self.TheoreticalLineloss620kVMonth_Xpath = self.Data[ 'TheoreticalLineloss620kVMonth_Xpath'] #点击配电线路线损表 self.WiringReport_Xpath = self.Data['WiringReport_Xpath'] ##切换到结果frame self.TheoreticalLinelossResult_frame = self.Data[ 'TheoreticalLinelossResult_frame'] ##点击导线损耗链接 self.WireLosslj_Xpath = self.Data['WireLosslj_Xpath'] ##切换到导线结果frame self.WireCalculateResult_frame = self.Data['WireCalculateResult_frame'] #导出按钮id self.Daochu_ID = self.Data['Daochu_ID']
def __init__(self, driver): #self.driver = webdriver.Chrome() self.driver = driver self.datafile = GetProjectFilePath( ) + u"\Page_object\Data\DistributionlineVoluMonthCalc.yaml" with open(self.datafile) as datafile: self.data = yaml.load(datafile) self.datamsg = self.data['DistributionlineVoluMonthCalc'] #树结构中理论线损的ID self.DistributionlineLossTree_id = self.datamsg[ "DistributionlineLossTree_id"] # 树结构中理论线损手工计算的xpath定位路径 self.DistributionlineLossManualCal_xpath = self.datamsg[ "DistributionlineLossManualCal_xpath"] # 理论线损手工计算frame信息 self.TheoreticalLineloss620kV_Frame_id = self.datamsg[ "TheoreticalLineloss620kV_Frame_id"] # 配电网6-20kV理论线损计算tab路径信息 self.TheoreticalLineloss620kVTab_css = self.datamsg[ "TheoreticalLineloss620kVTab_css"] # 选择计算线路定位信息 self.TheroeticalLineloss620kVAeraLine_xpath = self.datamsg[ "TheroeticalLineloss620kVAeraLine_xpath"] # 计算方法选择为容量法定位信息 self.TheroeticalLineLossCalMethod_xpath = self.datamsg[ "TheroeticalLineLossCalMethod_xpath"] # 计算按钮定位新 self.Calculate_css = self.datamsg["Calculate_css"] # 计算成功后弹出框信息ID以及取消按钮ID self.AlertMsg_ID = self.datamsg["AlertMsg_ID"] self.AlertCancel_ID = self.datamsg["AlertCancel_ID"]
def __init__(self, driver): '''620kv月电量法计算结果验证''' #self.driver=webdriver.Chrome() self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectFilePath + "\Page_object\Data\DistributionlineEleQuamoncalcResult.yaml") self.Page_Data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_Data['DistributionlineEleQuamoncalcResult'] #理论线损id self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #点击配电线路计算结果查询xpath self.TheoreticalLineLossManualcal_Xpath = self.Data[ 'TheoreticalLineLossManualcal_Xpath'] #点击配线月报表 self.DistributionLineMonthlyReport_Xpath = self.Data[ 'DistributionLineMonthlyReport_Xpath'] #点击配电线路线损表 self.Linelossmeterofdistributionline_Xpath = self.Data[ 'Linelossmeterofdistributionline_Xpath'] #切换到结果frame self.DistributionLineCalcResult_frame = self.Data[ 'DistributionLineCalcResult_frame'] #点击导出 self.Daochu_id = self.Data['Daochu_id'] '''#获取相关的信息,title和内容信息以前获取,参数变化从1082到1108,range(1082,1109),通过滚动滚动条获取相关信息
def __init__(self, driver): '''配线日均方根电流法变压器损耗表链接页面结果验证''' #self.driver=webdriver.Chrome() self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectFilePath + "\Page_object\Data\DistTransformerEleQuaDayCalResult.yaml") self.Page_Data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_Data['DistTransformerEleQuaDayCalResult'] #点击理论线损计算 self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #点击配电线路计算结果查询 self.TheoreticalLineLossManualcalResult_Xpath = self.Data[ 'TheoreticalLineLossManualcalResult_Xpath'] ##点击日报表 self.TheoreticalLineloss620kVMonth_Xpath = self.Data[ 'TheoreticalLineloss620kVDay_Xpath'] #点击配电线路线损表 self.WiringReport_Xpath = self.Data['WiringReport_Xpath'] ##切换到结果frame self.TheoreticalLinelossResult_frame = self.Data[ 'TheoreticalLinelossResult_frame'] ##点击变压器损耗链接 self.Transformerlosslj_Xpath = self.Data['Transformerlosslj_Xpath'] ##切换到导线结果frame self.TransformerlossCalcResult_frame = self.Data[ 'TransformerlossCalcResult_frame'] #导出按钮id self.Daochu_ID = self.Data['Daochu_ID']
def __init__(self, driver): #驱动 self.driver = driver #获取页面元素 self.ProjectFilePath = GetProjectFilePath() self.Page_object_file = open( self.ProjectFilePath + "\\Page_object\\Data\\NewtonMethodTransAnalysisDayRetrospect.yaml") self.Page_Data = yaml.load(self.Page_object_file) self.Data = self.Page_Data['NewtonMethodTransAnalysisDayRetrospect'] #线损分析ID self.LineLossAnalysis_ID = self.Data['LineLossAnalysis_ID'] #输电网结果分析ID self.WholeLossResultAnalysis_xpath = self.Data[ 'WholeLossResultAnalysis_xpath'] #日分析ID self.MonAnalysis_xpath = self.Data['MonAnalysis_xpath'] #变压器经济运行分析xpath self.TransAnalysis_xpath = self.Data['TransAnalysis_xpath'] #报表iframe的ID self.TransAnalysisIframe_ID = self.Data['TransAnalysisIframe_ID'] #查询按钮ID self.Query_ID = self.Data['Query_ID'] #点击重载变追溯链接 self.TransRetrospect_xpath = self.Data['TransRetrospect_xpath'] #报表iframe的ID self.TransRetrospect_Iframe = self.Data['TransRetrospect_Iframe'] #导出按钮ID self.Export_ID = self.Data['Export_ID']
def __init__(self, driver): self.driver = driver #self.driver = webdriver.Chrome() self.ProjectFilePath = GetProjectFilePath() self.page_object_date_file = open( self.ProjectFilePath + "\Page_object\Data\DistrictEleQuamonMetercalResult.yaml") self.page_Data = yaml.load(self.page_object_date_file) self.page_object_date_file.close() self.Data = self.page_Data['DistrictEleQuamonMetercalResult'] #点击理论线损 self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] # 点击配电线路计算结果查询xpath self.TheoreticalLineLossManualcal_Xpath = self.Data[ 'TheoreticalLineLossManualcal_Xpath'] # 点击配线月报表 self.DistributionLineMonthlyReport_Xpath = self.Data[ 'DistributionLineMonthlyReport_Xpath'] # 点击台区线损表 self.LinelossmeterofDistrict_Xpath = self.Data[ 'LinelossmeterofDistrict_Xpath'] #点击电表损耗frame self.TheoreticalmeterResult_frame = self.Data[ 'TheoreticalmeterResult_frame'] ##点击电表链接 self.Transformermeter_Xpath = self.Data['Transformermeter_Xpath'] # 切换到结果frame self.DistrictCalcResult_frame = self.Data['DistrictCalcResult_frame'] # 点击导出 self.export_id = self.Data['export_id']
def __init__(self, driver): '''620kv日均方根电流法计算结果验证''' #self.driver=webdriver.Chrome() self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectFilePath + "\Page_object\Data\DistributionlineEleQuadaycalcResult.yaml") self.Page_Data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_Data['DistributionlineEleQuadaycalcResult'] #理论线损id self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #点击配电线路计算结果查询xpath self.TheoreticalLineLossManualcal_Xpath = self.Data[ 'TheoreticalLineLossManualcal_Xpath'] #点击配线日报表 self.DistributionLineDayReport_Xpath = self.Data[ 'DistributionLineDayReport_Xpath'] #点击配电线路线损表 self.Linelossmeterofdistributionline_Xpath = self.Data[ 'Linelossmeterofdistributionline_Xpath'] #切换到结果frame self.DistributionLineCalcResult_frame = self.Data[ 'DistributionLineCalcResult_frame'] #点击导出 self.Daochu_id = self.Data['Daochu_id']
def ReportHtml(): ProjectFilePath = GetProjectFilePath() #创建一个测试用例集 suit = unittest.TestSuite() #获取当前时间并生成相关格式进行赋值操作 now = time.strftime("%Y-%m-%d_%H_%M_%S", time.localtime()) #产生报告路径 Reportfile = ProjectFilePath + "\\EagleProjecttest\Report\\" + now + ".html" #case 路径 casefile = ProjectFilePath + "\\EagleProjecttest\case" #获取到casefile所有的文件内容 CaseFileMsg = os.listdir(casefile) discover = unittest.defaultTestLoader.discover(casefile, pattern="*.py", top_level_dir=None) # 将测试用例方法添加到测试集中 for test in discover: for testcase in test: suit.addTest(testcase) Re_Openfile = file(Reportfile, "wb") #加载HTMLTestRunner方法,将数据流写入对应文件并写明title和descripion runner = HTMLTestRunner.HTMLTestRunner(stream=Re_Openfile, title=u'eagle2理论线损测试报告', description=u'eagle2理论线损测试报告') #运行测试用例集 runner.run(suit)
def __init__(self, driver): #驱动 self.driver = driver #获取页面元素 self.ProjectFilePath = GetProjectFilePath() self.Page_object_file = open( self.ProjectFilePath + "\\Page_object\\Data\\NewtonMethodOtherLossHourResult.yaml") self.Page_Data = yaml.load(self.Page_object_file) self.Data = self.Page_Data['NewtonMethodOtherLossHourResult'] #理论线损ID self.LineLoss_ID = self.Data['LineLoss_ID'] #输电网计算结果查询xpath self.WholelossCalcResultQuery_Xpath = self.Data[ 'WholelossCalcResultQuery_Xpath'] #整点报表xpath self.HourCalcResult_Xpath = self.Data['HourCalcResult_Xpath'] #其他损耗表-整点xpath self.OtherLossResult_Xpath = self.Data['OtherLossResult_Xpath'] #报表iframe的ID self.OtherLossResultIframe_ID = self.Data['OtherLossResultIframe_ID'] #开始时间窗口xpath self.StartTimeWindow_xpath = self.Data['StartTimeWindow_xpath'] #开始时间日期xpath self.StartTimeDate_xpath = self.Data['StartTimeDate_xpath'] #开始时间确定按钮xpath self.StartTimeButton_xpath = self.Data['StartTimeButton_xpath'] self.StartTimeAdjust_ID = self.Data['StartTimeAdjust_ID'] #查询按钮ID self.Query_ID = self.Data['Query_ID'] #导出按钮ID self.Export_ID = self.Data['Export_ID']
def __init__(self, driver): #驱动 self.driver = driver #获取页面元素 self.ProjectFilePath = GetProjectFilePath() self.Page_object_file = open( self.ProjectFilePath + "\\Page_object\\Data\\NewtonMethodWholeLossAnalysisDayAcline.yaml") self.Page_Data = yaml.load(self.Page_object_file) self.Data = self.Page_Data['NewtonMethodWholeLossAnalysisDayAcline'] #线损分析ID self.LineLossAnalysis_ID = self.Data['LineLossAnalysis_ID'] #输电网结果分析ID self.WholeLossResultAnalysis_xpath = self.Data[ 'WholeLossResultAnalysis_xpath'] #日分析ID self.MonAnalysis_xpath = self.Data['MonAnalysis_xpath'] #输电网综合分析xpath self.WholeLossAnalysis_xpath = self.Data['WholeLossAnalysis_xpath'] #报表iframe的ID self.WholelossAnalysisIframe_ID = self.Data[ 'WholelossAnalysisIframe_ID'] #查询按钮ID self.Query_ID = self.Data['Query_ID'] #导线追溯链接 self.Acline_xpath = self.Data['Acline_xpath'] #Iframe_ID self.AclineIframe_ID = self.Data['AclineIframe_ID'] #导出按钮ID self.Export_ID = self.Data['Export_ID']
def __init__(self, driver): self.driver = driver #获取页面元素 self.ProjectFilePath = GetProjectFilePath() self.ProjectFilePath_file = open( self.ProjectFilePath + "\\Page_object\\Data\\WholelossNiuhourcalc.yaml") self.PageData = yaml.load(self.ProjectFilePath_file) self.ProjectFilePath_file.close() self.Data = self.PageData['WholelossNiuhourcal'] #理论线损id self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #理论线损手工计算Xpath self.TheoreticalLineLossManualcal_Xpath = self.Data[ 'TheoreticalLineLossManualcal_Xpath'] #手工计算frame self.WholelossNiuhourcal_Frame = self.Data['WholelossNiuhourcal_Frame'] #勾选计算范围id self.WholelossNiuhourcalCompany_Xpath = self.Data[ 'WholelossNiuhourcalCompany_Xpath'] #计算按钮id self.Calculate_ID = self.Data['Calculate_ID'] #计算完成弹出框信息ID self.AlertMsg_ID = self.Data['AlertMsg_ID'] #点击确定提示框 self.AlertConfirm_ID = self.Data['AlertConfirm_ID']
def __init__(self, driver): #驱动 self.driver = driver #获取页面元素 self.ProjectFilePath = GetProjectFilePath() self.Page_object_file = open( self.ProjectFilePath + "\\Page_object\\Data\\NewtonMethodAclineMonCalcResult.yaml") self.Page_Data = yaml.load(self.Page_object_file) self.Data = self.Page_Data['NewtonMethodAclineMonCalcResult'] #理论线损ID self.LineLoss_ID = self.Data['LineLoss_ID'] #输电网计算结果查询xpath self.WholelossCalcResultQuery_Xpath = self.Data[ 'WholelossCalcResultQuery_Xpath'] #月报表xpath self.MonCalcResult_Xpath = self.Data['MonCalcResult_Xpath'] #导线损耗表xpath self.AclineLossResult_Xpath = self.Data['AclineLossResult_Xpath'] #报表iframe的ID self.AclineLossResultIframe_ID = self.Data['AclineLossResultIframe_ID'] #查询按钮ID self.Query_ID = self.Data['Query_ID'] #导出按钮ID self.Export_ID = self.Data['Export_ID']
def __init__(self, driver): #self.driver = webdriver.Chrome() self.driver = driver self.datafile = GetProjectFilePath( ) + u"\Page_object\Data\DistributionlineVoluMonthCalcResult.yaml" with open(self.datafile) as datafile: self.data = yaml.load(datafile) self.datamsg = self.data['DistributionlineVoluMonthCalcResult'] # 树结构中理论线损的ID self.DistributionlineLossTree_id = self.datamsg[ "DistributionlineLossTree_id"] # 树结构中配电网计算结果查询的xpath self.TheoreticalLineLossCalResult_Xpath = self.datamsg[ "TheoreticalLineLossCalResult_Xpath"] # 树结构中月报表的xpath self.DistributionLineMonthlyReport_Xpath = self.datamsg[ "DistributionLineMonthlyReport_Xpath"] # 配电线路线损表 self.LinelossmeterDistributionline_Xpath = self.datamsg[ "LinelossmeterDistributionline_Xpath"] # 切换到frame self.DistributionLineCalcResult_frame = self.datamsg[ "DistributionLineCalcResult_frame"] # 导出按钮 self.Export_id = self.datamsg["Export_id"]
def __init__(self,driver): '''配电线路线损率分段单位追溯统计结果核对''' self.driver=driver self.ProjectFilePath=GetProjectFilePath() self.Page_object_data_file=open(self.ProjectFilePath+"\Page_object\Data\DistributionlinePieSComDay.yaml") self.Page_data=yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data=self.Page_data['DistributionlinePieSComDay'] #点击线损分析 self.LineLossAnalysis_ID=self.Data['LineLossAnalysis_ID'] #点击配电网计算结果分析 self.TheoreticalLineLosscalresultAnalysis_Xpath=self.Data['TheoreticalLineLosscalresultAnalysis_Xpath'] #点击日分析 self.DistributionLineDayAnalysis_Xpath=self.Data['DistributionLineDayAnalysis_Xpath'] #点击配电线路线损率分段统计 self.DistributionlineLossRateSegStatistics_Xpath=self.Data['DistributionlineLossRateSegStatistics_Xpath'] #切换到配电线路线损率分段统计的frame中 self.DistributionlineLossRateSegStatistics_frame=self.Data['DistributionlineLossRateSegStatistics_frame'] #切换到配电线路线损率分段统计查询结果的frame中 self.DistributionlineLossRateSegStatisticsResult_frame=self.Data['DistributionlineLossRateSegStatisticsResult_frame'] #点击单位追溯 self.CompanyRetrospect_css=self.Data['CompanyRetrospect_css'] #切换到配电网线损率分段统计追溯报表(分单位日)frame中 self.CompanyRetrospect_frame=self.Data['CompanyRetrospect_frame'] #点击导出 self.Export_ID=self.Data['Export_ID']
def __init__(self, driver): #驱动 self.driver = driver #获取页面元素 self.ProjectFilePath = GetProjectFilePath() self.Page_object_file = open( self.ProjectFilePath + "\\Page_object\\Data\\TranotherlossmonCalcResult.yaml") self.Page_Data = yaml.load(self.Page_object_file) self.Data = self.Page_Data['TranotherlossmonCalcResult'] #理论线损id self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #输电网计算结果查询 self.TranotherlossManualcal_Xpath = self.Data[ 'TranotherlossManualcal_Xpath'] #月报表 self.TranotherlossmonReport_Xpath = self.Data[ 'TranotherlossmonReport_Xpath'] #其它损耗表 self.TranotherlossmonCalcResult_Xpath = self.Data[ 'TranotherlossmonCalcResult_Xpath'] #查询报表frame self.TranotherlossmonCalcResult_frame = self.Data[ 'TranotherlossmonCalcResult_frame'] #点击导出 self.Daochu_id = self.Data['Daochu_id']
def __init__(self, driver): #self.driver=webdriver.Chrome() self.driver = driver self.ProjectFilePath = GetProjectFilePath() #获取页面元素 self.Page_object_data_file = open( self.ProjectFilePath + "\\Page_object\\Data\\DistributionlineMeasMonthEnter.yaml") self.Page_data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_data['DistributionlineMeasMonthEnter'] #数据中心id self.DataCenter_id = self.Data['DataCenter_id'] #运营数据管理路径 self.RunDataManage_Xpath = self.Data['RunDataManage_Xpath'] #配线线路运行数据录入 self.LineDataEntry_Xpath = self.Data['LineDataEntry_Xpath'] #配线理论线损运行数据录入 self.TheoreticalLineLoss_Xpath = self.Data['TheoreticalLineLoss_Xpath'] #理论线损运行数据录入页面frame self.TheoreticalLineLoss_Frame = self.Data['TheoreticalLineLoss_Frame'] #查询条件之量测分组选择,先点击下拉框,再选择对应的数据 self.MeasurementPacketDropdownbox_ID = self.Data[ 'MeasurementPacketDropdownbox_ID'] self.TheoreticalMounthChoose_Xpath = self.Data[ 'TheoreticalMounthChoose_Xpath'] #输入配线参数,包含正向有功电量、功率因数、负荷形状系数 #正向有功电量 self.ActivePowerActivation_Xpath = self.Data[ 'ActivePowerActivation_Xpath'] #激活输入框 self.ActivePower_name = self.Data['ActivePower_name'] #功率因数 self.PowerFactorActivation_Xpath = self.Data[ 'PowerFactorActivation_Xpath'] self.PowerFactor_name = self.Data['PowerFactor_name'] #负荷形状系数 self.LoadShapeFactorActivation_Xpath = self.Data[ 'LoadShapeFactorActivation_Xpath'] #激活输入框 self.LoadShapeFactor_name = self.Data['LoadShapeFactor_name'] #输入配变数据 self.DistributionTransform_ID = self.Data[ 'DistributionTransform_ID'] #切换到配变tab页面 self.DistributionTransformActivationBefor = self.Data[ 'DistributionTransformActivationBefor'] self.DistributionTransformActivationAfter = self.Data[ 'DistributionTransformActivationAfter'] self.DistributionTransformData_name = self.Data[ 'DistributionTransformData_name'] #数据输入后保存,以及弹出框内容校验 self.SaveButton_ID = self.Data['SaveButton_ID'] self.AlertMsg_ID = self.Data['AlertMsg_ID'] self.AlertButton_ID = self.Data['AlertButton_ID']
def __init__(self, driver): '''配电线路综合分析-经济变追溯结果核对''' self.driver = driver self.ProjectPathFile = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectPathFile + "\Page_object\Data\DistributionlineEconomicTranDay.yaml") self.Page_data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_data['DistributionlineEconomicTranDay'] #点击线损分析 self.LineLossAnalysis_ID = self.Data['LineLossAnalysis_ID'] #点击配电网计算结果分析 self.TheoreticalLineLosscalresultAnalysis_Xpath = self.Data[ 'TheoreticalLineLosscalresultAnalysis_Xpath'] #点击日分析 self.DistributionLineDayAnalysis_Xpath = self.Data[ 'DistributionLineDayAnalysis_Xpath'] #点击配电线路综合分析 self.DistributionlinedaycalcAnalysis_Xpath = self.Data[ 'DistributionlinedaycalcAnalysis_Xpath'] #切换到配电线路综合分析的frame中 self.DistributionlinedaycalcAnalysis_frame = self.Data[ 'DistributionlinedaycalcAnalysis_frame'] #点击查询条件中日期的下拉框 self.DateDropBox_CSS = self.Data['DateDropBox_CSS'] self.DateDropBox_CSS1 = self.Data['DateDropBox_CSS1'] #切换到日期选择框中的frame self.Date_frame = self.Data['Date_frame'] #点击日期下拉框年的下拉框 self.DateYearDropBox_ID = self.Data['DateYearDropBox_ID'] #选择日期下拉框年中的2015 self.YearSelect2015_Xpath = self.Data['YearSelect2015_Xpath'] #点击日期下拉框代表日的下拉框 self.DateRepresentativeDay_ID = self.Data['DateRepresentativeDay_ID'] #选择日期下拉框代表日中的2015-08-01 self.DateRepresentativeDay20150801_Xpath = self.Data[ 'DateRepresentativeDay20150801_Xpath'] #点击日期下拉框中的确定按钮 self.DateDropBoxSure_ID = self.Data['DateDropBoxSure_ID'] #点击页面中的查询按钮 self.Query_Class = self.Data['Query_Class'] #点击变压器台数追溯 self.DisttransformerNum_Xpath = self.Data['DisttransformerNum_Xpath'] #切换到配变运行综合分析(日)frame中 self.DisttransformerNum_frame = self.Data['DisttransformerNum_frame'] #点击经济变台数 self.EcnomicTranNum_Xpath = self.Data['EcnomicTranNum_Xpath'] #切换到配变损耗组成分析-经济变frame中 self.EcnomicTranNum_frame = self.Data['EcnomicTranNum_frame'] #点击左下角的导出按钮 self.Export_ID = self.Data['Export_ID']
def __init__(self,driver): '''配线日均方根电流法计算''' #self.driver=webdriver.Chrome() self.driver=driver self.ProjectFilePath=GetProjectFilePath() self.Page_object_data_file=open(self.ProjectFilePath+"\Page_object\Data\DistributionlineSquDaycalc.yaml") self.Page_Data=yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data=self.Page_Data['DistributionlineSquDaycalc'] #点击理论线损 self.TheoreticalLineLoss_Xpath = self.Data['TheoreticalLineLoss_Xpath'] #点击计算任务设置 self.CalTaskSet_Xpath=self.Data['CalTaskSet_Xpath'] #点击任务执行情况查询 self.TaskExecutionQuery_Xpath=self.Data['TaskExecutionQuery_Xpath'] ##切换到任务设置frame self.TaskExecutionQuery_Frame=self.Data['TaskExecutionQuery_Frame'] #点击所有任务前面的加号 self.TaskAction_Xpath=self.Data['TaskAction_Xpath'] #选中配线日均方根电流法任务 self.DistributionlineRtMeQuaCutMethodTask_Xpath=self.Data['DistributionlineRtMeQuaCutMethodTask_Xpath'] #点击明细数据 self.DetailDate_ID=self.Data['DetailDate_ID'] #切换到日均方根电流法任务执行情况明细frame self.DistributionlineRtMeQuaCutMethodTaskDetail_Frame=self.Data['DistributionlineRtMeQuaCutMethodTaskDetail_Frame'] #点击日期输入框,输入2014-02-01 self.Datatimeinput_id = self.Data['Datatimeinput_id'] # #点击日期选择框 # self.DataSelectBox_Xpath=self.Data['DataSelectBox_Xpath'] # #选择2014-8-1日 # #点击日期选择框 # self.DataSelect_ID=self.Data['DataSelect_ID'] # #选择2014年 # self.YearSelect_Xpath=self.Data['YearSelect_Xpath'] # #选择8月 # self.MonthSelect_Xpath=self.Data['MonthSelect_Xpath'] # #点击确定 # self.Determine_ID=self.Data['Determine_ID'] # #选择1号 # self.NumberOne_Xpath=self.Data['NumberOne_Xpath'] #点击查询 self.Query_ID=self.Data['Query_ID'] #选择任务 self.TaskSelect_Xpath=self.Data['TaskSelect_Xpath'] #点击补算 self.Supplement_ID=self.Data['Supplement_ID'] #切换到补算窗口frame #切换弹出框中补算 self.SupplementButton_ID = self.Data['SupplementButton_ID'] #计算完成之后验证 self.AlertConfirm_ID=self.Data['AlertConfirm_ID']
def __init__(self, driver): '''配线追溯页面结果验证''' self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectFilePath + "\Page_object\Data\DistributionlineComAAOLLCDay.yaml") self.Page_data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_data['DistributionlineComAAOLLCDay'] #点击线损分析 self.LineLossAnalysis_ID = self.Data['LineLossAnalysis_ID'] #点击配电网计算结果分析 self.TheoreticalLineLosscalresultAnalysis_Xpath = self.Data[ 'TheoreticalLineLosscalresultAnalysis_Xpath'] #点击日分析 self.DistributionLineDayAnalysis_Xpath = self.Data[ 'DistributionLineDayAnalysis_Xpath'] #点击配电线路综合分析 self.DistributionlinedaycalcAnalysis_Xpath = self.Data[ 'DistributionlinedaycalcAnalysis_Xpath'] #切换到配电线路综合分析的frame中 self.DistributionlinedaycalcAnalysis_frame = self.Data[ 'DistributionlinedaycalcAnalysis_frame'] #点击查询条件中日期的下拉框 self.DateDropBox_CSS = self.Data['DateDropBox_CSS'] self.DateDropBox_CSS1 = self.Data['DateDropBox_CSS1'] #切换到日期选择框中的frame self.Date_frame = self.Data['Date_frame'] #点击日期下拉框年的下拉框 self.DateYearDropBox_ID = self.Data['DateYearDropBox_ID'] #选择日期下拉框年中的2015 self.YearSelect2015_Xpath = self.Data['YearSelect2015_Xpath'] #点击日期下拉框代表日的下拉框 self.DateRepresentativeDay_ID = self.Data['DateRepresentativeDay_ID'] #选择日期下拉框代表日中的2015-08-01 self.DateRepresentativeDay20150801_Xpath = self.Data[ 'DateRepresentativeDay20150801_Xpath'] #点击日期下拉框中的确定按钮 self.DateDropBoxSure_ID = self.Data['DateDropBoxSure_ID'] #点击页面中的查询按钮 self.Query_Class = self.Data['Query_Class'] #点击配电线路追溯 self.Distributioin_Xpath = self.Data['Distributioin_Xpath'] #切换到配电线路线损组成分析(日)frame中 self.DistributioinRetrospect_frame = self.Data[ 'DistributioinRetrospect_frame'] #点击配线追溯页面的导出 self.Export_Class = self.Data['Export_Class']
def __init__(self, title): self.ProjectFilePath = GetProjectFilePath() self.day = time.strftime("%Y%m%d", time.localtime()) self.logger = logging.getLogger(title) self.logger.setLevel(logging.INFO) if not self.logger.handlers: self.formatter = logging.Formatter( '%(asctime)s %(levelname)-8s: %(message)s') self.file_handler = logging.FileHandler( self.ProjectFilePath + '\EagleProjecttest\Log\%s.log' % self.day) self.file_handler.setFormatter(self.formatter) self.control = logging.StreamHandler() self.control.setFormatter(self.formatter) self.logger.addHandler(self.file_handler) self.logger.addHandler(self.control)
def __init__(self, driver): '''配线月电量法计算''' # self.driver=webdriver.Chrome() self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectFilePath + "\Page_object\Data\DistrictCapacitymoncalc.yaml") self.Page_Data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_Data['DistrictCapacitymoncalc'] # 理论线损计算id self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] # 理论线损手工计算 self.TheoreticalLineLossManualcal_Xpath = self.Data[ 'TheoreticalLineLossManualcal_Xpath'] # 切换到配电网400V理论线损所在frame并点击 self.TheoreticalLineloss400V_Frame = self.Data[ 'TheoreticalLineloss400V_Frame'] self.TheoreticalLineloss400V_ID = self.Data[ 'TheoreticalLineloss400V_ID'] # 直接选择计算的台区 # 勾选wm县电量法配线月结果验证,总共四层,单位、变电站、配电线路、台区 # 单位xpath self.PowerlawCalculationResultsCom_Xpath = self.Data[ 'PowerlawCalculationResultsCom_Xpath'] # 变电站 self.PowerlawCalculationResultsSub_Xpath = self.Data[ 'PowerlawCalculationResultsSub_Xpath'] # 配电线路 self.PowerlawCalculationResultsWiring_Xpath = self.Data[ 'PowerlawCalculationResultsWiring_Xpath'] # 台区 self.PowerlawCalculationResultsDistrict_Xpath = self.Data[ 'PowerlawCalculationResultsDistrict_Xpath'] #选择计算方法 self.CapacityCalaMethod_id = self.Data['CapacityCalaMethod_id'] # 选择月计算 self.Districtmoncalc_ID = self.Data['Districtmoncalc_ID'] # 点击计算按钮 self.Calculate_ID = self.Data['Calculate_ID'] # 计算成功后弹出框信息ID以及确定按钮ID self.AlertMsg_ID = self.Data['AlertMsg_ID'] self.AlertConfirm_ID = self.Data['AlertConfirm_ID']
def __init__(self, driver): #驱动 self.driver = driver #获取页面元素 self.ProjectFilePath = GetProjectFilePath() self.Page_object_file = open( self.ProjectFilePath + "\\Page_object\\Data\\NewtonMethodWholelossDayCalcResult.yaml") self.Page_Data = yaml.load(self.Page_object_file) self.Data = self.Page_Data['NewtonMethodWholelossDayCalcResult'] #理论线损ID self.LineLoss_ID = self.Data['LineLoss_ID'] #输电网计算结果查询xpath self.WholelossCalcResultQuery_Xpath = self.Data[ 'WholelossCalcResultQuery_Xpath'] #日报表xpath self.DayCalcResult_Xpath = self.Data['DayCalcResult_Xpath'] #输电网线损表xpath self.WholelossCalcResult_Xpath = self.Data['WholelossCalcResult_Xpath'] #报表iframe的ID self.WholelossCalcResultIframe_ID = self.Data[ 'WholelossCalcResultIframe_ID'] #屏蔽一下代码原因:日期选择框的Iframe的ID和name都是随机的,无法进行定位,使用代表日进行查询和导出 # #激活开始时间窗口 # self.StartTimeWindow = self.Data['StartTimeWindow'] # #开始时间窗口xpath # self.StartTimeWindow_ID = self.Data['StartTimeWindow_ID'] # #开始时间日期xpath # self.StartTimeDate_xpath = self.Data['StartTimeDate_xpath'] # #开始时间确定按钮xpath # self.StartTimeButton_xpath = self.Data['StartTimeButton_xpath'] # # #结束时间窗口xpath # self.EndTimeWindow_xpath = self.Data['EndTimeWindow_xpath'] # #结束时间日期xpath # self.EndTimeDate_xpath = self.Data['EndTimeDate_xpath'] # #结束时间确定按钮xpath # self.EndTimeButton_xpath = self.Data['EndTimeButton_xpath'] #查询按钮ID self.Query_ID = self.Data['Query_ID'] #导出按钮ID self.Export_ID = self.Data['Export_ID']
def __init__(self, driver): #驱动 self.driver = driver #获取页面元素 self.ProjectFilePath = GetProjectFilePath() self.Page_object_file = open( self.ProjectFilePath + "\\Page_object\\Data\\NewtonMethodWholeLossAnalysisMonTrans.yaml") self.Page_Data = yaml.load(self.Page_object_file) self.Data = self.Page_Data['NewtonMethodWholeLossAnalysisMonTrans'] #线损分析ID self.LineLossAnalysis_ID = self.Data['LineLossAnalysis_ID'] #输电网结果分析ID self.WholeLossResultAnalysis_xpath = self.Data[ 'WholeLossResultAnalysis_xpath'] #月分析ID self.MonAnalysis_xpath = self.Data['MonAnalysis_xpath'] #输电网综合分析xpath self.WholeLossAnalysis_xpath = self.Data['WholeLossAnalysis_xpath'] #报表iframe的ID self.WholelossAnalysisIframe_ID = self.Data[ 'WholelossAnalysisIframe_ID'] #激活月份选择框 self.Month_ID = self.Data['Month_ID'] #选择2015 self.Year_xpath = self.Data['Year_xpath'] #选择八月 self.Month_xpath = self.Data['Month_xpath'] #确定按钮 self.ConfirmButton_ID = self.Data['ConfirmButton_ID'] #查询按钮ID self.Query_ID = self.Data['Query_ID'] #点击导线追溯链接 self.Trans_xpath = self.Data['Trans_xpath'] #报表iframe的ID self.TransIframe_ID = self.Data['TransIframe_ID'] #导出按钮ID self.Export_ID = self.Data['Export_ID']
def __init__(self, driver): '''配线日电量法计算''' #self.driver=webdriver.Chrome() self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectFilePath + "\Page_object\Data\DistributionlineEleQuadaycalc.yaml") self.Page_Data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_Data['DistributionlineEleQuadaycalc'] #理论线损计算id self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #理论线损手工计算Xpat self.TheoreticalLineLossManualcal_Xpath = self.Data[ 'TheoreticalLineLossManualcal_Xpath'] #切换到配电网6-20kv理论线损所在frame并点击 self.TheoreticalLineloss620kV_Frame = self.Data[ 'TheoreticalLineloss620kV_Frame'] self.TheoreticalLineloss620kV_ID = self.Data[ 'TheoreticalLineloss620kV_ID'] #直接选择计算的配线 #勾选0704电量法配线月结果验证,总共有三层,单位、变电站、配电线路 #单位xpath self.PowerlawCalculationResultsCom_Xpath = self.Data[ 'PowerlawCalculationResultsCom_Xpath'] #变电站 self.PowerlawCalculationResultsSub_Xpath = self.Data[ 'PowerlawCalculationResultsSub_Xpath'] #配电线路 self.PowerlawCalculationResultsWiring_Xpath = self.Data[ 'PowerlawCalculationResultsWiring_Xpath'] #切换到日 self.DiurnalData_ID = self.Data['DiurnalData_ID'] #点击计算按钮 self.Calculate_ID = self.Data['Calculate_ID'] #计算成功后弹出框信息ID以及取消按钮ID self.AlertMsg_ID = self.Data['AlertMsg_ID'] self.AlertConfirm_ID = self.Data['AlertConfirm_ID']
def __init__(self, driver): self.driver = driver self.ProjectFilePath = GetProjectFilePath() #获取页面元素 self.Page_object_data_file = open( self.ProjectFilePath + "\\Page_object\\Data\\NewtonMethodCalc.yaml") self.PageData = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.PageData['NewtonMethodCalc'] #理论线损ID self.LineLoss_ID = self.Data['LineLoss_ID'] #理论线损手工计算绝对路径 self.LineLossManualCalc = self.Data['LineLossManualCalc'] #计算窗口iframe的ID self.CalcWindowIframe_ID = self.Data['CalcWindowIframe_ID'] #选择单位绝对路径 self.Company_Xpath = self.Data['Company_Xpath'] #计算按钮CSS路径 self.CalcButton_CSS = self.Data['CalcButton_CSS'] #计算完成提示信息ID self.CalcCompletion_ID = self.Data['CalcCompletion_ID']
def __init__(self, driver): '''配电线路潮流精确算法计算''' self.driver = driver self.ProjectFilePath = GetProjectFilePath() self.Page_object_data_file = open( self.ProjectFilePath + "\Page_object\Data\DistributionlineFlowDayCalc.yaml") self.Page_Data = yaml.load(self.Page_object_data_file) self.Page_object_data_file.close() self.Data = self.Page_Data['DistributionlineFlowDayCalc'] #理论线损id self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #理论线损手工计算xpath self.TheoreticalLineLossManualcal_Xpath = self.Data[ 'TheoreticalLineLossManualcal_Xpath'] #切换到配电网6-20kV理论线损计算所在的frame并点击 self.DistributionlineFlowDayCalc_Frame = self.Data[ 'DistributionlineFlowDayCalc_Frame'] self.DistributionlineFlowDayCalc_id = self.Data[ 'DistributionlineFlowDayCalc_id'] #选择单位 self.DistributionlineFlowDayCalcCompany_Xpath = self.Data[ 'DistributionlineFlowDayCalcCompany_Xpath'] #选择变电站 self.DistributionlineFlowDayCalcSubstation_Xpath = self.Data[ 'DistributionlineFlowDayCalcSubstation_Xpath'] #选择配电线路 self.DistributionlineFlowDayCalcDistributionline_Xpath = self.Data[ 'DistributionlineFlowDayCalcDistributionline_Xpath'] #点击潮流精确算法 self.Algorithm_ID = self.Data['Algorithm_ID'] #点击计算按钮 self.Calculate_ID = self.Data['Calculate_ID'] #计算成功后弹出框及点击确定按钮 self.AlertMsg_ID = self.Data['AlertMsg_ID'] self.AlertConfirm_ID = self.Data['AlertConfirm_ID']
def __init__(self, driver): #驱动 self.driver = driver #获取页面元素 self.ProjectFilePath = GetProjectFilePath() self.Page_object_file = open( self.ProjectFilePath + "\\Page_object\\Data\\TranotherlosshourCalcResult.yaml") self.Page_Data = yaml.load(self.Page_object_file) self.Data = self.Page_Data['TranotherlosshourCalcResult'] #理论线损id self.TheoreticalLineLoss_ID = self.Data['TheoreticalLineLoss_ID'] #输电网计算结果查询 self.TranotherlossManualcal_Xpath = self.Data[ 'TranotherlossManualcal_Xpath'] #整点报表 self.TranotherlosshourReport_Xpath = self.Data[ 'TranotherlosshourReport_Xpath'] #其它损耗表 self.TranotherlosshourCalcResult_Xpath = self.Data[ 'TranotherlosshourCalcResult_Xpath'] #查询报表frame self.TranotherlosshourCalcResult_frame = self.Data[ 'TranotherlosshourCalcResult_frame'] #打开日期控件 self.Day_box_xpath = self.Data['Day_box_xpath'] #选择20140801_xpath self.DayResult_xpath = self.Data['DayResult_xpath'] #输入零点 self.ZeroHour_ID = self.Data['ZeroHour_ID'] #点击日期控件中确定 self.DayQueding_id = self.Data['DayQueding_id'] #点击查询 self.Chaxun_id = self.Data['Chaxun_id'] #点击导出 self.Daochu_id = self.Data['Daochu_id']