Don’t put spaces in you databank alias in openscript – period.
Background
You might spend a couple of nights that you’ll never get back (like me) working out why your permutations and combinations of openscript command line options are not working.
OTM uses a commandline interface to openscript.
Things that work in openscript do not always work when calling from OTM.
To see commandline options, http://docs.oracle.com/cd/E59557_01/OPSUG/opscrpt_cli_tools.htm#BEIFCJFF
One issue in particular is that spaces in the databank filename will fail in OTM.
The basis of this post is that a databank alias with spaces does not work when it goes to OTM. You can quickly see this when you run the script. You get 0 errors in the execution and there is also nothing written to your log file in c:\OracleATS\logs
Does not work:
-dbopts alias=0502 Setting Up Service Types:startIndex=11,alias=LoginCredentials:startIndex=1 -DelayPercentage -1 -delayMinSeconds 5 –delayMaxSeconds
-dbopts alias=”0502 Setting Up Service Types”:startIndex=11,alias=LoginCredentials:startIndex=1 -DelayPercentage -1 -delayMinSeconds 5 –delayMaxSeconds
c:\oracleATS\logs\process_console_2016-11-22T15-52-04.972adc5179a-66e5-46e6-8e63-503faa65a3e3_.log
Running "0502 Setting Up Service Types" ...
10:41:12,325 INFO [DeploymentLogger] creating data source for databank "LoginCredentials". Databank usage: Advance record: by script request, Select record: sequentially, Out of records: loop continuously, Start record: 1, Seed value=0
10:41:12,361 INFO [DeploymentLogger] creating data source for databank "0502 Setting Up Service Types". Databank usage: Advance record: by script request, Select record: sequentially, Out of records: loop continuously, Start record: 1, Seed value=0
Does work:
Ensure that the alias in the databank definition in your script does not have spaces – see above. Get to this from
-dbopts alias=0502SettingUpServiceTypes:startIndex=11,alias=LoginCredentials:startIndex=1 -DelayPercentage -1 -delayMinSeconds 5 –delayMaxSeconds
I passed in a startIndex of 4 above, and I can see that the correct substitution is being used.
So, it just does the default databank operation – not using your command line override.
When you remove the spaces from your databank, it iterates as designed:
More on databanks and script design
The way OTM works is that you need to configure a pile of command line options if you are doing fancy things with databanks. This is a little frustrating, as you need to understand the complete lifecycle of your test cases to ensure that the setup of an individual script is going to be correct.
For example, rule 1 – don’t think that you can scroll through a databank on different days and remember were you are up to, you cannot. You also cannot pass in a pointer at the command line to do this for you. You would need to maintain the pointer (or current databank record) in a text file (or database file) and update this at the end of every script and also use this on your call to “get next record”.
-dbopts alias=0502SettingUpServiceTypes:startIndex=11,alias=LoginCredentials:startIndex=1 -DelayPercentage -1 -delayMinSeconds 5 –delayMaxSeconds
The startIndex setting cannot be fed into this test set – I need to change this every time.
So, I need to do this in the script:
int scriptIterationCounter;
getDatabank("0506VCAMEnteringMeterReadings").getNextDatabankRecord(scriptInterationCounter);