def HeNS_Request_Message(self, boolean, heMS_SetParameterValues): # try: pyautogui.click(1000, 30) self.System_Operation_Data() self.Click_Serial_Number() # Click the Message Log # selenium.click( "link="+config_element.get("system", "system_message_log")) # Refresh the list content for refresh in range(2): selenium.click( "xpath="+config_element.get("system", "system_refresh_button")) # Select the HeMS detail message print 'Type the serial number.' self.Click_CheckBox() selenium.type("id="+config_element.get("detail_message", "search_askey_root"), config_element.get("detail_message", "input_askey_root")) time.sleep(3) selenium.click( "xpath="+config_element.get("detail_message", "search_button")) print "Select the key code" # Verify the SetParameterValues text can be get setParameterValues = selenium.get_text( "xpath="+config_element.get("detail_message", "parametervalues_text")) if setParameterValues == 'SetParameterValues': print 'Get the SetParameterValues text!!' else: print "Do not Get the SetParameterValues text!!" android = Android() android.Copy_Trace_Folder() raise Exception("Do not Get the SetParameterValues text!!") self.Autoit_Detail_Message(40) # Get the message from Get_clipboard message_log_detail_dialog = self.Get_Clipboard() # Verify the boolean value if '<Value xsi:type="boolean">' + boolean + '</Value>' in message_log_detail_dialog: print 'The boolean was matched - SUCCESS' elif '<Value xsi:type="boolean">' + 'true' + '</Value>' in message_log_detail_dialog: print 'The boolean was matched - SUCCESS' elif '<Value xsi:type="boolean">' + 'false' + '</Value>' in message_log_detail_dialog: print 'The boolean was matched - SUCCESS' else: print "The boolean was not matched - FAIL" android = Android() android.Copy_Trace_Folder() raise Exception("The boolean was not matched - FAIL") time.sleep(1) now = time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time())) heMS_SetParameterValues = heMS_SetParameterValues + '_' + now + '.txt' fp = open(heMS_SetParameterValues, "w") fp.write(message_log_detail_dialog) autoit.Sleep(1000) autoit.Send("!{F4}") print "Close the Detail page"
def HeNB_Response_Message(self, status, heNB_SetParameterValuesResponse): try: pyautogui.click(1000, 30) self.System_Operation_Data() self.Click_Serial_Number() # Click the Message Log # selenium.click( "link="+config_element.get("system", "system_message_log")) # Select the HeNB detail message print 'Type the serial number.' self.Click_CheckBox() time.sleep(3) selenium.click( "xpath="+config_element.get("detail_message", "search_button")) print "Select the key code" # Verify the SetParameterValuesResponse text can be get setParameterValuesResponse = selenium.get_text( "xpath="+config_element.get("detail_message", "parametervalues_text")) if setParameterValuesResponse == 'SetParameterValuesResponse': print 'Get the SetParameterValuesResponse text!!' else: print "Do not Get the SetParameterValues text!!" android = Android() android.Copy_Trace_Folder() raise Exception("Do not Get the SetParameterValues text!!") self.Autoit_Detail_Message(40) # Get the message from Get_clipboard message_log_detail_dialog = self.Get_Clipboard() # Verify the status value if '<Status>' + status + '</Status>' in message_log_detail_dialog: print 'The status was matched - SUCCESS' else: print "The status was not matched - FAIL" android = Android() android.Copy_Trace_Folder() raise Exception("The status was not matched - FAIL") time.sleep(1) now = time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time())) heNB_SetParameterValuesResponse = heNB_SetParameterValuesResponse + '_' + now + '.txt' fp = open(heNB_SetParameterValuesResponse, "w") fp.write(message_log_detail_dialog) autoit.Sleep(1000) autoit.Send("!{F4}") print "Close the Detail page" except: raise Exception("The HeNB_Response_Message was not success - FAIL")
def Click_Device_Value0(self): time.sleep(80) if d(text=config_setting.get("setting", "PLMN")).exists: d(text=config_setting.get("setting", "PLMN")).click() android = Android() android.Copy_Trace_Folder() raise Exception("The device is clicked. - FAIL") else: print "The device is not clicked. - PASS"
def ACS_Initiate_Connection(self): try: self.System_Operation_Data() self.Click_Serial_Number() time.sleep(2) selenium.click( "link="+config_element.get("system", "system_message_queue")) print "Click the message queue" for i in range(2): selenium.click( "xpath="+config_element.get("system", "system_refresh_button")) print "Click the refresh " + str(i+1) + " times" # Verify the SetParameterValues text can be get # time.sleep(1) # Wait the 1 sec for get the acs parametervalues text on 106/06/11 setParameterValues = selenium.get_text( "xpath="+config_element.get("detail_message", "acs_parametervalues_text")) if setParameterValues == 'SetParameterValues': print 'Get the SetParameterValues text!!' else: print "Do not Get the SetParameterValues text!!" android = Android() android.Copy_Trace_Folder() raise Exception("Do not Get the SetParameterValues text!!") self.Autoit_Tab_button(38, 200) autoit.Sleep(2000) autoit.Send("{ENTER}") print 'Click the ACS TCP Initiate Connection was finished' autoit.Sleep(2000) # IE 9 autoit.WinWaitActive( "[title:ACS Notify Page - Windows Internet Explorer]", "") autoit.ControlClick( "ACS Notify Page - Windows Internet Explorer", "", "ToolbarWindow321") self.Autoit_Tab_button(4, 100) autoit.Sleep(2000) autoit.Send("{ENTER}") autoit.Sleep(2000) delete_subfolder = Delete_Subfolder() delete_subfolder.Delete_Path_Subfolder("..\\..\\Result\\femtolog") adbClient = AdbClient() time.sleep(2) adbClient.Swiandroidh_ACS() autoit.WinClose("[class:IEFrame]") # Click the refresh button for i in range(1): selenium.click( "xpath="+config_element.get("system", "system_refresh_button")) print "Click the refresh " + str(i+1) + " times" autoit.Sleep(2000) print "Click the acs initiate connectin button" except: raise Exception("The ace initiate button was not click - FAIL")
def Click_Device_Value1(self, device): for search_times in range( int(config_setting.get("search_times", "times"))): time.sleep(1) self.Switch_Back() time.sleep(1) print 'The Research times : ' + str(search_times + 1) self.Switch_Network_Operators() # Judgment the PLMN number by nexus or note4 plmn = config_setting.get("setting", "PLMN") merge_plmn = plmn.split(" ")[0] + plmn.split(" ")[1] if device == 'nexus': print 'The device is nexus.' time.sleep(180) if d(text=plmn).exists: print 'nexus' d(text=plmn).click() break if device == 'note4': print 'The device is note4.' self.Information_Alert() # time.sleep(95) time.sleep(180) if d(text=merge_plmn).exists: print 'note4' d(text=merge_plmn).click() break if search_times + 1 == int( config_setting.get("search_times", "times")): android = Android() android.Copy_Trace_Folder() raise Exception("The device is not clicked. - FAIL") print "The device is clicked. - PASS"