WindowAction not always minimizing

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ocnuybear
Pro Scripter
Posts: 100
Joined: Sun Jul 15, 2018 5:14 pm

WindowAction not always minimizing

Post by ocnuybear » Wed Feb 02, 2022 8:34 am

Hi there,

Want to automate Chrome & chromedriver is started first, but needs the the chromedriver.exe cmd window to be minimized in the background.

Code: Select all

ProcessExists>chromedriver.exe,bDriverExists
If>bDriverExists=False
  Run>c:\chromedriver.exe
  WindowAction>2,C:\chromedriver.exe
Endif
Have checked there is only one instance of chromedriver running in task manager as well as restarted MS

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1350
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: WindowAction not always minimizing

Post by Dorian (MJT support) » Wed Feb 02, 2022 9:30 am

I had the same results, which is odd as the window title seems correct. I had the same results even if i used a wildcard. But if I wait for the window to open, set focus, wait for focus and then get active window, it seems to correctly minimize 100% of the time. N.B it was successful whether I used an upper or lower case c for C:\

Code: Select all

ProcessExists>chromedriver.exe,bDriverExists
If>bDriverExists=False
  Run>c:\chromedriver.exe
  WaitWindowOpen>c:\chro*
  SetFocus>c:\chro*
  WaitWindowFocused>c:\chro*
  GetActiveWindow>WT,XX,YY,WW,HH
  WindowAction>2,%WT%
Endif
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts