Forum Discussion

damien_gaullier's avatar
damien_gaullier
New Contributor
12 years ago

Edit Combo Box

Hi,



In my case, I need to go through an external program to insert an item in the software. In this case it's Explorer + +.

My problem is that when I execute my test from "Run All"
my script don't work (TC don't find edit box) but if I execute it lonely, all it's ok.



My code (in C#) :



function dragAndDrop (FolderPath,FileName)

{

  Log.LockEvents() ;

  Log.Message("Start Drag and Drop :" + FileName + " ...");

  var x = Aliases["Engine"]["MainWindow"]["Width"]/2;

  var y = Aliases["Engine"]["MainWindow"]["Height"]/2;

 

  var comboBoxEx32;

  var edit;

  comboBoxEx32 = Aliases["Explorer_"]["WindowExplorer_"]["ReBarWindow32"]["ToolbarWindow32"]["ComboBoxEx32"];

  edit = comboBoxEx32["ComboBox"]["Edit"];

  edit["Click"](81, 5);

  comboBoxEx32["SetText"](FolderPath);

  edit["Keys"]("[Enter]");

 

  Aliases["Explorer_"]["WindowExplorer_"]["SetFocus"]();

  Aliases["Explorer_"]["WindowExplorer_"]["SysListView32"]["ClickItem"](FileName);

 

  LLPlayer["MouseDown"](MK_LBUTTON, Sys["Desktop"]["MouseX"], Sys["Desktop"]["MouseY"], 500);

  LLPlayer["MouseMove"](x, y, 500);

 

  Aliases["Engine"]["MainWindow"]["SetFocus"]();

  Delay(500);

 

  //Release LClick in the center

  LLPlayer["MouseUp"](MK_LBUTTON, x, y, 500);

  Log.Message("Drag and Drop " + FileName + " ok");

}



Error report :


An error occurred while accessing the "Click" method or property of the "Edit" object.

The object or one of its parent objects was not found.



Object Whose Method or Property Was Accessed














Alias:

Aliases["Explorer_"]["WindowExplorer_"]["ReBarWindow32"]["ToolbarWindow32"]["ComboBoxEx32"]["ComboBox"]["Edit"]

Name mapping item:

NameMapping["Sys"]["Explorer_"]["WindowExplorer_"]["ReBarWindow32"]["ToolbarWindow32"]["ComboBoxEx32"]["ComboBox"]["Edit"]


Object That Was Not Found














Alias:

Aliases["Explorer_"]["WindowExplorer_"]["ReBarWindow32"]["ToolbarWindow32"]["ComboBoxEx32"]

Name mapping item:

NameMapping["Sys"]["Explorer_"]["WindowExplorer_"]["ReBarWindow32"]["ToolbarWindow32"]["ComboBoxEx32"]



I'm on TC version9

Thanks