SwitchToPrevWindow does not work in Control Tower

Hi Team,

I can run the process including “switchToPrevWindow” in WorkFusion Studio, but if I run it on the Control Tower, I get an error.

The first attempt will succeed, but the second will result in an error.
I tried “switchToRootWindow” or “window(”${window_name}")" instead of “switchToPrevWindow” but got the same error.

[My Program]

[Error log]

Caused by: org.webharvest.exception.PluginException: com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=CustomScriptAction.ftl,id=7,name=Optional[CustomScriptAction],parent=6,nextSibling=8,arguments=ActionArguments[delay=[3000],xsi:type=[recorder:CustomScriptAction, recorder:CustomScriptAction],name=[switchToPrevWindow],active=[true],actionDetails=[(switchToPrevWindow)],script=[@CustomScriptAction(
)

def customScript() {
switchToPrevWindow()
}]]]

Hi @aya could you please share your recording so we can reproduce the error from our side?

I was able to solve the problem myself.

The following procedure will fail.

  1. switchToNextWindow
  2. switchToPrevWindow
  3. switchToNextWindow -> Error occurred
  4. switchToPrevWindow

The following procedure will succeed.

  1. switchToLastWindow
  2. Close child window.
  3. switchToRootWindow
  4. switchToLastWindow
  5. Close child window.
  6. switchToRootWindow

I attach my recording of success and failure.
sample-failure-pattern.txt (3.6 KB)
sample-success-pattern.txt (4.2 KB)

Thanks,

1 Like

This solution isn’t working in my situation I’m afraid. The switchToRootWindow is marked as completed although no switch is executed, the following actions do not execute either. Can you advise?

Thanks

@peterht can you share your recording here?