Forum Discussion
It looks like you're trying to create yet another UI when you might not need one.
If you want users to be able to run a certain set of tests, then you can set them up in something like Bamboo or GoAnywhere and inside that tool, have a TestExecute job that runs the tests that you want.
Thanks for the replies.
Essentially you are correct Martha.
All I want is an icon on the desktop (batch file), and when clicked will pop a form with a few different test-plans to choose from (which are hundreds of test items that have been grouped together in various categories).
It appears the only real solution here is to either train in the tester to open TestComplete and modify the Test Items Page to check/uncheck what is needed, or I just bite the bullet and manually type in all the different sequences into a few different functions. (But even with that I will have to import hundreds of methods into that Script Unit so I can call it within the button function.) So Ill probably end up doing it the long way.
I think Im good on integrating another third party program. Just trying to make it easy for non-technical people to walk up to the machine and simply double click to start the test-plan they need.
TestExecute pretty much will do the trick for this by simply opening the project named approprietly, but it is currently running extremely slow and sometimes hanging.. So I may just have to hold off until I can get a faster machine to do it via TestExecute.
Thanks for the help everbody as usual!!
- mgreen7 years agoContributor
As I am adding these script items within the button function I am noticing that after execution the reporting is not like when you run the tests via Test Items page. This is disappointing.
- tristaanogre7 years agoEsteemed Contributor
Yeah, sorry man. Doing our best here.
Alternative, though, to "importing" a bunch of script files.
https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/script/runner/callmethod.html?q=runner.callmethodYeah, it's listed as "obsolete"... but it still works. And that will save you that import step.
- tristaanogre7 years agoEsteemed Contributor
Yeah, TestItems organize things a bit different in the test results page.
Something you can do to emulate that a bit...Log.AppendFolder https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/appendfolder.html
Log.PopFolder https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/poplogfolder.html
Wrap your individual function calls with those two method calls and you'll get an expandable tree-view in your log, separating your individual tests.
- mgreen7 years agoContributor
Thank you! Always appreciate your team and the support.
- AlexKaras7 years agoCommunity Hero
Hi,
As it was already pointed out, TestItems are containers for different executable entities provided by TestComplete and do not contain .Execute() method. (Which I really hope will be provided by SmartBear.) Different entity types are formatted differently and thus you must parse them separately.
Some examples:
// Script\testPOC - Main
// Scenarios\LegalData - Make sure that copyright is present and displays correct year
// Scenarios\LegalData - [All Scenarios]
// Scenarios - @Copyright
// KeywordTests - CheckCopyrightBelow is a sample code that can be used for the entity of Script type:
Note: The code works with the current version of TestComplete (v14.xx) but might not work with the future versions as internal structure of TestItems and project files is not documented.
function TestItemExecute(ATestItemElement) { var strElementToBeRun, arElementsToBeRun; var oRetVal = null; strElementToBeRun = ATestItemElement.Caption; arElementsToBeRun = strElementToBeRun.split('\\'); switch (arElementsToBeRun[0]) { case 'Script': arElementsToBeRun = arElementsToBeRun[1].split(' - '); oRetVal = Runner.CallMethod(arElementsToBeRun[0] + "." + arElementsToBeRun[1]); break; case 'Scenarios': // […] break; default: Log.Warning(aqString.Format( 'Unhandled element to be run (%s) for the %s Test Item. Execution of Test Item has been skipped', strElementToBeRun, ATestItemElement.Name), aqString.Format('%s\n%s', ATestItemElement.Name, strElementToBeRun)); break; } return oRetVal; }Hope it will help and inspire you with ideas.