Forum Discussion
Hi Kahle,
I recommend that you send a crash report along with the description of the issue to our Support Team. They will analyze the report and come back to you with the solution.
You can contact them here:
headerDeviceName can only contain "SR-506-0801" OR "SR506-0701" text, is that correct?
Since you are calling check property for both text, on lines 1 and 2. If the verification succeeds, the method posts a success message to the test log; otherwise it posts a failure message. Hence, check property is failing on "SR506-0701", line 28.
rraghvaniI rewrote the routine based on your suggestions and it's now working as expected.
def checkSRName_WritePW(): # Check attached device name to write the correct factory default password. if checkPoint_deviceName("SR-506-0801", factPass1") == True: Log.Message("Password write successful") elif checkPoint_deviceName("SR506-0701", "factPass2") == True: # Write factory default password. Log.Message("Device name found") else: # Log a message on failure. Log.Message("Device name not found") def checkPoint_deviceName(device_name, password): # Checks whether the 'Text' property in the object contains the controller name. check_device_string = aqObject.CheckProperty(Aliases.Device.processTacocomfortControl.connectedControllerGroupView.headerDeviceName, "Text", cmpContains, device_name) if check_device_string: # Write factory default password. Aliases.Device.processTacocomfortControl.connectedControllerGroupView.deviceSettingsHeadingGroup.passwordRequiredDialogPasswordField.Touch() Aliases.Device.processTacocomfortControl.connectedControllerGroupView.deviceSettingsHeadingGroup.passwordRequiredDialogPasswordField.Keys(password) Log.Message("Password write successful") return True else: Log.Message("Password write unsuccessful") return False
Note, if line 3 is not true, then line 15 aqObject.CheckProperty will log a failure and will stop your automation - depending on your project configurations.
Try using aqObject.CompareProperty method instead, as this will return either true or false and not stop the automation - providing you don't use lmError
I'm guessing it's relating to RefreshMappingInfo method, as this clears the cached object reference list. The new list is probably being generated, but the second statement is called and the object has not appeared in the list yet. Either remove the method or add a delay.
You also have two functions doing the same thing. Why not have just the one function and pass in the parameter string, to perform check property?
Related Content
Recent Discussions
- 9 hours ago
- 2 days ago