Jotos Posted January 16, 2024 Posted January 16, 2024 Heya, I have been exploring various forums and documentation, but haven't found a clear solution yet. Could anyone here provide some guidance or share their experiences with changing the Chrome Path for WebDriver? I would like to use another Version of Chrome for my script. Thanks
Danp2 Posted January 16, 2024 Posted January 16, 2024 Hi... this is covered in the FAQ section of the Wiki (see my sig for link). Have you checked there yet? Latest Webdriver UDF Release Webdriver Wiki FAQs
Jotos Posted January 16, 2024 Author Posted January 16, 2024 1 hour ago, Danp2 said: Hi... this is covered in the FAQ section of the Wiki (see my sig for link). Have you checked there yet? Yhea, I tried this: Func SetupChrome() ShellExecute(@ScriptDir & "\Include\chromedriver.exe", "","","", @SW_HIDE) _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) Local $pfad = 'C:\\Program Files\\Google\\Chrome Beta\\Application\\chrome.exe' _WD_CapabilitiesAdd('binary', $pfad) _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') Local $sCapabilities = _WD_CapabilitiesGet() Return $sCapabilities EndFunc ;==>SetupChrome but get an error..
Danp2 Posted January 16, 2024 Posted January 16, 2024 12 minutes ago, Jotos said: ShellExecute(@ScriptDir & "\Include\chromedriver.exe", "","","", @SW_HIDE) I'm not sure why you would have this here. It isn't needed as _WD_Startup will launch the webdriver when it is executed. FWIW, the console will automatically be hidden if the debug level is below $_WD_DEBUG_Info. You can also use _WD_ConsoleVisible to hide / show the webdriver console. You should put the full path to the chromedriver executable in this line -- _WD_Option('Driver', 'chromedriver.exe') Quote but get an error My crystal ball is broken, so you'll need to provide more details about this error if you want further assistance. 😉 Latest Webdriver UDF Release Webdriver Wiki FAQs
Jotos Posted January 16, 2024 Author Posted January 16, 2024 (edited) $sCapabilities = SetupChrome() $sSession = _WD_CreateSession() _WD_CheckContext($sSession, False) If @error Then MsgBox(0,"_WD_CheckContext($sSession, False)","Error: _WD_CheckContext") ;return if session is NOT OK I think it's because of the chromedriver.exe don't have the right version. Atm I use version 120.0.6099.217 for Chrome and the last stable version for the chromedriver is: 120.0.6099.109 That's why I wanted to change the path for a beta version of Chrome. The script worked a few weeks ago and everything was fine Now it's broken.. Edited January 16, 2024 by Jotos
Solution Jotos Posted January 16, 2024 Author Solution Posted January 16, 2024 sorry guys... I forget to take... $sCapabilities $sCapabilities = SetupChrome() $sSession = _WD_CreateSession($sCapabilities) Now its working... etidd 1
MojoeB Posted January 18, 2024 Posted January 18, 2024 You also have the option to have the correct driver downloaded automatically. In your case, it would be something like this: _WD_UpdateDriver('chrome_legacy', @ScriptDir & '\Include', TRUE)
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