Power Automate: Using "Wait for image" and "Extract text with OCR" in unattended mode possible? - power-automate

I want to automate a Webswing session to run in unattended mode. Webswing is a web server that allows applications to run within the web browser. So there is no access to UI elements that the bot could access.
Therefore, I initially worked with image recognition (e.g., using the "Wait for image" and "Extract text with OCR" actions) in attended mode. Now I would like to switch to unattended mode. Does anyone have experience with this and know if the image recognition actions in a session like Webswing can be applied to unattended robots or are there other commands I can use for this use case?

Yes, however it is worth keeping in mind that the screen size needs to be set to the size you run the flow in when attended.
See: how to set screen resolution unattended mode

Related

How to detect whether Google sheet script runs on mobile or not?

Is there a way how a script (bound to a Google sheet) can detect whether it is run on PC or on mobile?
The background to my question is that on a PC the class ui works. Therefore, prompts and alerts windows can be shown, and user input can be requested and processed, etc. On mobile, this is not possible. If the code can detect that it runs on mobile, then all user prompts can be avoided through simple if ( not run on mobile ) { } clauses.
Thank you very much!
At the moment, there is no possible way to detect if the script execution has been triggered by the desktop web UI or by a smartphone.
As a workaround, you can try using a try...catch block around the code that prompts the user. If an exception is caught - it is because the code is being executed from a context that does not support prompting the user (i.e. from a smartphone) and this situation can be handled afterwards.

Running Internet Explorer on LocalSystem Account on Windows 2012

I'm setting up Selenium Grid. We have a separate machine for each version of the browser.
Each node is started as System Service running on LocalSystem account with interactions with user desktop enabled.
This is required because Selenium Grid node starting Internet Explorer have problems making screenshots and transferring them when there was no interaction with user desktop.
As far as I was able to check, it looks like that interactions with user desktop for service are only allowed for LocalSystem account. Event changing manually flags in registry does not seem to works (as it was in windows 2008)
Everything is working fine except the test where I need to perform upload of the file. When there is an action to open dialog for file browsing, following popup appears
Is there any way to prevent this (creation of folder Desktop does not seem to work) ?
From the other hand, if there is a way to run service under different account with interactions with user desktop enabled, that would also be a case.
I would appreciate any help because I'm stuck with the problem
I have checked some additional solutions, like running selenium grid nodes via PowerShell Invoke-Command and this did not worked too.
I have managed to run selenium grid nodes as Windows Service with desktop interactions using 3rd party tool FireDaemon Pro Service Manager.
I didn't try this but PsExec -s should work
https://technet.microsoft.com/en-us/sysinternals/bb897553

Keep windows GUI while switching windows user or closing remote connection

I need to run a GUI script (AutoHotKey, which makes mouse clicks and press keys) on:
A different windows user (i.e. I run the script, then switch user
while keeping the session active)
A remote Amazon windows server (using remote desktop) where I also
run the script then close the Remote Desktop while keeping the
instance running
Unfortunately, in both cases, the script doesn't run as it seems that Windows enters a "GUI-less" mode where all GUI components are not active anymore.
Is there any solution to this?
Any hint would be greatly appreciated as I've now lost days trying to solve this!
Many thanks, Thomas
I do not believe this is possible due to the way Remote Desktop is implemented. When you close the RD connection, the GUI is no longer drawn. Therefore, AutoHotkey is unable to perform mouse clicks and key presses.
A possible workaround would be to make some registry tweaks (if possible on your server) which allow GUI interaction while minimized.
Locate HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
Create RemoteDesktop SuppressWhenMinimized as DWORD with a value of 2
Registry Tweak Source

Selenium grid 2 over cygwin

Ok, this is a tricky one. I'm trying to set up a Selenium Grid 2 with some Windows 7 VMs to run Webdriver tests. To automatize the whole process I use some ant script that connects to the VMs through ssh to start/stop/reconfigure the nodes.
Everything works great, the nodes can register with the hub host and execute the test. Only problem is that I don't see any browser window during the test run. I can see the process and I see the test log being executed, but there is no graphical interface.
On the other hand, if I start the node manually through Windows, everything is normal.
I suppose the problem is that processes executed under cygwin cannot start Windows displays, but in that case, shouldn't throw an error? The other option I'm thinking is that Webdriver is using HTMLunit as a fallback, but then... why do I see the firefox process as long as the test lasts and consuming CPU and memory?
Through ssh, you only exchange with Windows stdin, stdout and stderr streams. The ssh connection is tunneling those streams and nothing else. You don't see Windows Desktop interface, but the Desktop object exists on the Windows machine, the programs (here the browsers) are connected to it, and all GUI interactions are live in there.
If the GUI doesn't require any user interaction, everything is fine that way. The dialog boxes are created, the program runs, once it finishes, the dialog boxes are destroyed by the application and the application closes. Nothing is blocking in terms of GUI our application.
If you program requires an user action in the created yet invisible dialog boxes, your program will be there waiting for your interaction to move forward. You will see the process in the task manager, doing nothing but waiting. As you don't have access to the Windows Desktop where the dialog boxes are created and virtually 'displayed', the program seems to hang.
A typical case 2 is if you remote run a program waiting for a user to do something, say notepad. You can launch notepad, it will be spawned and then it will wait for you to type some text or close it.
With your Selenium tests, you are in case 1: all the browsers' interactions needed to make the GUI working are actually done by Selenium server that does the navigation clicks and the program exit for you. Their GUI actually are living by browsing through your test web servers, you just don't see it.
Some further readings from Microsoft website on Desktops and Desktop Creation.
If you want to see the tests and have valid screenshots, you need to have a user logged in and those tests need to run as that user. Everything must run through that single desktop session, so you cannot use RDP to remotely connect to the machine. Your best bet is to use VNC, since that will connect to an already established session.

How to switch from foreground application to background agent?

I'd like to know if it is possible to switch from foreground app to background agent and vice-versa sharing some data from these two tasks?
More in deep I'd like to do an upload that starts from foreground (Fig. A) and when the user pushes back button the upload continues with background agent (Fig. B).
Image is here: http://imageshack.us/f/823/testter.jpg/
Background file transfer is what you need. It can upload (and download) files while the application is not running:
With Windows Phone OS 7.1, applications are able to queue up one or
more file uploads or downloads over HTTP that will be executed in the
background, even when the application is no longer running in the
foreground. The APIs used for initiating file transfers should be used
to query the status existing transfers and provide progress indicators
for the end user.
You do realize that you can't update the tile constantly from a PeriodicTask right? The minimum refresh time is 30 minutes, unless you do push notifications (which I here, assume you won't, since it's a client-side operation).
And the tile itself doesn't make much sense. And I don't think using a task that can maximum run for 25 seconds makes a aweful lot of sense either for uploading a file.
So I guess we can conclude that it'll not be possible to do this. Instead , you should allow the application to run in the background, by setting the ApplicationIdleDetectionMode to Disabled
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetecetionMode.Diabled"
Then the user can press the Home button, and the download will progress in the background.

Resources