How to invoke Test Execute from DOS command line providing external parameters
My background is in C, Java, Python development. On a new project I work on, I have to build a Test Complete framework to simulate various Windows user level scenarios to be used by the QA team.
this is what I need to do (small part of the project):
1. Write a function which gets a string representing a UNC Windows path to a remote CIFS file server – I.E \\\\1.1.1.1\\share_1 – the functions name is: view_directory_listing (p_str_unc_path) – the method returns a list of the files/folders under the above UNC path. (please see below on how its implemented – as seen, very simple…)
2. Write a main function which is invoked externally from the DOS command line on a Test Execute client – the main will get 2 parameters, the name of the method to invoke and a string which is the UNC path to provide.
3. Both the aboe methods are written in the same Unit in the Test Complete project.
4. On the Test Execute machine, I copied the content of the project to a location under drive C.
This is the command line I invoke on the Test Execute machine:
C:\Test_complete_proj\VSS_1\VSS_1.pjs /r /p:VSS_1 /u:vss_script_1 /rt:main view_directory_listing \\\\10.1.1.149\\dev
As seen - I provide to the routine main the 2 parameters (maybe there is a problem in this - I didnt see in the documentations on how to invoke Test Complete methods providing external params...)
When I run this command, nothing happens, I don’t get an error message as well.
Note: I know that Test Execute runs well on that client, when I type: “c:\Program Files\Automated QA\TestExecute 8\bin\TestExecute.exe” – I get a message that a Test Execute instance is already running…
Here are the two methods code:
function main (p_str_methods_name,p_str_param)
{
if(p_str_methods_name == "view_directory_listing") {
directory_list = view_directory_listing(p_str_param);
Log.Message("Dir list of " + p_str_param + " is: " + directory_list)
}
}
function view_directory_listing(p_str_unc_path)
{
var explorer;
var comboBox;
var wndCabinetWClass;
explorer = Aliases.Explorer;
explorer.wndShell_TrayWnd.btnStart.ClickButton();
explorer.wndBaseBar.MenuSite.ToolbarWindow32.ClickItemXY("&Run...", 32, 23, false);
comboBox = explorer.dlgRun.ComboBox;
comboBox.SetText("p_str_unc_path");
comboBox.Edit.Keys("[Enter]");
wndCabinetWClass = explorer.wndCabinetWClass;
fileList = slPacker.GetFileListFromFolder(p_str_unc_path);
wndCabinetWClass.Close();
return fileList;
}
Can you please assist me on that?
I am sure that something small is missing here....
Thanks,
Tomer