ChromeFindElements error

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

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

ChromeFindElements error

Post by mightycpa » Mon Mar 01, 2021 6:30 pm

Using MS 15.0.13, everything is pretty new, including me. I'm new at this Chrome thing.

That said, my code is pretty straightforward:

Code: Select all

Let>CHROMEDRIVER_EXE=c:\chromedriver.exe
Let>CHROMEDRIVER_OPTIONS=--start-maximized
//start a Chrome session
ChromeStart>session_id

//navigate, doesn't actually open a browser
ChromeNavigate>session_id,url,https://www.textnow.com/messaging

//then I get my error:
ChromeFindElements>session_id,class name," json-conversation-name",v_name

//nothing returned
MessageModal>%v_name%
Doesn't get any farther than ChromeFindElements:
LAST_ERROR=(1:1) Unquoted string in JSON data only valid for dictionary names.
The element name on the page does have the space in front of it, I've tried with and without quotes, with and without the space. Also tried span.json-conversation-name. None of that seems to make a difference. Version History also doesn't seem to address.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

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

Re: ChromeFindElements error

Post by Dorian (MJT support) » Mon Mar 01, 2021 6:57 pm

This article should help.

Then see if you can just run this very simple code.

Code: Select all

let>TheURL=https://www.mjtnet.com
Let>CHROMEDRIVER_EXE=c:\chromedriver.exe
ChromeStart>session_id
ChromeNavigate>session_id,url,%TheURL%
Yes, we have a Custom Scripting Service. Message me or go here

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

Re: ChromeFindElements error

Post by mightycpa » Mon Mar 01, 2021 7:20 pm

Help Scout? Do I need to create an account first?

UPDATE: I have no intention of opening an account with whatever that website is, so I don't think it's right to ask them for a free trial. Is there any way you can post the article elsewhere?
Last edited by mightycpa on Mon Mar 01, 2021 7:41 pm, edited 1 time in total.
"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: ChromeFindElements error

Post by mightycpa » Mon Mar 01, 2021 7:39 pm

I can RUN it, yes.

It doesn't open a window or anything, but it runs without complaint.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

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

Re: ChromeFindElements error

Post by Dorian (MJT support) » Mon Mar 01, 2021 8:00 pm

Apologies, that was my internal link. I have edited it now. This is the one you need.
Yes, we have a Custom Scripting Service. Message me or go here

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

Re: ChromeFindElements error

Post by mightycpa » Mon Mar 01, 2021 9:54 pm

There is only one chromedriver.exe on my computer.

Part1:
Using Task Manager, I kill the single chromedriver process, then run the exe. Running manually, I get version 88.0.4324.96 on port 9515, and a message in the DOS window that it was started successfully. Then I shut it down by killing the process.

Part2:
I step through the code you gave me, and the very first time, I got a launched Chrome window that navigated to a page entitled "data." A message in the browser told me it was being controlled by an external program. That was as far as it got. Eventually, I closed the window.

I have since tried to repeat the experiment, but in Part 2, I cannot see that window launch again. If I kill the process first, Chromedriver launches as a process upon execution of the ChromeStart command. A session_id is immediately generated. A rapid launch of something, like a flash, launches after the ChromeStart step... I assume that is Chrome, but it is too fast for me to say for sure. A chrome process launches momentarily, then it closes. Nothing really happens as a result of the navigate.

Part3: I run the program manually again, except this time, I run Part 2 without killing the process first. No difference.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

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

Re: ChromeFindElements error

Post by Marcus Tettmar » Tue Mar 02, 2021 6:14 pm

mightycpa wrote:
Mon Mar 01, 2021 6:30 pm

ChromeFindElements>session_id,class name," json-conversation-name",v_name
Take the quotes out:

ChromeFindElements>session_id,class name, json-conversation-name,v_name

And are you sure you need that leading space? Try with and without.
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: ChromeFindElements error

Post by mightycpa » Tue Mar 02, 2021 7:23 pm

From the original post:
The element name on the page does have the space in front of it, I've tried with and without quotes, with and without the space. Also tried span.json-conversation-name. None of that seems to make a difference. Version History also doesn't seem to address.
I don't think we're there yet.

I can't even get it to do something with https://mjtnet.com
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

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