Pega Robotics 8 - Not able to star the timer manually
i am using a timer control in my automation. if i set the initial property to enabled = true, then timer runs and event is triggered with specified intervals.
But i don't want to run the timer when the automation starts, so i changed the property as enabled = false; and in the middle of automation if i call the methos timer.start method, it is not triggering the timer tick event. i tried timer.start method or even setting enabled = true in the middle of automation. nothing seems to be working. can you please suggest if i am missing anything ?
I believe the timer must reside on a WindowsForm to function properly. In my test, I placed it on the form and the used the button click to either call Start or set Enabled to True (but not both at the same time). Either one works for me.
You can trick it assuming you have a visible windows form in your solution. The key here is that the form and button that is used to trigger the timer are visible (the button can be behind something else so that a user could not click it, but its Visible property must be true and to make it entirely inaccessible, disable the TabStop property). When you want to trigger the Windows Forms timer from an automation, simply call PerformClick on the button that starts it. Use the Click event from that button to start the timer.
There are also other types of timer's that you can use in .Net and probably add to the Toolbox. Below is an article on a few other timer options. I haven't tried adding these to the Toolbox, but if they are components, then they should work fine.
You do not need a support ticket. There are other non-windows forms timers available in .Net that you can use. The one shown by default in the toolbox is the windows forms one. You can add others as you wish.