Hi,
Firstly thank you for your work on bringing the Chrome Driver to AutoIT. I am finding that it works very well
I have been putting together a script that allows cyberark to automate login to some websites. An end user will log in to CyberArk and request a connection. CyberArk then launches an RDP session to what they call their PSM server, it is an RDS Host using RemoteApp capability. The compiled au3 file is launched as a RemoteApp and connection and authentication takes places.
CyberArk provide a WebForm capability but it is limited and too restrictive for my specific requirements.
My initial script script works a treat and automates the login process to a number of different websites. However I found an issue. I had hardcoded the port as 9515 like this:
_WD_Oprtion('Port', 9515)
Which causes a problem if more than one Web Driver session is running at a time. The 2nd session actually launches within the RDP session of the 1st user to connect. Kind of make sense if both users RDP sessions are calling Chromedriver.exe on the same port number. It is a small window of risk but a significant one.
So I added a function to check for in use ports and only use one that is not currently in use. Which is where I found my problem. I cannot get the chrome driver to use anything else other than 9515 now. Even if I hardcode the value like this:
_WD_Option('Port', 9517)
It still connects on 9515 😕
When I get the value of
_WD_Option('Port')
it returns a value of 9517. Yet the ChromeDriver log clearly shows it connecting on 9515.
I have tried logging off and on again, deleting the Chrome UserData folder for my user. I have search through this support site, SO, and any other site I find using a Google search
So,
1) Why can't I change the port? What am I doing wrong? Ideas, help, suggestions all welcome
2) Is there a better way of doing this, using the ChromeDriverService for example?
This is the function I am configuring _WD_Options with:
Func _SetupChrome(Const $sWdPath, Const $iPort, $sLogLevel = Default)
LogWrite("_SetupChrome: Setting Chrome Web Driver Path to " & $sWdPath)
_WD_Option('Driver', $sWdPath) ; set the path to the web driver
LogWrite("_SetupChrome: Setting Chrome Web Driver Port to " & $iPort)
_WD_Option('Port', $iPort) ; set the port the web driver will use
If ($sLogLevel = "Verbose") Then
LogWrite("_SetupChrome: WARNING Setting Chrome Web Driver logs to VERBOSE, path = " & $sWdLogPath)
LogWrite("_SetupChrome: VERBOSE LOGGING CAN RESULT IN PASSWORDS BEING RECORDED IN THE LOG FILE.")
_WD_Option('DriverParams', '--verbose --log-path="' & $sWdLogPath & '"')
ElseIf ($sLogLevel = "Warning") Then
LogWrite("_SetupChrome: Setting Chrome Web Driver to warning, path = " & $sWdLogPath)
LogWrite("_SetupChrome: WARNING LEVEL LOGGING CAN RESULT IN PASSWORDS BEING RECORDED IN THE LOG FILE.")
_WD_Option('DriverParams', ' --log-path="' & $sWdLogPath & '"')
ElseIf ($sLogLevel = Default) Then
LogWrite("_SetupChrome: Chrome Web Driver logs disabled")
Else
LogWrite("_SetupChrome: Unexpected value provided for Log level. Chrome Web Driver logs disabled")
EndIf
$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches":' _
& ' [ "enable-automation"], "useAutomationExtension": false, "args": ["--proxy-pac-url=' & $sChromeAppProxyPacPath & '"] }}}}'
EndFunc
This is how I call the function:
_SetupChrome($sWdExePath, 9517, "Warning")
I will replace the hardcoded 9517 with a variable.
I have opened port 9515 so that the ChromeDriver cannot use it. This is the log message I get:
I am using Chrome Enterprise v 90.0.4430.85