Question


SE
Last activity: 16 Apr 2025 13:48 EDT
WaitForEvent doesn´t work properly
Hi,
I´m doing the Robotic System Architct Mission and I have big problems with WaitForEvent in all Challanges that has this step in the flow. Right now I follow the instructions for "Performing data handling with the Toolbox" and still the automation doesn´t perform as expected in BI_ClientSearch allthough no changes in the code has been done there*. The only way to update these three cutomers is by removing WaitFor Event in BI-CliesntSerach and let the robot do the btnClear and btnSearch as a part of the flow without using WaitForEvent.
*I put in a new WaitForEvent and re-wiered the links to see if it made a change but it didn´t..
I use a common HP laptop with Windows 11, version 23H2 and the Pega Robot Studio-version Proprietary information hidden
Any ideas?
BR - Pär
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


Pegasystems Inc.
US
@ParL17230685 From your screenshots it would appear that you have actually learned how WaitForEvent (WFE) works. When you use WFE, there are three execution points coming off of the method block.
- Setup
- Fired
- Timeout
Setup: This fires first. It actually fires immediately after the block starts to wait for the event. This is used to cause the event to happen. In your screenshot, you are waiting for the TextChanged event by calling the PerformClick method of the Search button. This means that while the setup is being executed, the block is waiting for the event to happen already. From your screenshot, your timeout value is the default of 15000 milliseconds. This means that if before your invocation of the PerformClick method you added a pause of 15000 milliseconds to the Setup path, you would never detect the TextChanged event within the timeout (unless of course you manually trigger the event by navigating within the application). The wait timer is already running, so it will always timeout in this case.
Fired: This happens if the event you are waiting for happens during the timeout period.
Timeout: This happens if the event you are waiting for does not happen during the timeout period.
@ParL17230685 From your screenshots it would appear that you have actually learned how WaitForEvent (WFE) works. When you use WFE, there are three execution points coming off of the method block.
- Setup
- Fired
- Timeout
Setup: This fires first. It actually fires immediately after the block starts to wait for the event. This is used to cause the event to happen. In your screenshot, you are waiting for the TextChanged event by calling the PerformClick method of the Search button. This means that while the setup is being executed, the block is waiting for the event to happen already. From your screenshot, your timeout value is the default of 15000 milliseconds. This means that if before your invocation of the PerformClick method you added a pause of 15000 milliseconds to the Setup path, you would never detect the TextChanged event within the timeout (unless of course you manually trigger the event by navigating within the application). The wait timer is already running, so it will always timeout in this case.
Fired: This happens if the event you are waiting for happens during the timeout period.
Timeout: This happens if the event you are waiting for does not happen during the timeout period.
In your case, I believe the issue is simply that you are exceeding the timeout value because you are stepping through this with your breakpoints. If you were to place a breakpoint before the WaitForEvent block and then selected Continue, the WFE should work as expected. If you still feel like you need breakpoints, I would place them on the Fired and Timeout links. When you Continue from the initial breakpoint, the setup will execute while the timeout timer is running, and the event should be detected within the timeout period.
Updated: 2 Apr 2025 16:12 EDT


HCA Healthcare
US
@ParL17230685 It sounds like you're facing issues with WaitForEvent
in Pega Robotics. First, ensure the event is correctly subscribed and matches the event being triggered in the flow. Check if the timeout settings need adjusting or if the UI element is visible and ready when WaitForEvent
is triggered. You might want to verify if the event sequence is correct and that the event is being raised properly. If it still doesn’t work, try using alternative methods like Element Exists
or Delay
as a temporary solution. Also, check if your system setup is correct, and ensure your Pega Robot Studio version is compatible with your environment. If none of these work, updating the software or reaching out to Pega support might help resolve the issue.
⚠ This is a GenAI-powered tool. All generated answers require validation against the provided references


Pegasystems Inc.
US
@Sairohith This feels like an AI generated response and not actually relevant to the issue posted. For the course work, there is a wait for event shown in the example and it most certainly does work when done properly. Element Exists is not a method available in Pega Robotics nor is Delay. I don't believe you need to check anything environment-wise. That would be indicated by the product failing to work, not one specific method. A support request is unlikely to help unless you're already associated with a client account. You can reach out through the course for assistance, but here is an appropriate place as well and likely the fastest.


Arbetsformedlingen
SE
It works better when I don´t have breakpoints and step through the flow but it´s a bit anoying that it works so bad when I step through it with breakpoints. Took me lots of hours to debug a problem that seem to be a flaw in Pega Studio.
From one thing to another:
I have done the Mission and tried out to get certified but faild. The questions were so much more difficult then the Misiontest for Pega Robotics System Architect. Are there any "testexams" that I can practice on or do you have any suggestions for additional training?


Pegasystems Inc.
US
@ParL17304035I understand your frustration. The concept of breakpoints is that they break the natural flow of the application. When you use them, you as the developer need to be aware of what they are stopping, and what they are not. I suggest using a tool called Log Playback. This can work after the fact on an existing log and step you through the automations as they were executed.
As for the practice tests, I am only aware of the one that at the end of the course.


Pegasystems Inc.
PL
Hello Par, Here are a few more suggestions you might find helpful when working with robotic projects. To enhance your debugging experience, use asynchronous links for time-sensitive design blocks like WaitForEvent. I also recommend debugging individual automation before testing the entire project. It's important to observe the application's state between re-runs, as unexpected states can lead to unexpected results. While debugging, pay attention to which UI elements are displayed and active and how data is propagated within the application. I hope this helps and that you have a better experience with Pega Robot Studio from now on. Good luck!


Pegasystems Inc.
PL
Hi, Running the automation in debugging mode can cause the problem here. Note that while stepping into each design block in debugging mode, the upstream logic of the WaitForEvent is not executed. Does the problem exist when automation runs at full speed?
Make sure the BankerInsight app is closed after each test.
Joanna


Arbetsformedlingen
SE
@adamj Hi, seem like you are experienced developer:) I live in Sweden where Pega Robotic hardly exist as a tool since most companies and governemntal institutions use other tools. The job-opportunities are therefoe very limited so I wonder if you have any suggestions?