Jump to content

Problem with CHROMEDRIVER


Recommended Posts

When i launch chrome in automation all is good but when i want to execute the following command 


_ChromeSetInputValueById($sSession,'username','xxx')

I have an error and the field is not filled

here is the script log 

_WDStartup: OS:    WIN_10 WIN32_NT 18362 
_WDStartup: AutoIt:    3.3.14.5
_WDStartup: WD.au3:    0.1.0.21
_WDStartup: Driver:    chromedriver.exe
_WDStartup: Params:    --log-path="C:\ChromeDriver\chrome.log"
_WDStartup: Port:    9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"unhandledPromptBehavior": "ignore", "goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false, "args": ["start-maximized"] }}}}
__WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a)","userDataDir":"C:\\Users\\Patrick\\AppData\\Local\\Temp\\scoped_dir14104_27300"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:50761"},"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platform":"Windows NT","rotatable":false,"setWindowRect":true,"takesHeapSnapshot":true,"takesScreenshot":true,"unhandledPromptBehavior":"ignore","version":"78.0.3904.87","webStorageEnabled":true},"sessionId":"0e6f4e99d9b67fc4753ed69a5c44b948"}}
_WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a)","userDataDir":"C:\\Users\\Patrick\\AppData\\Local\\Temp\\scoped_dir14104_27300"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:50761"},"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platform":"Windows NT","rotatable":false,"setWindowRect":true,"takesHeapSnapshot":true,"takesScreenshot":true,"unhandledPromptBehavior":"ignore","version":"78.0.3904.87","webStorageEnabled":true},"sessionId":"0e6f4e99d9b67fc4753ed69a5c44b948"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/0e6f4e99d9b67fc4753ed69a5c44b948/url; $sData={"url":"https://iso20022test.credit-suisse.com/?locale=fr"}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_Navigate: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/0e6f4e99d9b67fc4753ed69a5c44b948/element; $sData={"using":"xpath","value":"//input[@id='username']"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"57ba94db-555b-4bc4-b82e-5913c177538d"}}
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"57ba94db-555b-4bc4-b82e-5913c177538d"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/0e6f4e99d9b67fc4753ed69a5c44b948/element/57ba94db-555b-4bc4-b82e-5913c177538d/value; $sData={"id":"57ba94db-555b-4bc4-b82e-5913c177538d", "text":"xxxx"}
__WD_Post: StatusCode=500; ResponseText={"value":{"error":"unknown error","message":"'value' must be a list(Session infochrome=78.0.3904.87)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00393CF0+867568]\n\tOrdinal0 [0x0033DB7D+514941]\n\tOrdinal0 [0x0030B367+308071]\n\tOrdinal0 [0x002D6871+92273]\n\tOrdinal0 [0x002EAE8D+175757]\n\tOrdinal0 [0x002D5808+88072]\n\tOrdinal0 [0x002EB111+176401]\n\tOrdinal0 [0x002F278D+206733]\n\tOrdinal0 [0x002EAD2B+175403]\n\tOrdinal0 [0x002D3740+79680]\n\tOrdinal0 [0x002D4CFC+85244]\n\tOrdinal0 [0x002D4C50+85072]\n\tOrdinal0 [0x0039E62A+910890]\n\tOrdinal0 [0x00348993+559507]\n\tOrdinal0 [0x00348BA3+560035]\n\tOrdinal0 [0x00348C8C+560268]\n\tOrdinal0 [0x003A1907+923911]\n\tOrdinal0 [0x003487FF+559103]\n\tOrdinal0 [0x0035306E+602222]\n\tOrdinal0 [0x0035EA3B+649787]\n\tOrdinal0 [0x0035EBA5+650149]\n\tOrdinal0 [0x0035DDA5+646565]\n\tBaseThreadInitThunk [0x75306359+25]\n\tRtlGetAppContainerNamedObjectPath [0x776B7B74+228]\n\tRtlGetAppContainerNamedObjectPath [0x776B7B44+180]\n"}}
_WD_ElementAction: {"value":{"error":"unknown error","message":"'value' must be a list(Session infochrome=78.0.3904.87)...
_WD_ElementAction ==> Webdriver Exception: {"value":{"error":"unknown error","message":"'value' must be a list(Session infochrome=78.0.3904.87)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00393CF0+867568]\n\tOrdinal0 [0x0033DB7D+514941]\n\tOrdinal0 [0x0030B367+308071]\n\tOrdinal0 [0x002D6871+92273]\n\tOrdinal0 [0x002EAE8D+175757]\n\tOrdinal0 [0x002D5808+88072]\n\tOrdinal0 [0x002EB111+176401]\n\tOrdinal0 [0x002F278D+206733]\n\tOrdinal0 [0x002EAD2B+175403]\n\tOrdinal0 [0x002D3740+79680]\n\tOrdinal0 [0x002D4CFC+85244]\n\tOrdinal0 [0x002D4C50+85072]\n\tOrdinal0 [0x0039E62A+910890]\n\tOrdinal0 [0x00348993+559507]\n\tOrdinal0 [0x00348BA3+560035]\n\tOrdinal0 [0x00348C8C+560268]\n\tOrdinal0 [0x003A1907+923911]\n\tOrdinal0 [0x003487FF+559103]\n\tOrdinal0 [0x0035306E+602222]\n\tOrdinal0 [0x0035EA3B+649787]\n\tOrdinal0 [0x0035EBA5+650149]\n\tOrdinal0 [0x0035DDA5+646565]\n\tBaseThreadInitThunk [0x75306359+25]\n\tRtlGetAppContainerNamedObjectPath [0x776B7B74+228]\n\tRtlGetAppContainerNamedObjectPath [0x776B7B44+180]\n"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/0e6f4e99d9b67fc4753ed69a5c44b948/element; $sData={"using":"xpath","value":"//input[@id='password']"}

Ca someone have the same problem ?

Link to comment
Share on other sites

Here is my code, i just changed password and username 

Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_x64=toto.exe
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_Language=1036
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include "wd_core.au3"
#include "wd_helper.au3"
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <StringConstants.au3>


Local $sDesiredCapabilities, $sSession
SetupChrome()
;SetupEdge()

_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "https://iso20022test.credit-suisse.com/?locale=fr")


_ChromeSetInputValueById($sSession,'username','xxx')
_ChromeSetInputValueById($sSession,'password','xxx#')


$sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@id='action.login']")
    _WD_ElementAction($sSession, $sButton, 'click')    ;
    Sleep(2000)

_WD_DeleteSession($sSession)

_WD_Shutdown()

Func SetupChrome()
    _WD_Option('Driver', 'chromedriver.exe')
    _WD_Option('Port', 9515)
    _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')

  $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"unhandledPromptBehavior": "ignore", "goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false, "prefs": {"credentials_enable_service": false}, "args": ["start-maximized"] }}}}'

EndFunc   ;==>SetupChrome

Func _ChromeSetInputValueById($sSession,$Id,$Value)
 $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$Id&"']")
 _WD_ElementAction($sSession,$sButton,'value', $Value)
EndFunc


Func _ChromeSetInputValueByName($sSession,$Id,$Value)
 $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='"&$Id&"']")
 _WD_ElementAction($sSession,$sButton,'value', $Value)
EndFunc

Fxit 

 

Link to comment
Share on other sites

Hi,

II download the new version and it's working well.

I have another problem with

Quote

 "prefs":"credentials_enable_service": false,

I wan' to avoid the box who propose to record password and username  with   

Quote

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"unhandledPromptBehavior": "ignore", "goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false, "prefs":"credentials_enable_service": false, "args": ["start-maximized"] }}}}'

But the system refuse the command 

THanks a lot for helping me

Link to comment
Share on other sites

You've posted several different variations of the "prefs" option. You left out the curly brackets in the most recent one, so I suspect that is the current issue. Next time please provide more details beyond "refuse the command". 😏

P.S. Looks like you may need to set an additional option. See here for details.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...