Forum Discussion
3 Replies
Sort By
Hi Dennis,
You can use the DBTable.ConnectionString property. Read the DBTable.ConnectionString help topic for more information.- mcguireden50New ContributorSorry - I guess I didn't do a very good job of explaining my question.
What I want to do is pass a stores.dbtables.table1 object from a runscriptroutine in a keyword test using stores.dbtables.table1 object as a parameter to a script routine.
Here is basic pseudo code
Keyword test
Item Operation Value
Run Script Routine setconnectionstring stores.dbtables.table1
Script codefunction setconnectionstring(obj:object);
setconnectionstring(obj:);var DBTab;
DBTab;begin
DBTab := obj;
DBTab.ConnectionString := 'Provider=Advantage.OLEDB.1;Data Source='+ProjectSuite.Variables.VariableByName['connectionpath']+';Persist Security Info=False;Advantage Server Type=ads_local_server';
end;
;
What is the proper way to pass the parameter to the script routine.
Thanks
Hi,
I was able to pass the DBTable object from a keyword test to a script test. I added the Run Script Routine operation to a keyword test and specified "dbtables.table1" in the Value column (the parameter mode is Code Expression). Here is a script function that receives the object:
function setconnectionstring(obj);
var DBTable;
begin
DBTable := obj;
result := DBTable.ConnectionString;
end;
BTW, if you want just to change the connection string in your keyword test, you can use the Run Code Snippet operation instead of calling a script routine that will perform the same. Please read the "Run Code Snippet Operation" article for more information.
Related Content
- 22 days agoSahall0308
Recent Discussions
- 18 minutes agoashly