Under the _webdriver_manager/core/osmanager.py module we have the OperationSystemManager.get_browser_version_from_os method which employs the windows_browser_apps_to_cmd() utility to generate a Powershell script to be executed in order to run different local browser binary paths in order to output and detect the version.
From what I can tell, executing this directly in Powershell:
works, but taking that script and executing it with Popen as this shell liner: powershell "<code>" doesn't work, most probably because of the other " found inside the script, thus not expanding the $env:<name> properly.
I found a way to fix it on Robocorp side by enclosing the given path under single quotes ('), although this time it is known that var expansion won't work by design.
Of course, this is not a blocker, as the right version can be still retrieved from the registry approach, but would be good to find a way to run these Powershell scripts correctly from the library side in order to nicely be able to retrieve browser versions right from them. (aka fixing the quoted path passing to Get-Item while still supporting variable expansion during popen-based runs (or CMD runs))
Under the _webdriver_manager/core/osmanager.py module we have the
OperationSystemManager.get_browser_version_from_os
method which employs thewindows_browser_apps_to_cmd()
utility to generate a Powershell script to be executed in order to run different local browser binary paths in order to output and detect the version.From what I can tell, executing this directly in Powershell:
works, but taking that script and executing it with
Popen
as this shell liner:powershell "<code>"
doesn't work, most probably because of the other"
found inside the script, thus not expanding the$env:<name>
properly.I found a way to fix it on Robocorp side by enclosing the given path under single quotes (
'
), although this time it is known that var expansion won't work by design.Of course, this is not a blocker, as the right version can be still retrieved from the registry approach, but would be good to find a way to run these Powershell scripts correctly from the library side in order to nicely be able to retrieve browser versions right from them. (aka fixing the quoted path passing to
Get-Item
while still supporting variable expansion during popen-based runs (or CMD runs))