Selenium.Serializer.JsonException: Object of type __ComObject is not serializable

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ovidiugabriel
Posts: 9
Joined: 22 Jul 2018, 14:19

Selenium.Serializer.JsonException: Object of type __ComObject is not serializable

08 Nov 2020, 14:46

Hello,

I have the following error while calling Selenium function SetCapability from Autohotkey

Code: Select all

Error: 0x80131500 -
Source:      Selenium
Description: Selenium.Serializer.JsonException
Line 190 in JSON.cs
Object of type __ComObject is not serializable
HelpFile:    (null)
Helpcontext: 0

Specifically: Get

Line #
015: driver := ComObjCreate("Selenium.ChromeDriver")
018: driver.SetCapability("debuggerAddress", "127.0.0.1:9222")
021: userAgent := "Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Mobile Safari/537.36"
022: deviceMetrics := {width: 360
    , height: 640
    , pixelRatio: 3
    , touch: true }
027: driver.SetCapability("mobileEmulation", {deviceName: "iPhone 6/7/8 Plus"
    , deviceMetrics: deviceMetrics
    , userAgent: userAgent})
031: driver.Get("...")  ;; Broken Link for safety
Please tell me if you have any idea how can I solve this or what can be the root cause.
Thanks!
Last edited by ovidiugabriel on 08 Nov 2020, 16:50, edited 1 time in total.
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Selenium.Serializer.JsonException: Object of type __ComObject is not serializable

08 Nov 2020, 14:55

Missing closing )
Try fixing that 1st

Code: Select all

driver.SetCapability("mobileEmulation", {deviceName: "iPhone 6/7/8 Plus"
    , deviceMetrics: deviceMetrics
    , userAgent: userAgent})    ; <----------
HTH
ovidiugabriel
Posts: 9
Joined: 22 Jul 2018, 14:19

Re: Selenium.Serializer.JsonException: Object of type __ComObject is not serializable

08 Nov 2020, 16:51

Actually the code already has that paren'.
Sorry, it was a mistake when I pasted the code on the forum.
Xtra wrote:
08 Nov 2020, 14:55
Missing closing )
Try fixing that 1st
ovidiugabriel
Posts: 9
Joined: 22 Jul 2018, 14:19

Re: Selenium.Serializer.JsonException: Object of type __ComObject is not serializable

11 Nov 2020, 13:56

@Xtra Do you have any idea where is the git repo where I can see Line 190 in JSON.cs ?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: apeironn, Bing [Bot], bobstoner289, Google [Bot], JnLlnd and 217 guests