The suggested other question (Creating Accessible UI components in Delphi) solves this problem, please look there if you are searching for a solution.
I want to do automated UI-Testing in a VCL-Application created with Delphi. I tried various tools, like the Assistant for coded UI-Testing in Visual Studio or "AutoIt", but I always had an annoying problem: Some controls simply dont have a name attached to them, which could be extracted via this tools. I've tried so many different Tools, also WinSpy just to see if the property is THERE, and it isn't.
Here a little example:
Unit.pas:
type
TForm1 = class(TForm)
Edit1: TEdit;
Bt1: TButton;
end;
unit.dfm:
object Form1: TForm1
...
object Edit1: TEdit
Left = 8
Top = 48
Width = 121
Height = 21
TabOrder = 0
Text = 'This is a Edit named Edit1'
end
object Bt1: TButton
Left = 8
Top = 8
Width = 121
Height = 25
Caption = 'This is a button named Bt1'
TabOrder = 1
end
end
My problem is that I can't identify the controls i want to check or modify. Does someone have an idea why the names are missing on some components, and how I can change this?
Edit: Of course i have assigned names at design time, the problem is that they get lost somehow. I also tried to turn off opimization, but it didnt change anything.
I'm using Embarcadero RAD Studio XE2