Forum Discussion
Lee_M wrote:
This is just working the problem from a different angle
Yes, it is. Since we are guessing at what you really want to do, all we can do is offer alternatives.
I myself don't understand how accessing a data file with two URL entries is asking someone to dig through a file, but I guess that's just me. I would consider that to be safer than asking them to change a variable or table value in TestComplete.
Good luck with your script!
Marsha,
Thanks for your input and confirmation that I took the only approach available for this situation
The idea is for visibility
- Live_URL
- Test_URL
are clearer and shorter to read for a non-programmer, rather than something like:
Which I can create in another structure
- AlexKaras4 years ago
Champion Level 2
Hi,
Why not to create a new variable (TestedURL), assign it (somewhere) value of either Live_URL or Test_URL and use this new variable in your KW tests?
- Lee_M4 years agoCommunity Hero
This is what I have done
Marsha_R suggested an excel spreadsheet - I have used a table variable, which is just a different type of variable but I feel can be used a little more ablatively than the excel solution for my purposes.
Either way, the answer I was looking for was that you CAN'T make a DDT loop over a series of variables unless it is a structured data type
- AlexKaras4 years ago
Champion Level 2
Hi,
> you CAN'T make a DDT loop over a series of variables unless it is a structured data type
Yes, correct for the built-in data loop operation.
Actual implementation may vary and some code sample might help to better understand your needs and idea.
For example (untested jscript pseudocode)
var test_url = ...;
var pod_url = ...;
var arr = [test_url, prod_url];
for each (var url in arr) { // DDT loop
...
}
P.S.
From initial message:
> Live and test on different URLs - both MUST URLs be stored as separate string vars (liveUrl, testUrl)
I do not see the reason to store these two URLs in a separate variables (unless both of them are used within one test), but probably due to the fact that I know almost nothing about your actual test.
Store them as separate data entries for DDT or just easy switching between tested environments - yes, but store them in a separate standalone variables (i.e. not array, table variable, etc.) - no.