samibb Posted October 19, 2024 Posted October 19, 2024 @Danp2 good day i am using #Region wd_capabilities.au3 - UDF Header ; #INDEX# ======================================================================== ; Title .........: wd_capabilities.au3 ; AutoIt Version : v3.3.14.5 ; Language ......: English ; Description ...: A collection of functions used to dynamically build the Capabilities string (JSON formatted) required to create a WebDriver session ; Author ........: mLipok ; Modified ......: Danp2 ; URL ...........: https://www.autoitscript.com/wiki/WebDriver_Capabilities ; Date ..........: 2022/07/27 ; ================================================================================
Danp2 Posted October 19, 2024 Posted October 19, 2024 That doesn't really help because the date in the header hasn't been updated in two years. The "debuggerAddress" functionality was added since then, so you need to make sure that -- you are using the latest release of the UDF including all of the associated files such as wd_helper.au3, wd_capabilities.au3, etc. you dont have an older copy of these files somewhere that are being accessed instead of the latest versions The bottom line is that you have a configuration issue on your end if you can't successfully run the following line without errors -- _WD_CapabilitiesAdd("debuggerAddress","localhost:9222") Latest Webdriver UDF Release Webdriver Wiki FAQs
samibb Posted October 19, 2024 Author Posted October 19, 2024 i have an older UDF, but it works with version chrome 124 32&64 bit. when i insert this line _WD_CapabilitiesAdd("debuggerAddress","localhost:9222") I've empty session ID. this is my previous code: Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"debuggerAddress": "localhost:9222"}}}}' ;MsgBox(0,'',$sDesiredCapabilities) EndFunc the probleme is with not with chrome 130 . nwd_helper.au3 Copyright (c) 2023 Dan Pollak (@Danp2) wd_capabilities.au3 v3.3.14.5 wd_code.au3 Copyright (c) 2023 Dan Pollak (@Danp2) wd_cdp.au3 Copyright (c) 2023 Dan Pollak WinHttpConstants.au3 Copyright 2013 Dragana R. <trancexx at yahoo dot com> Licensed under the Apache License, Version 2.0 (the "License"); WinHttp.au3: File Version.........: 1.6.4.2 ; Min. AutoIt Version..: v3.3.7.20 ; Description .........: AutoIt wrapper for WinHTTP functions ; Author... ...........: trancexx, ProgAndy ; Dll .................: winhttp.dll, kernel32.dll Json.au3 (2021.11.20)
Danp2 Posted October 19, 2024 Posted October 19, 2024 A few key points that I would like you to consider -- I can't speak for others, but I'm not able or willing to provide assistance if you can't stay up-to-date with the latest version of the Webdriver UDF. Similarly, it isn't possible to provide support for older versions of browsers. If it is working with the latest version of Chrome, then it's likely that the problem existed in the older version of Chrome but has been fixed since then by the Chrome developers. I suggest that you read this website. This isn't just directed at you; it's a common issue where people don't take the time to ask the correct question, explain the solution they are actually trying to solve, provide the necessary details, etc. I'm happy to try to assist you further If you do the following -- post a simple script that we can actually run to observe the problem it must utilize the latest version of the Webdriver UDF it must utilize a more recent browser version TheXman and SOLVE-SMART 1 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
Solution samibb Posted October 21, 2024 Author Solution Posted October 21, 2024 (edited) Dear @DANP2 THANK YOU VERY MUTCH IT WORKS KNOW. I WANT TO SHARE MY SETUP CHROME CODE FOR ALL . Func SetupChrome() If Number(StringLeft(_WD_GetBrowserVersion('CHROME'),3)) < 126 Then _WD_Option('Driver', 'chromedriver.exe') Local $IPORT = _WD_GETFREEPORT(9515,5600) _WD_Option('Port',$IPORT) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"debuggerAddress": "localhost:9222"}}}}' EndIf If Number(StringLeft(_WD_GetBrowserVersion('CHROME'),3)) > 125 Then _WD_Option('Driver', 'chromedriver.exe') Local $iPort = _WD_GetFreePort(9515, 5600) _WD_Option('Port', $iPort) _WD_Option('DriverParams', '--port=' & $iPort & ' --verbose --log-path="' & "C:\Users\HP\Desktop\AutoIt" & '\chrome.log') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"debuggerAddress": "localhost:9222"}}}}' ;MsgBox(0,'',$sDesiredCapabilities) EndIf EndFunc Edited October 21, 2024 by samibb
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now