Catching EdgeGetElementData errors

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
kdtrog
Junior Coder
Posts: 43
Joined: Wed Mar 28, 2007 9:36 am

Catching EdgeGetElementData errors

Post by kdtrog » Sun Jun 28, 2020 1:00 pm

I have a script which is running every 30 minutes to catch a specific status via MSEdge Webbrowser. Most of the time the compiled script is running well but once or twice a day the Execution crashes and leaves the browser window open. Via logfiles I located the problem within 3 EdgeGetElentData commands.

Code: Select all

EdgeFindElements>session_id,tag name,TD,elements4
      if>elements4_count>6
        EdgeGetElementData>session_id,elements4_3,text,r8
        EdgeGetElementData>session_id,elements4_5,text,r9
        EdgeGetElementData>session_id,elements4_7,text,r10
I guess the error is a http error (for any reason which I do not know). I tried to catch the error with an "onerror" statement but it is not working. Is there any chance to continue the script after this error occurs?

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

Re: Catching EdgeGetElementData errors

Post by Marcus Tettmar » Tue Jun 30, 2020 3:54 pm

Is the error in Edge, or Macro Scheduler? Have you got a screenshot? We can trap the latter, but may not be able to trap the former.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

kdtrog
Junior Coder
Posts: 43
Joined: Wed Mar 28, 2007 9:36 am

Re: Catching EdgeGetElementData errors

Post by kdtrog » Tue Jun 30, 2020 4:42 pm

The following eventlog entry is created (DAITEM.EXE is the compiled script)
Protokollname: Application
Quelle: Application Error
Datum: 30.06.2020 14:59:25
Ereignis-ID: 1000
Aufgabenkategorie:(100)
Ebene: Fehler
Schlüsselwörter:Klassisch
Benutzer: Nicht zutreffend
Computer: xxxxxxx
Beschreibung:
Name der fehlerhaften Anwendung: Daitem.exe, Version: 1.0.0.0, Zeitstempel: 0x5e6ac394
Name des fehlerhaften Moduls: KERNELBASE.dll, Version: 10.0.14393.3659, Zeitstempel: 0x5e9140ea
Ausnahmecode: 0x0eedfade
Fehleroffset: 0x000dc562
ID des fehlerhaften Prozesses: 0x2de4
Startzeit der fehlerhaften Anwendung: 0x01d64ede39074047
Pfad der fehlerhaften Anwendung: xxxxx\Daitem.exe
Pfad des fehlerhaften Moduls: C:\WINDOWS\System32\KERNELBASE.dll
Berichtskennung: 998363b5-573b-4a0b-b95f-fcb79e1ca513
Vollständiger Name des fehlerhaften Pakets:
Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
Ereignis-XML:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2020-06-30T12:59:25.213832000Z" />
<EventRecordID>75985</EventRecordID>
<Channel>Application</Channel>
<Computer>xxxxxx</Computer>
<Security />
</System>
<EventData>
<Data>Daitem.exe</Data>
<Data>1.0.0.0</Data>
<Data>5e6ac394</Data>
<Data>KERNELBASE.dll</Data>
<Data>10.0.14393.3659</Data>
<Data>5e9140ea</Data>
<Data>0eedfade</Data>
<Data>000dc562</Data>
<Data>2de4</Data>
<Data>01d64ede39074047</Data>
<Data>xxxxxxx\Daitem.exe</Data>
<Data>C:\WINDOWS\System32\KERNELBASE.dll</Data>
<Data>998363b5-573b-4a0b-b95f-fcb79e1ca513</Data>
<Data>
</Data>
<Data>
</Data>
</EventData>
</Event>

kdtrog
Junior Coder
Posts: 43
Joined: Wed Mar 28, 2007 9:36 am

Re: Catching EdgeGetElementData errors

Post by kdtrog » Sun Jul 05, 2020 9:40 am

I transferred the script to a Chrome version and it is running since 48 hours without any problem!

kdtrog
Junior Coder
Posts: 43
Joined: Wed Mar 28, 2007 9:36 am

Re: Catching EdgeGetElementData errors

Post by kdtrog » Fri Jul 17, 2020 12:28 pm

So no more replies... I guess this means MS Edge Chromium is not a good option to use with MS. :!:

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

Re: Catching EdgeGetElementData errors

Post by Marcus Tettmar » Fri Jul 17, 2020 1:28 pm

Sorry, I had said we would add better error trapping to these functions. We did. v15.0.010 was released last Monday:

https://help.mjtnet.com/article/222-version-history
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

kdtrog
Junior Coder
Posts: 43
Joined: Wed Mar 28, 2007 9:36 am

Re: Catching EdgeGetElementData errors

Post by kdtrog » Fri Jul 17, 2020 7:53 pm

Well, the following error was catched with the new version.
LAST_ERROR=(1:1) Unquoted string in JSON data only valid for dictionary names.

kdtrog
Junior Coder
Posts: 43
Joined: Wed Mar 28, 2007 9:36 am

Re: Catching EdgeGetElementData errors

Post by kdtrog » Mon Jul 20, 2020 12:01 pm

Hi Marcus. It would be nice to implement the catch function for Chromedriver as well. This is very helpful in the case that chrome browser window is closed manually during execution of script.

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

Re: Catching EdgeGetElementData errors

Post by Marcus Tettmar » Tue Jul 21, 2020 2:45 pm

It is. The same fix was applied to both the Chrome functions and Edge functions.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

kdtrog
Junior Coder
Posts: 43
Joined: Wed Mar 28, 2007 9:36 am

Re: Catching EdgeGetElementData errors

Post by kdtrog » Tue Jul 21, 2020 2:56 pm

I see that the ONERROR is called when the Edge Browser Window is closed during script execution but not when the Chrome Browser Window is closed. Here is a piece of my code.

Code: Select all

Let>ONERROR=MyErrorHandler
.....
if>chrome=true
  while>timeout>0
    ChromeFindElements>session_id,id,uiPass,elements
    if>elements_count>0
      ChromeSetElementValue>session_id,elements_1,%pw%
      ChromeFindElements>session_id,id,submitLoginBtn,elements
      ChromeElementAction>session_id,elements_1,click
    endif
    
    ChromeFindElements>session_id,id,uiVersion,elements
    if>elements_count>0
      gosub>TimeNow
      WriteLn>logfile,res,%stamp% %FB% Stop Page found
      goto>fastexit
    endif
    wait>10
  EndWhile
....
SRT>MyErrorHandler
  gosub>TimeNow
  WriteLn>logfile,res,%stamp% %FB% Browser Session cancelled
  exit
END>MyErrorHandler

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