Posted: 1 Mar 2018 13:30 EST Last activity: 6 Nov 2018 20:02 EST
Getting an events of a control at the same time
Is there a way of getting events of two or more controls at the same time? What I want to do is get lostFocus of one control and a click event of another control at the same time without using WaitForAll for my logic.
This would be a perfect use case for the Signal Component. Add a Signal Component to the Global Container. In one automation have the LostFocus trigger some logic to record that it happened (hasHappened variable perhaps). Have the Click event check to see if the LostFocus had occurred. If it had, then you know both happened, call the Signal component SignalAll method. In your automation where you wish to wait for these, reset the "hasHappened" variables, then trigger the logic that will make them happen (if required). After that, call the same Signal Component Wait method. When the Wait returns, it will be either True (meaning that SingalAll was called within the timeout), or False, meaning that SignalAll was not called within the timeout).