chromedriver.exe once and for all

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: chromedriver.exe once and for all

Post by mightycpa » Fri Apr 16, 2021 7:02 pm

OK, our times are wildly different, I'll be back on tomorrow around 10AM, GMT +4 to check.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: chromedriver.exe once and for all

Post by Grovkillen » Sat Apr 17, 2021 4:39 pm

I've been thinking, could it be privileges causing the none communication with Chrome? You could perhaps compile a test exe yourself and test on a PC where you're sure to have full privileges.
Let>ME=%Script%

Running: 15.0.24
version history

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: chromedriver.exe once and for all

Post by mightycpa » Mon Apr 19, 2021 3:38 pm

Hi,

No, I'm running MS as administrator, and you'll also notice Chrome and chromedriver are launched by Admin user too.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: chromedriver.exe once and for all

Post by Grovkillen » Mon Apr 19, 2021 3:48 pm

Instead of head banging with the current PC, try a second one and see how that one is behaving. It's currently just a guessing game.
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Marcus Tettmar
Site Admin
Posts: 7376
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: chromedriver.exe once and for all

Post by Marcus Tettmar » Mon Apr 19, 2021 9:59 pm

The script is working fine for me.

I note also that the simple 3 line script is also failing. This would seem to suggest an issue with the Chrome setup. which version of Chrome are you running?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: chromedriver.exe once and for all

Post by mightycpa » Tue Apr 20, 2021 1:28 pm

Image
Image

Marcus, I understand how hard it is when you can't replicate a problem. I could create a login for you and let you on the machine. Want to try that?
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Marcus Tettmar
Site Admin
Posts: 7376
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: chromedriver.exe once and for all

Post by Marcus Tettmar » Mon Apr 26, 2021 11:38 am

Ok. PM me login details.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: chromedriver.exe once and for all

Post by mightycpa » Mon Apr 26, 2021 6:30 pm

details are there, thanks
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: chromedriver.exe once and for all

Post by mightycpa » Tue Apr 27, 2021 3:05 pm

Marcus, thanks very much for making that work, I very much appreciate your efforts to solve the issue. There are a couple things I wanted to bring to your attention:

1) I eliminated the chromedriver.exe popup by unchecking the box that said "run this dialog each time..."

2) I was looking through the script because I noticed that Chrome did not launch in a maximized window. I used the navigation icons to open the online help, and when Chrome started, it crashed. This was true regardless of whether I used the general help icon (black ? in yellow circle) or the contextual help icon. While new windows in that same crashed browser instance could open, all of them would crash too, even Chrome help and settings. It was the exact same behavior I noticed when I created this ticket. I mention this only because it seems to indicate a subtle incompatibility between your compiled code and Chrome, and I wonder if this also exists in the Chrome functions.

3) I was about to submit this ticket, but then I noticed something else. I ran the basic script again, the one where you open google.com, and it failed. The Chrome browser crashed again. A little trial and error reveals that these chrome scripts only work if chromedriver.exe is launched before the script is run. Also, it can't be just any chromedriver.exe that exists on the computer. It has to be either the one in the script folder, or the one in the MS15 program folder, even if the one I launch from another location is identical. Somehow, Chrome can tell the difference and it matters. Also, revisiting item #2 above, the editor HELP icons make the Chrome browser crash regardless of whether or not chromedriver is running, and no matter where it was launched from.

4) Experimenting a little further, I found that I didn't even need the CHROMEDRIVER commands. I could just run the script like this, as long as %SCRIPT_DIR%\chromedriver.exe was already running.

Code: Select all

//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1

//MessageModal>%SCRIPT_DIR%
//Let>CHROMEDRIVER_EXE=%SCRIPT_DIR%\chromedriver.exe
//Let>CHROMEDRIVER_PORT=9515
//Let>CHROMEDRIVER_OPTIONS=--start-maximized
//GetProcessIDs>chromedriver.exe,beforePIDs
ChromeStart>SessionID
GetProcessIDs>chromedriver.exe,PIDs

ChromeNavigate>SessionID,url,https://www.google.com
I suspect it's not supposed to behave like this. That said, even if it's a little finicky, you did get it working for me, so again, I appreciate that very much.

If you want, I've left the server running for you so you can see this behavior for yourself. I plan on shutting it down tomorrow, but if you'd like for me to leave it running longer, just PM me.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: chromedriver.exe once and for all

Post by mightycpa » Tue Apr 27, 2021 3:07 pm

Grovkillen,

I just wanted to say that script of yours is genius. Thank you for that.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Marcus Tettmar
Site Admin
Posts: 7376
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: chromedriver.exe once and for all

Post by Marcus Tettmar » Tue Apr 27, 2021 3:47 pm

I didn't actually do anything aside from note that initially chrome and chromedriver were not at the same version level. Once that was sorted the scripts just ran without modification.

It isn't normally necessary to run chromedriver.exe first as Macro Scheduler will start it anyway. I've not seen that anywhere else. I wondered if it was because you have set Macro Scheduler to run as admin but I just tried that here and everything continued to work as expected.

Also not seen issues before with opening the help links etc from the editor. Just tried that too - with Chrome as my default browser. Tried it when starting Macro Scheduler as admin as well. Tried it after starting a chromedriver script and before. Couldn't get anything to crash. Just opened up the help links just fine.

So, I'm afraid your issues are something of a mystery. But at least it seems you can now get the scripts running.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: chromedriver.exe once and for all

Post by mightycpa » Tue Apr 27, 2021 3:54 pm

Thanks for looking into it. I have to believe this has a lot to do with Windows Server (NT) vs. Windows desktop. I assume you're running the latter. I can live with the way it works for now.

Thanks again.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: chromedriver.exe once and for all

Post by Grovkillen » Wed Apr 28, 2021 6:11 am

mightycpa wrote:
Tue Apr 27, 2021 3:07 pm
Grovkillen,

I just wanted to say that script of yours is genius. Thank you for that.
Glad to have helped.
Let>ME=%Script%

Running: 15.0.24
version history

GOLDENARMOR
Newbie
Posts: 2
Joined: Fri May 21, 2021 2:16 am

Re: chromedriver.exe once and for all

Post by GOLDENARMOR » Fri May 21, 2021 2:30 am

Nice script, haven't run it yet but looks good, going to try to learn this program looks cool :D

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: chromedriver.exe once and for all

Post by Grovkillen » Wed Jun 02, 2021 7:44 pm

The page stays blank issue could be related to the fact that some sites block the connection if they detect a automation tool (chromedriver in this case).
Let>ME=%Script%

Running: 15.0.24
version history

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