Click here to Skip to main content
15,885,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
do you know how can I understand the name of the form that is open now, when we use UI automation library to automate running the application?
is there any statement or method in UI automation library to detect the name of each form that is open now??
Posted

FormCollection formCollection = Application.OpenForms;
 
Share this answer
 
I am not familiar with the "UI Automation Library" but Form.ActiveForm in a WinForms Application will return a reference to the active Form; if there is no active Form, it returns 'null [^].
 
Share this answer
 
Comments
Member 11562137 26-Apr-15 0:49am    
thanks, but none of these two statement don't work on my code!
I use UI automation library to run and test my app automatically. for example suppose I write a code with help of the methods of this library, in that the Login form is opened automatically and then by automated clicking on the "OK" button, a new form will be opened. suppose I don't know the name of this new form. and I want to use a method or a statement to detect the name of this form. do you know such statement?
(I think this statement or method should be one of the UI autoamtion librarie's method!!)

(when I run my code, that new form (the second form) in above example will be opened, but none of your statements don't work and these statement return null value!)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900