ContributionsMost RecentMost LikesSolutionsRe: Unexpected behavior executing if, elif, else statement in Python Thanks, I have switched over to using aqObject.CompareProperty method in if statements. Re: Unexpected behavior executing if, elif, else statement in Python 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 Re: Unexpected behavior executing if, elif, else statement in Python rraghvaniunfortunately even with the RefreshMappingInfo commented out I get the exact same reults. Re: Unexpected behavior executing if, elif, else statement in Python Good points. I'll remove the RefreshMappingInfo for now and try it again. As the function it was initially for clarity but once I get this working I can update it to use a single function and pass in the appropriate parameter string. Thanks Unexpected behavior executing if, elif, else statement in Python I wrote an if, elif, and else routine to checkpoint a header name and write the appropriate password into a required password field. When I ran the script routine it resulted in unexpected behavior. The first expression (checkpoint function) resulted in true but instead of executing the associated code block (touch & keys) and dropping out it ran the next elif, which as expected failed and then it ran the statements from the previous if statement. It completed the task but ultimately failed the test. I’ve run similar if statements before without issue. Please see attached code snippet and log. Any thoughts as to why this would be happening would be appreciated. SolvedNameMapping: Add "AND" clause to xpaths for element identification NameMapping: Add "AND" clause which would require two or more unique xpaths to be true for the element to be identified. We would like the ability to use an "AND" clause which would require two or more unique xpaths to be true for the element to be identified. The reasons for this area as follows: We have had limited success using the “AND” condition within an xpath statement. We have had numerous cases where the expression is syntactically correct and confirmed by TestComplete in the NameMapping Annotation but it fails to find the specified text within the node/object. In other cases, it finds the desired object (viewGroup w/ text) but fails a property checkpoint using a cmpContains (text), returning a null string even thought the NamedMapping found the object based on that defined text. Example: xpath: //*[@className='android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup' and @text="SR Zone Controller"] xpath: //*[@className='android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup' and contains(@text,'SR Zone Controller')] The second and more concerning issue is the case where an object is discovered using a combined expression as shown below that correctly locates the object viewGroup which contains some specific text but fails a checkPoint operation. Example: xpath: //android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup[*[@text="SR Zone Controller"]] We have had some success finding element using "FindElementByXPath, but this method is much more involved and difficult to implement. It would be so much easier for the user if an “AND” clause was added to the NameMapping XPATH statement as an enhancement to the “OR” clause. Note: We are working with a Mobile App and don't have the luxury of ObjectIDs or CSS for object identification. Re: Using FindChildByXPath method on mobile application Thanks rraghvani, it appears that my suspicion was correct. Using FindChildByXPath method on mobile application I am attempting to use TestComplete to test a local Appium connected Android device but it appears that many of the methods used for finding web objects are not supported in mobile. The following is a snippet of code to iterate through list of possible button text labels. def navigateSecondary(possible_labels): # Iterate over the list of possible text labels for label in possible_labels: # Find the button element by its text label button = Mobile.FindChildByXPath("//button[@text='%s']" % label) if button.Exists: # Touch the button button.Touch() But when I run the routine that calls this method I get the following Python runtime error, which points to the line that contains the Mobile.FindChildByXPath method. AttributeError: The object does not support this property or method. Has anyone had any luck using the FindChildByXPath method on a mobile application? SolvedNamed "Tested Application" can be used as a variable Issue: Application parameters, version and paths change. i.e. the Application Path and version change when a new version of the tested application is released for testing. The Smartbear documentation states that the list of tested applications will appear under the drop-down in the Application path field. However, this list appears to be a list of cached strings that were previously entered by the user. We call "Run Remote Device" in every test, we were hoping to use a named Tested Application as a variable so we can change the application path using the tested application list, so we don't have to manually update every test when the application version changes. We were under the impression that we could create a named "Tested Application" and the Keyword Tests would point to that named Tested Application, So when we need to test a new version of the application all we had to do was update the Application Path in the named "Tested Application" and all tests pointed to that named "Tested Application" would point to the new path. Using the named "Tested Application" as a variable of sorts. The last thing we want to do is manually update several hundred test cases every time we need to test a new version of our application. How to remove a project suite from the Start Page Recent Project list? I've closed the project suite in TestComplete (File > Close) and delete the project suite folder from my hard disk; but the project suite remains in the recent project list with a date of n/a. Solved