ContributionsMost RecentMost LikesSolutionsRe: Run a Powershell script, to start a Windows service, from a Test Complete scripted test Hi, I have now solved this by searching back through some similar posts. This was posted by Tristaanogre, back on 10-04-2017 @05:34 AM: Actually, starting/stopping a windows service is simply a command line of "net start <servicename>" or "net stop <servicename>". This can be done using the WshShell.Run method (https://support.smartbear.com/testcomplete/docs/reference/program-objects/wshshell/index.html). The way I would do it is simply something like this. FYI, this should work both for JScript as well as JavaScript: function startService(serviceName){ WshShell.Run('net start ' + serviceName, 1, true); } function stopService(serviceName){ WshShell.Run('net stop ' + serviceName, 1, true); }. Seems that the ps1 script is not required at all. Cheers, Steven. Run a Powershell script, to start a Windows service, from a Test Complete scripted test Hi, I am trying to find a way to start the service of an application, to be tested (this being part of the overall test), by running a Powershell script from within the scripted test unit. The script works, I can see Powershell is run, but the service is not started. If I use a manual method of running the ps1 script; right-click the file, select 'Run with Powershell', the service is started successfully. I am guessing there is some form of authority that is missing when the ps1 script is run from Test Complete, perhaps? Test Complete is started with 'Run as Administrator'. Any help appreciated. Cheers, Steven. SolvedRe: Working with Embarcadero's Delphi 'Themes' packs. Hi Uwe, Yes, it is a little strange that in the three years since I posted this nobody, except you and I, seems to have seen this issue. It continues to be there, although I quickly realised that by adding a command-line parameter, in Run-mode parameters (of 'TestedApps'), Test Complete will open an un-styled version of the application under test and therefore not run into the issues otherwise seen. But, as you rightly say, it's a PITA that you cannot test the app 'as is'. Cheers, Steve. Re: Unable to run a test script that contains more than one test. Hi tristaanogre, I upgraded from TC11.10. In that version, and all previous versions I've used (since Dec2013), I had no issues with running scripts containing more than one test script. The format was: A script unit with a name i.e. A_A_TEST. This would contain the Delphi script written tests in the format; //some interesting info Procedure Test1 //some more info var (a whole bunch of these, as required) begin the meat and bones of the test end; //yet more stuff Procedure Test2 //blah blah blah var (whole other bunch, as required) begin the meat and bones of the test end; As I said, prior to the new version, this would run quite happily and then move on the next script unit Version:1.0 B_A_TEST2. But, with the new version, test1 is run test2 is skipped and it goes straight into the second script unit. Hope this helps. Cheers, Steve. Re: Unable to run a test script that contains more than one test. Hi tristaanogre/cunderw, I think I have spent as much time as I wish trying to figure out what the issue might be and will close this discussion. I thank you both for your replies and assistance. At the end of the day, I simply re-arranged the way my scripts run in order to get them to work, which is the important thing. This wasn't a 'show-stopper', though it would have been nice to know why it happened. Though tempted, as I can't say I'm a big fan of the new style Defects/Test Sets layout, I don't really have the time (at present) to roll-back to previous versions to prove something I already know to be true. Cheers, Steve. Re: Unable to run a test script that contains more than one test. Hi Cunderw, I haven't added anything to the scripts, they were created and have run, successfully, as detailed above, no issues. They are as they have always been. The differences are, that the current version does not succeed in running the scripts in the order stated as all previous versions have done, without fail. All I'm trying to find out is what has changed in this version, compared to the previous version I've successfully run with these scripts, that causes this sudden failure. Cheers, Steve. Re: Unable to run a test script that contains more than one test. Hi cunderw, "As far as I know you cannot and have never been able to run an entire script unit in Test complete, just individual functions / routines."...seriously? Perhaps it wasn't clear, what I said before, I'll try to elaborate: I have a Project Suite. The Suite contains 4 Projects. Each of the 4 Projects contains a number of scripts that, in turn, contain tests. Some of the scripts contain more than one test. The tests can be run individually, by Project or altogether from Project Suite level. It has been this way since we first starting using Test Complete in 2013. It remained so until the new version when, for whatever reason, the scripts that had more than one test didn't run fully. Only the first test in those particular scripts was run. Now, I know I can get around this, what I was trying to find out is why this sudden change and what caused it. Cheers, Steve. Re: Unable to run a test script that contains more than one test. Hi cunderw, The test script contains two test units, written in Delphi, using a naming convention of "test4" followed by "test5". The test script is one of 15 within a project that, is in turn, part of a project suite containing four projects to test a desktop application. The test script is the third, in turn, to run within the project, as ordered in the project Test Items listing. There are no errors, when it comes to running the script, test4 is run and test5 is simply skipped and TC moves on to the next script, containing test6. As stated earlier, this has been working without fail for some considerable time and this issue, of skipping, has only occurred recently. Cheers, Steve. Re: Unable to run a test script that contains more than one test. Hi m_essaid, Thank you for your reply. You mention creating individual test items and so forth. However, much like my own 'workaround' they will achieve a result but don't really answer the question as to why something that has been working, for a number of years, now no longer does without making changes. Clearly, something has altered in Test Complete, recently, that makes it necessary to alter my standing project items. Cheers, Steve. Unable to run a test script that contains more than one test. Hi, I am running TC 12.31 build 1833 on a Windows 10Pro machine. I have a test project with a number of script (written in Delphi) units. Some of these units have more than one test within them. These used to run okay but now only the first test, in a unit with more than one test, is run during a test playback run. This, obviously, causes an issue for subsequent tests. The workaround is to make these particular scripts only have a single test, but don't understand why, something that has been working, is now no longer working. Anyone else suffered from this? Cheers, Steve. Solved