Problems with the EXISTS method in TestComplete V9
I had some issues with the EXISTS method in terms of dealing with modal lists of an application (test object). Somehow the EXISTS method may not deliver the correct information, whether the object is available or not. In terms of misleading information the test process may run into an error. I found a solution based on AliasObjects and direct accessing of the list. --------------------------------------------------------------------------------------------------------------------------- Sub selectList (Caption, Action) Dim Selection ' Define object ' If it is available, Selection contains the object otherwise an empty object ' WNCode is just a variable to cover several versions of the test object without ' the need of code adaptation Set Selection = Sys.Process("za").WaitWindow("FNWNS"+WNCode,Caption,-1,1000) ' a mixture of AliasObjects |-> Aliases.za.wndSelect...| and ' direct coding |-> Sys.Process("za").WaitWindow("FNWNS"+WNCode...| ' of the GUI objects avoids / bypasses ' the weakness of the EXISTS method in the TestComplete V9 ' the following lines work: it deals with no, one or multiple list(s), which ' may occur whilst user interaction While (Aliases.za.wndSelect.Exists) ' Exists works solely fine with the AliasObjects! Aliases.za.wndSelect.SetFocus Aliases.za.wndSelect.Keys(Action) Set selection = Sys.Process("za").WaitWindow("FNWNS"+WNCode,Caption,-1,1000) Wend End Sub --------------------------------------------------------------------------------------------------------------------Solved3KViews0likes4CommentsaqFile* Exists not find application-created folder
My application creates a folder during execution, but TestComplete's aqFile* methods don't find it during the test. Not aqFile.Exists, not aqFileSystem.Exists, not aqFileSystem.FindFolders. (But they do find the already-existing parent) If I leave the folder in place and run a second test, it finds the folder. If I call CreateFolder() during the test, FindFolders() finds only that folder, not the one my app created. I'm running on a Windows 10 VM on Windows 10. The folder is on the host, shared with the VM. The test is written in Python. How can I get TestComplete to find the folder that my application creates during the test? Correction: The folder is on the VM, not shared from the hostSolved1.5KViews0likes5CommentsaqFile.Exists(filePath) is returning true, but aqFile.GetSize(filePath) returns an error
I have some code that first checks if the file exists, and then does some other stuff, including getting the file size. If aqFile.Exists(filePath) Then fileSize = aqFile.GetSize(filePath) ' Do some other stuff End If This works consistentlyon my Windows 10 tests, but fails every timeon the second line on Windows 7 with this error message: "Unable to open the file." I'm not sure what to do here, I thought the whole point of doing the If Then statement with aqFile.Exists was to avoid this kind of error? Can anyone help me out?1KViews0likes2Comments