Forum Discussion

munteanadrian88's avatar
munteanadrian88
New Contributor
5 years ago
Solved

Handling click events for WPF buttons

Can you please provide an example for handling a click event on a WPF button? May someone help me with this, please?

 

Thanks in advance,

Adrian M.

  • tristaanogre's avatar
    tristaanogre
    5 years ago

    You can't create custom events necessarily in TestComplete to perform those kinds of tasks.  What you could do is write a Script routine to click on WPF buttons so that, everytime you call that routine, it a) clicks on the button and b) fills in the desired data.

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I'm not sure what the problem is you're experiencing.  If the WPF button is properly recognized by TestComplet, simply calling Aliases.MyApp.MyButton.Click() should click the button.  Can you share more details as to what the specific problem is that you need to solve?

    • munteanadrian88's avatar
      munteanadrian88
      New Contributor

      When I click a specific button automatically, I want to trigger an event which can fill out some input datasets, is there any way we can do that by using events? (e.g. OnLogError Events from TestComplete)

       

      Adrian Muntean 

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        You can't create custom events necessarily in TestComplete to perform those kinds of tasks.  What you could do is write a Script routine to click on WPF buttons so that, everytime you call that routine, it a) clicks on the button and b) fills in the desired data.