-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.7.0] Crashes with Jruby Windows #41
Comments
I believe #39 will resolve this issue as the following line executes successfully on Jruby Windows. |
Hi @mascolim, I tested your potential workaround in vanilla Ruby/MRI on Windows 10 and it did not work unfortunately.
Since this seems to be a Jruby specific issue with a workaround through #39, as mentioned in your comment, can we mark this as resolved? |
3.7.1 works when Selenium::WebDriver::Chrome.path is set to a custom path that has no spaces, but if Selenium::WebDriver::Chrome.path has spaces or is not set it will continue to fail. If no one else uses JRuby on Windows then we can close the issue as the real issue is with Jruby, and a full work-around may be messy. |
Ah, that's annoying. Well, I have the following working for Google Chrome (based on your fix): https://github.com/kapoorlakshya/webdrivers/blob/41_jruby_support_on_windows/lib/webdrivers/chromedriver.rb#L94 Spec is here: https://github.com/kapoorlakshya/webdrivers/blob/41_jruby_support_on_windows/spec/chromedriver_spec.rb#L67 Would you mind testing it locally? I successfully tested it on Jruby 9.1.7.0. P.S. The |
Yes, thank you! The 41_jruby_support_on_windows branch was verified successfully with [Jruby 9.2.4 Windows 10] and [9.2.0 Windows Server 2012] for unset Chrome.path |
Nice! I'll submit the PR later today and then release it in v3.7.2. |
Expected Behavior:
chrome_on_windows returns the version number. When the environment is Windows and language is Jruby
Actual Behavior:
An error is thrown and program halts as the command is not translated properly when sent to powershell.
20:10:35.983 Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App' because it does not exist. 20:10:35.983 At line:1 char:12 20:10:35.983 + (Get-Item (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App ... 20:10:35.983 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 20:10:35.983 + CategoryInfo : ObjectNotFound: (HKLM:\SOFTWARE\...rentVersion\App:String) [Get-ItemProperty], ItemNotFo 20:10:35.983 undException 20:10:35.983 + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand 20:10:35.983 20:10:36.149 Default : The term 'Default' is not recognized as the name of a cmdlet, function, script file, or operable program. 20:10:36.149 Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 20:10:36.149 At line:1 char:100 20:10:36.149 + ... s\chrome.exe).(Default)).VersionInfo.ProductVersion 20:10:36.149 + ~~~~~~~ 20:10:36.149 + CategoryInfo : ObjectNotFound: (Default:String) [], CommandNotFoundException 20:10:36.149 + FullyQualifiedErrorId : CommandNotFoundException
Steps to Reproduce
reg = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe'
ps = "(Get-Item (Get-ItemProperty '#{reg}').'(Default)').VersionInfo.ProductVersion"
puts `powershell #{ps}`
Potential Work-around
The following code executes the intended operation through Jruby Windows. This requires using the exec() command, escaping the space in App Paths with a ` character, and double escaping the single quotes.
This solution is not yet verified in vanilla Ruby
exec("powershell (Get-Item -Path ((Get-ItemProperty \"HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\App` Paths\\chrome.exe\").\\'(default)\\')).VersionInfo.ProductVersion")
Note
I believe this issue stems from a long living Jruby Windows issue jruby/jruby#3725
The text was updated successfully, but these errors were encountered: