Jump to content

Invalid argument


 Share

Recommended Posts

Hi - I am trying to apply an example i saw and do not see the error of my ways...
I see the DOS command box come up and go away, and no browser window opens as well.
The object is to open up the url for a login and enter username and password ( which in this case is not revealed)
but i never get that far ...

Here is what i have,  topmost messages from console follows ;

#include "wd_core.au3"
#include "wd_helper.au3"

Local $sDesiredCapailities, $sSession
SetupChrome()


_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapailities)
_WD_Navigate ($sSession, "")
_ChromeSetInputValueById($sSession,'luser','abc')
_ChromeSetInputValueById ($sSession, 'lpass', 'xyz')




_WD_Shutdown()

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

     $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized", "disable-infobars"]}}}}'
    ; _WD_Window($sSession, "Maximize")
EndFunc

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

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Ed\Documents\autoit-scripts\script-for-chrome.au3" /UserParams    
+>13:07:41 Starting AutoIt3Wrapper (19.1127.1402.0} from:SciTE.exe (4.2.0.0)  Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\Ed\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\Ed\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Ed\Documents\autoit-scripts\script-for-chrome.au3
+>13:07:42 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Ed\Documents\autoit-scripts\script-for-chrome.au3"    
+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop.
_WD_IsLatestRelease: True
_WD_IsLatestRelease ==> Success
_WDStartup: OS:    WIN_10 WIN32_NT 18363 
_WDStartup: AutoIt:    3.3.14.5
_WDStartup: WD.au3:    0.3.0.8 (Up to date)
_WDStartup: WinHTTP:    1.6.4.2
_WDStartup: Driver:    chromedriver.exe
_WDStartup: Params:    --log-path=C:\Users\Ed\Documents\autoit-scripts\chrome.log
_WDStartup: Port:    9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData=
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stack...
__WD_Post ==> Invalid argument: {"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stacktrace":"Backtrace:\n\tOrdinal0 [0x006FD383+3134339]\n\tOrdinal0 [0x005EA171+2007409]\n\tOrdinal0 [0x0048AEE8+569064]\n\tOrdinal0 [0x0042D398+185240]\n\tOrdinal0 [0x0042CF0A+184074]\n\tOrdinal0 [0x00401FD7+8151]\n\tOrdinal0 [0x00402496+9366]\n\tOrdinal0 [0x00402B40+11072]\n\tOrdinal0 [0x00600CD9+2100441]\n\tGetHandleVerifier [0x0086B75A+1396954]\n\tGetHandleVerifier [0x0086B3D9+1396057]\n\tGetHandleVerifier [0x00877126+1444518]\n\tGetHandleVerifier [0x0086BCE8+1398376]\n\tOrdinal0 [0x005F7F51+2064209]\n\tOrdinal0 [0x00401D35+7477]\n\tOrdinal0 [0x00401991+6545]\n\tGetHandleVerifier [0x00A3F31C+3312796]\n\tBaseThreadInitThunk [0x761B6359+25]\n\tRtlGetAppContainerNamedObjectPath [0x77E87C24+228]\n\tRtlGetAppContainerNamedObjectPath [0x77E87BF4+180]\n"}}
_WD_CreateSession: {"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stacktrace":"Backtrace:\n\tOrdinal0 [0x006FD383+3134339]\n\tOrdinal0 [0x005EA171+2007409]\n\tOrdinal0 [0x0048AEE8+569064]\n\tOrdinal0 [0x0042D398+185240]\n\tOrdinal0 [0x0042CF0A+184074]\n\tOrdinal0 [0x00401FD7+8151]\n\tOrdinal0 [0x00402496+9366]\n\tOrdinal0 [0x00402B40+11072]\n\tOrdinal0 [0x00600CD9+2100441]\n\tGetHandleVerifier [0x0086B75A+1396954]\n\tGetHandleVerifier [0x0086B3D9+1396057]\n\tGetHandleVerifier [0x00877126+1444518]\n\tGetHandleVerifier [0x0086BCE8+1398376]\n\tOrdinal0 [0x005F7F51+2064209]\n\tOrdinal0 [0x00401D35+7477]\n\tOrdinal0 [0x00401991+6545]\n\tGetHandleVerifier [0x00A3F31C+3312796]\n\tBaseThreadInitThunk [0x761B6359+25]\n\tRtlGetAppContainerNamedObjectPath [0x77E87C24+228]\n\tRtlGetAppContainerNamedObjectPath [0x77E87BF4+180]\n"}}
_WD_CreateSession ==> Webdriver Exception: HTTP status = 400
 

Link to comment
Share on other sites

33 minutes ago, edrosenthal said:

$sDesiredCapailities

Sometimes you can't see the forest from the trees. 😜

PS. In case you still can't see it, $sDesiredCapailities is different from $sDesiredCapabilities

PPS. I don't like this _ChromeSetInputValueById  function because it doesn't perform any error checking. You should look into alternatives or fix the function

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...