Window controls in browser not working

browser
window-control

#1

Hi guys,

I just started using Workfusion to automate some tasks at work. One problem I can’t seem to solve is when I want to switch to my browser (previously opened window) then I can’t seem to use any actions.

The error I get indicates that my browser is not focused (can’t find elements). How can I solve this in Workfusion?

i’m sorry if this is not the correct place for such questions. Feel free to point me in the right way if so.

Thank you in advance,

Thibault


#2

@Thibaultmarrannes it looks like you use Window controls on a web page. They work with parts of windows applications, and don’t work inside web pages
https://kb.workfusion.com/display/RPAe/Mouse#Mouse-WindowControlWindowcontrol

You can use images instead of window controls, or better use special Web actions when working with browsers.
https://kb.workfusion.com/display/RPAe/Web


#3

Hi!

Thank you for the quick response I was working with both windowcontrols and web actions. I had to use windowscontrols to select a file from a filebrowser. When I tried to make the switch back to using webactions after selecting the file then I couldn’t focus my browser and/or find the right xpath elements.


#4

@Thibaultmarrannes did you switch back to browser using Switch to Browser action?


#5

Yes I did! But that still didn’t make it possible to use web actions.


#6

Can you share the error text and the screenshot of the action that fails?


#7

Explanation of the flow:

step 1-8 is logging in in the drupal website.
step 10-11 is clicking on a “file upload” button in the backend.

this opens a new chrome page with a file browser.

Step 12 is switching to this new file browser window
Step 13-18 is selecting the image to upload and clicking ‘upload’

Clicking on upload closes the chrome window and fills in the image in the original drupal page.

Step 19 tries to switch back to the original page (I’ve tried this with the window actions as well)

Step 20-24 clicks on the upload button (didn’t work so it tabs to it and presses enter).

It fails at step 20.

This is the process:
image

This is the most important part of the error:

Caused by: org.openqa.selenium.WebDriverException: Element ‘//*[@id=“edit-body-und-0-format–2”]’ doesn’t exist on the window ‘[HANDLE:6096718]’ ‘[CLASS:#32770;TITLE:Open]’. DesktopWindow

CLASS:#32770;TITLE:Open is the file upload window.


#8

@Thibaultmarrannes please share the screenshot of step 20


#9

Hi!

I’ve now seen that I made a mistake on step 20. I had the target as a Window control instead of a web element.

I fixed this and now it breaks on step 21.

This is step 21:

and this is the error:

Error executing KeyboardAction
com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=KeyboardAction.ftl,id=21,name=Optional[KeyboardAction],parent=19,nextSibling=22,arguments=ActionArguments[keyCode=[15],delay=[0],keyLocation=[1],xsi:type=[recorder:KeyboardAction, recorder:KeyboardAction],keyChar=[9],pollingInterval=[300],active=[true],actionDetails=[({TAB})],text=[{TAB}],rawCode=[9],awaitTimeout=[5000]]]
at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:54)
at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:28)
at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:15)
at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:64)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:152)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:112)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.openqa.selenium.NoSuchElementException: Element “” doesn’t exist on the window ‘com.workfusion.autoit.driver.DesktopWindow@43cc3e19’.

Thank you for all the quick responses :slight_smile:


#10

Could you share your recording file to have a look?


#11

There you go:

test.zip (2.2 KB)

Seems like I can use mouse clicks without a problem, so the window is focussed. the enter keystrokes action doesn’t work.


#12

Thank you. Could you also send rpa logs from C:\RPAExpress\RPA\logs ?


#13

here they are:

logs.rar (349.9 KB)


#14

Thank you @Thibaultmarrannes
We’ll study the logs and get back to you shortly.


#15

Thank you @ashapkina

Looking forward to the response, this proof of concept could really prove the use of RPA at my company :slight_smile:

Kind regards,

Thibault


#16

@Thibaultmarrannes I managed to reproduce this issue.

When you switch to browser, all web actions work correctly in the browser, but the focus of keystrokes stays on a desktop window.

We are planning to improve the work of Switch to browser action in the future. For now, please use this workaround:

  • before you use Switch to browser, use a Window action to switch to the browser window on the desktop:

This way the keystrokes will work int he browser.

Hope it helps :slightly_smiling_face:


#17

I will try it out right now and get back to you!

thank you for the thorough support.

Thibault


#18

Works like a charm :slight_smile: