This project is read-only.

Panel Click

Feb 26, 2009 at 6:03 PM

I am trying to automate a click on a panel using below code.

  Application application = Application.Launch(path);
  Window window = application.GetWindow(SearchCriteria.ByAutomationId("Welcome"), InitializeOption.NoCache);
  Panel panel = window.Get<Panel>(SearchCriteria.ByAutomationId("ReturnButton"));

But click event is not firing on that panel.

Could you help me with this.

Feb 27, 2009 at 7:57 AM



I run the same sample code of you. It works fine and the click event fired.


Hope you have added the Panel.Click event in your “Welcome” application ?

Please Run the test and check. You may miss during (line-by-line) debugging.


Thanks & Regards,


Feb 27, 2009 at 9:07 PM
Hi Kannan

I have window "Welcome"  and several panes inside of the window. I am assuming these panes as panels and performing a click event on these. My application has click events associated with these panes (PictureBox). One thing I noticed was get_ClickablePoint threw an error for all these panes.


Feb 27, 2009 at 10:48 PM
Hi Kannan

I ran the same code by creating a new test in white src solution it worked but not working if I create a console apllication.

Any insights.

Feb 28, 2009 at 4:26 PM
If it is possible can you post some sample code to illustrate the problem?
Mar 2, 2009 at 3:38 PM
 Hi Vivek

Here is the sample I am talking about. If you run this code in a sample console application, image click is not working.
If you create a nunit test in white src application, image click is working.

   private const string path = @"C:\Learn\White-src-11-9-2008\WinFormsTestApp\bin\Debug\WinFormsTestApp.exe";
           Application application = Application.Launch(path);
           Window window = application.GetWindow(SearchCriteria.ByAutomationId("Form1"), InitializeOption.NoCache);
           Image image = window.Get<Image>("image");

Mar 7, 2009 at 1:51 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.