Forum Discussion
katepaulk
13 years agoOccasional Contributor
Rob Martin has it pretty much set, there (he's a former co-worker and I'm still at the location that uses the virtual string tree component).
Some suggestions based on the interesting times I've had:
If your parent form has the ability to expand all nodes, that should be the first step. The alternative is a mix of selecting the parent and using keystrokes to expand. Of course, using the keystroke method, you can count the number of expand actions you perform to reach the desired node and check that against your expected node depth, which isn't available with an expand all.
Another option, depending on how your virtual string tree is laid out, is to use TVirtualStringTree.ContentToText_1(0, ','); This will return a string formatted as a CSV file. You can split this into a string list and navigate through it - although I'd suggest you start by saving to CSV and taking a look at what's returned. (Alternatively, use a different separator and save as text, then take a look). Chances are, there's a consistent way to represent child nodes in the output of ContentToText - I've never needed more than an output comparison yet, and most of the virtual string trees I work with are no more than 2 levels deep).
Unfortunately, the internal records structures in Delphi don't play at all well with TestComplete - they're essentially invisible.
If you need code snippets, please ask, and I'll supply the core part of what's in use where I work. It's ugly, but it works most of the time.
Good luck!
Some suggestions based on the interesting times I've had:
If your parent form has the ability to expand all nodes, that should be the first step. The alternative is a mix of selecting the parent and using keystrokes to expand. Of course, using the keystroke method, you can count the number of expand actions you perform to reach the desired node and check that against your expected node depth, which isn't available with an expand all.
Another option, depending on how your virtual string tree is laid out, is to use TVirtualStringTree.ContentToText_1(0, ','); This will return a string formatted as a CSV file. You can split this into a string list and navigate through it - although I'd suggest you start by saving to CSV and taking a look at what's returned. (Alternatively, use a different separator and save as text, then take a look). Chances are, there's a consistent way to represent child nodes in the output of ContentToText - I've never needed more than an output comparison yet, and most of the virtual string trees I work with are no more than 2 levels deep).
Unfortunately, the internal records structures in Delphi don't play at all well with TestComplete - they're essentially invisible.
If you need code snippets, please ask, and I'll supply the core part of what's in use where I work. It's ugly, but it works most of the time.
Good luck!
Related Content
- 14 years ago
- 14 years ago
- 14 years ago
- 14 years ago
Recent Discussions
- 19 hours ago