Clicking Folder on Windows Desktop
Hi Folks,
I'm new to TestComplete andhave been trying to create a Javascript that could double click on the Folder on Windows Desktop.
I can see it could be accessed using SysListView32, FolderView window object but I don't know what to do next.
Let's say my Folder name is ABC and it's on desktop.
I tried Find() function but that didn't work too.
Any ideas would be very appreciated.
Code Sample:
var t,w, control;
t = Sys.Process("explorer");
w = t.Window("WorkerW", "", 13);
w = w.Window("SHELLDLL_DefView", "", 1);
w = w.Window("SysListView32", "FolderView", 1);
control = w.Find("wSelectedItems", "ABC", 1000);
control.DblClick();
Error:
object 'control' doesnt exist.
You could do it like the codes.
var pcDesktop = Aliases.explorer.PCdesktop.desktop.listView; for(i = 0;i < pcDesktop.wItemCount; i++){ if(equal(pcDesktop.wItem(i),foldername)){ pcDesktop.DbClickItem(i); }else{ continue; } }
Or A another simple way to do that like this. You could use DbClickItem method.
xxx.Window("SysListView32", "FolderView", 1).DblClickItem(folderName);