Contributions
Help with Paths to Binaries please(!)
Hi, I have run into a problem.... here goes my attempt to explain: On my development machine, our source code tree lives in f:\devel\<stuff>\source\tests\test complete tests\<my TC projects> The binaries for our project get dumped in f:\devel\<stuff>\binaries. I have a mapped drive (Z:) pointing at the <stuff> folder. In my TestComplete tests I have the following in my "Globals" script: var LocalStoragePath = "Z:\\Binaries\\"; Then I do: MyApp["Path"] = Globals["LocalStoragePath"]; This works great. We also have a build server that used to run the TestComplete tests automatically after each successful build of the software, which happened when anybody checked in their code. To enable the tests to run on the build server, I have another var in the Globals script: var BuildServerStoragePath = C:\\Builds\\5\\<whatever the path is>\\Binaries\\; This is where the build server outputs the binaries to. In my main App startup script, I test for the existence of this path, and if it is found, I change MyApp["Path"] to point to this. It works ok; if the build is running on my local dev machine it runs it from Z:\Binaries, otherwise it must be running on the build server, so it runs it from there. However the entire suite of UI tests now takes about 50 mins to run, which is too long to run every check in. We have created a new build definition that runs at 3am every night. This runs the UI tests. It was pointing at the Check In Builds binaries folder. I have now changed it to point to the Nightly build Binaries folder, just by changing where the BuildServerStoragePath is pointing. Considering that we might want to to add more build definitions that run All/Some of the UI tests... how can I choose which binaries folder I want to run from? It won't always be the same one... I hope this makes sense.14KViews0likes3CommentsHelp required with handling of unexpected windows
Hi, I have a couple of issues that I could really use some help with. I'm running my automated tests as part of the build on our automated build server. Our tested app sometimes crashes, or at least windows is reporting that it's crashing when it shuts down. This results in a dialog box being displayed (by windows 7) asking whether I'd like to "Debug" or "Close Program". All of the TestComplete tests may pass successfully, but if this dialog is not closed, then the next and successive builds will fail, because the pesky dialog has some kind of flag set on the build / binaries folder, which prevents the build server from deleting/recreating it - even though all the files in the directory are deleted, including the tested app executable etc. It's all gone - empty folder that's somehow still in use by this dialog. I can't seem to catch this with unexpected window handling in TC... only on the build server do I get the close/debug dialog. When the app "crashes" during shutdown on the development PC, I just get a message saying something like "The program has stopped responding, please wait" and that is closed automatically by windows a few seconds later. Question: What else can I do, is there a better way to catch this dialog on the build machine? When should I put the check for it in my tests? I guess right at the very end would be best... but I can't generate it (the same dialog) on my TC dev machine (build server only has TestExecute), so I can't map it in name mapping etc. We did have a problem a while back where our appilcation might sometimes hang on startup - then the next build would fail because the file in use and can't be deleted problem occurred. My solution to this was to run our Cleanup Utility (which looks for any of our app's processes that are still running and kills them) at the end of the test run, or if the test run should fail (I think I put it in the OnLogError event handler). I also made this utility run before trying to start our tested app, just in case there were any of its processes running somehow. This seemed to work ok for a while, but now for some reason - even though only one instance of this app should be allowed to run at once - I end up with two instances of this app running. I'm currently looking into that. I've put a check in by doing the following if (Sys["WaitProcess"]("CleanupUtility")["Exists"]) ExitButton.ClickButton(); Where CleanupUtility is the app and ExitButton is the exit button on the app's form. Thissometimesseems towork ok, but I'm now seeing errors in my test log - The "&Exit" window is invisible and thus cannot be activated. Question: Can I just run that waitprocess check a few times in order to catch multiple instances of this cleanup utility? Any advice you have would be great. Thanks in advance.9.6KViews0likes3CommentsWindows Event Log Monitoring / Exception Tracking
Is it possible for TestComplete to monitor the windows event log so that exceptions that occur in our software can be tracked (even if they don't raise an alarm in the software itself - they should, but some aren't handled properly yet)? What I'm talking about is if you look in the Windows Event Viewer > Windows Logs > Application > (!) Error entries. If it's not able to do this kind of thing directly, is there another way you could recommend at all to do this from TC? Many Thanks,16KViews0likes1CommentTests run directly from TE but not via VS2010
I can run my tests on another machine with TestExecute installed, by opening the project file and clicking Run. However I cannot do this from a Test Project in Visual Studio - I keep getting these messages in the silent log: 6/14/2011 11:03:37:263 Tried to open the Save Read-Only Storage dialog. The default value is wpcCancel. 6/14/2011 11:03:38:672 Tried to open the error dialog. Message: Run failed. Error: the project was modified and cannot be saved.. 6/14/2011 11:03:40:030 Tried to open the Save Read-Only Storage dialog. The default value is wpcCancel. 6/14/2011 11:03:40:039 Tried to open the Save dialog. The default value: YES. 6/14/2011 11:03:40:077 Tried to open the Save Read-Only Storage dialog. The default value is wpcCancel. And the test just falls over before getting started. The only solution seems to be to check out the TC project files before attempting to run the test, but that's no use to us whatsoever. I also get TestComplete popping up save as messages now that the project isunder source control. I guess it's ok that I need to check it out there to edit, but just to run? Really? Is there another solution to this? Thanks,23KViews0likes3CommentsRe: VS 2010 Integration - Hard Coded Paths in Test Item (blocking issue)
We were forced to get around a similar issue, because it's not possible to use relative paths, due to the specifics of the TFS architecture, apparently. I received the following reply from SB Support: You can try mapping folders, where your files are checked out, as virtual drives using the "subst" command. In this case, you'll be able to use absolute paths to TestComplete projects. E.g. these paths will be "Z:\LocalCopy\TestCompleteProjectSuites\FooTestProject\FooTestProject.pjs" on any machine that is configured in the suggested way. For additional information on the "subst" command, please see the following articles: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/subst.mspx?mfr=true It sort of seems to work - Very much NOT ideal, but at least we can move forward., However, we've now run into another problem of TestExecute trying to access Read-Only Save As dialogs, which don't show up... which then causes the tests to fail. The only way around that seems to be to check out the TC stuff before attempting to run the test. But that's no good to us at all.658Views0likes0CommentsRe: File DSN help, please.
Thanks Allen, The solution was to do something like this: var DSN = "FILEDSN=MyFileDsn.dsn"; // MyFileDsn.dsn resides in my script folder - otherwise include the path to it e.g. =c:\MyFileDsn.dsn var Qry = ADO["CreateADOQuery"](); Qry["ConnectionString"] = DSN; Qry["SQL"] = "select blah blah blah from something"; Qry["Open"](); But basically, I just had to point the Connection string at the DSN file... should've thought about that in the first place.756Views0likes0CommentsFile DSN help, please.
Hi, I've been using a User or System DSN for my DB connection in tests, so far and it's been working great. I can't create a user DSN on other machines that will be running the tests via TestExecute, so I'd like to use a File DSN, then check that into the source repository and then everyone should be able to use it; they'll all have the same drivers that are required. My question is - HOW do I use a File DSN in the connection after I've created it? var Qry, FoundCR; // Create a query Qry = ADO["CreateADOQuery"](); // Specify a Connection string - currently uses SystemDSN Qry["ConnectionString"] = "Provider=MSDASQL;Persist Security Info=False;Data Source=Recipes"; // Specify the SQL expression - Cluster Recipe Name passed in from outside Qry["SQL"] = "Select max(ID) as ID from ClusterRecipes where Name = '" + CRName + "'"; // Execute the Query Qry["Open"](); This worked fine... but adding ".dsn" onto the end of Recipes doesn't work. I'm not sure where the .dsn file should reside. I've put it in the scripts folder, and pointed ODBC data sources at it ... but still no joy. Is anyone able to help me with this? Hopefully it's something simple. The Connection Test works fine from the ODBC manager, so the dsn itself seems ok. It's all running on 32 bit O/S too...11KViews0likes2CommentsRe: While Loop in Keyword Test/Script
Thank you David, That seems to be just what I was after...not an ideal solution, but a solution nevertheless :) Another sort of question that relates to this... See the waitProperty line: //Delays the script execution until the specified property equals the specified value or until the specified time limit elapses. Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["SystemTabs"]["SystemTabsControl"]["System_PJsTab"]["ProcessJobsPage"]["SYS_processJobsSplitContainer"]["SYS_PJsSplitterPanel1"]["ProcessJobListView"]["WaitProperty"]("wItemCount", 0, 600000); Is there any way at all to intercept things happening while this line is being processed? For example - some alarm might occur while a job is in progress... and I don't really want to be waiting until the 10 minutes is up to find out if something went wrong. In essence, I would like to/need to be able to wait for things to happen, so that the test doesn't time out, but have the ability to check other things in the meantime. Is this a possiblity, or something that could be added into TestComplete asa feature request at a later date? Cheers, and Happy New Year to everyone @ SmartBear etc. J. ["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["SystemTabs"]["SystemTabsControl"]["System_PJsTab"]["ProcessJobsPage"]["SYS_processJobsSplitContainer"]["SYS_PJsSplitterPanel1"]["ProcessJobListView"]["WaitProperty"]("wItemCount", 0, 600000);Is there any way at all to intercept things happening while this line is being processed? For example - some alarm might occur while a job is in progress... and I don't really want to be waiting until the 10 minutes is up to find out if something went wrong. In essence, I would like to/need to be able to wait for things to happen, so that the test doesn't time out, but have the ability to check other things in the meantime. Is this a possiblity, or something that could be added into TestComplete asa feature request at a later date? Cheers, and Happy New Year to everyone @ SmartBear etc.J.2.6KViews0likes0CommentsRe: While Loop in Keyword Test/Script
Hmm, it seems that the above is blatantly not going to work. I was very ill when I wrote it, I went home to bed straight after. But hopefully you can see what I was trying to achieve? I would like to monitor (or keep checking very often) the number of items in the listview and if there are any, stop execution of the test because something's gone wrong in the software. How can I do this?2.6KViews0likes0Comments