ciscowaas
15 years agoOccasional Contributor
Recording a script using windows keyboard shortcuts
Hi,
I am trying to automate the following testcase using windows keyboard shortcuts, so that this script can run on different Windows OS
Testcase:
> Access a share directory and copy a file to local pc . Start->Run->\\x.x.x.x\share. For this step, I am using windows keyboard shortcut "win logo + R" to open Run . This operation is done on Win7 pc
In the recorded script, I am seeing that it saves the above "win logo + R" operation as "[Win]r " Now, when I try to re-run this code, it doesn't open RUN, instead, it performs [WIN] - start and then in the search box it enters 'r'
Can someone please help me figuring out what is a better way to open RUN without a mouse click or if you can tell me what is keyboard equivalent for the same ?
Script recorded is as follows:
function Test1()
{
var explorer;
var comboBox;
var edit;
var wndtesting;
var directUIHWND;
Aliases.cmd.wndConsoleWindowClass.Keys("[Win]r");
explorer = Aliases.explorer;
comboBox = explorer.dlgRun.ComboBox;
comboBox.SetText("\\\\1.1.1.1\\testing");
edit = comboBox.Edit;
edit.Keys("[Enter]");
wndtesting = explorer.wndCabinetWClass1;
wndtesting.testing.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND.DblClick(88, 142);
directUIHWND = wndtesting.ats_cifs_exploratory_test.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND;
directUIHWND.Click(49, 80);
directUIHWND.ClickR(49, 80);
directUIHWND.PopupMenu.Click("Copy");
directUIHWND.Keys("[Win]r");
comboBox.SetText("C:\\");
edit.Keys("[Enter]");
wndtesting.ShellTabWindowClass.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND.Keys("^v~[F4]");
directUIHWND.Keys("~[F4]");
}
Thanks !
Ali
I am trying to automate the following testcase using windows keyboard shortcuts, so that this script can run on different Windows OS
Testcase:
> Access a share directory and copy a file to local pc . Start->Run->\\x.x.x.x\share. For this step, I am using windows keyboard shortcut "win logo + R" to open Run . This operation is done on Win7 pc
In the recorded script, I am seeing that it saves the above "win logo + R" operation as "[Win]r " Now, when I try to re-run this code, it doesn't open RUN, instead, it performs [WIN] - start and then in the search box it enters 'r'
Can someone please help me figuring out what is a better way to open RUN without a mouse click or if you can tell me what is keyboard equivalent for the same ?
Script recorded is as follows:
function Test1()
{
var explorer;
var comboBox;
var edit;
var wndtesting;
var directUIHWND;
Aliases.cmd.wndConsoleWindowClass.Keys("[Win]r");
explorer = Aliases.explorer;
comboBox = explorer.dlgRun.ComboBox;
comboBox.SetText("\\\\1.1.1.1\\testing");
edit = comboBox.Edit;
edit.Keys("[Enter]");
wndtesting = explorer.wndCabinetWClass1;
wndtesting.testing.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND.DblClick(88, 142);
directUIHWND = wndtesting.ats_cifs_exploratory_test.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND;
directUIHWND.Click(49, 80);
directUIHWND.ClickR(49, 80);
directUIHWND.PopupMenu.Click("Copy");
directUIHWND.Keys("[Win]r");
comboBox.SetText("C:\\");
edit.Keys("[Enter]");
wndtesting.ShellTabWindowClass.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND.Keys("^v~[F4]");
directUIHWND.Keys("~[F4]");
}
Thanks !
Ali