Forum Discussion
How would using the keyword tests enable another user who is running from TestExecute to select which tests to run?
From what I've toyed around with there is no perfect way of doing this. There's a couple workarounds that should theoretically do what you need, but neither is perfect.
The first is to edit the .mds file like you mentioned. But the script you have edit the .mds has to run independently of the rest of the project. TestComplete loads the project .mds file when your test run starts executing, so even if you edit it programatically during a test run, you have to end the test run and start a new one for the changes to be recognized. So you could have a project in your project suite that opens a user input form when run and then edits the .mds file for the other project accordingly. That means the user would run that first project, input which tests to run in the next project, then run that next project. Adds an extra couple steps to the process, but it would work.
Other option is to get rid of using Project Items all together. Then write a Launcher function that gets called directly when running from TestExecute. That Launcher function could open a user input form and depending on the input could run other test functions accordingly. The test log isn't as well organized with this option, all the test hierarchy on the left tree panel is under a single test function instead of having separate items for each Project item.
Maybe there's a better option out there I don't know about, but I don't think there's anything inherently built-in to TestComplete/TestExecute to allow for this nicely. I think what Ryan was trying to say is basically the same thing as the second option I laid out, just using keyword tests instead of script functions.
- frank_vanderstr10 years agoContributor
I think I understand what you're saying with the first option, and that could make a lot of sense and be relatively easy to implement. Unfortuntely option 2 may not be a viable option, as converting test cases I have already scripted to keyword tests might be an issue, I also do not know if all my functions/checks would carry over nicely to keyword testing.
Do you have a reliable way to search the mds files and change the correct values you need to enable/disable a script to run? Looking at the mds file itself a lot of identifiers are re-used throughout the file, and finding the enabled value for a certain script seems unreliable with normal finds.
I am also attempting to load the mds file with c# code and display the information in an easy to read tree view, but that too has been proving difficult.
- ghuff210 years agoContributor
Unfortunately I don't have anything for editing the .mds file reliably, I gave up on that option and went with option 2.
You don't have to use keyword tests at all, I was just saying that you could. All you have to do is launch TestExecute with it pointing at a specific script routine/function. Then have that script routine/function call the script routines/functions that have your test code.
- frank_vanderstr10 years agoContributor
I think I get what you're saying I'll play around with that today and see how it works thanks!