You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Possible Bug: The method isWindowsAppExecutionAlias checks for the DOS file attribute but does not handle exceptions other than IOException. Consider handling or documenting other potential exceptions that might be thrown by Files.getAttribute.
Code Clarity: The method isWindowsAppExecutionAlias could benefit from more detailed comments explaining the significance of the WINDOWS_FILE_ATTRIBUTE_REPARSE_POINT and how it relates to Windows app execution aliases.
Cache the result of checking if DOS attributes are supported to improve performance
The isWindowsAppExecutionAlias method should cache the result of FileSystems.getDefault().supportedFileAttributeViews().contains("dos") to avoid repeatedly calling this method, which can be expensive.
Why: Adding logging for exceptions can greatly aid in debugging, though it should be done with a proper logging framework instead of printStackTrace().
This PR does mix the java.io and the java.nio way of doing things. I would suggest to deprecate the java.io stuff (using the File class) and create a new isExecutable using the Path, which does not call isRegularFile. @vlad8x8 would you like to update the PR or should i do the change?
Hi @joerg1985 . Unfortunatelly Files.isExecutable(path) and file.isExecutable() returns different values for Windows app execution aliases. Feel free to change it as you want, if it works for Windows app execution aliases.
You can find some aliases on Win10 in folder <UserFolder>\AppData\Local\Microsoft\WindowsApps
Targets for those aliases you can find in Windows registry HKCU:/SOFTWARE/Microsoft/Windows/CurrentVersion/App Paths
@joerg1985 did you test your commit against app execution aliases?
java.nio.file.LinkOption.NOFOLLOW_LINKS is critical for them, but you don't use it in your PR
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Fix for #14088
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Fix for #14088
Description
Check if the browser path is Windows app execution alias before checking if it's a file.
Motivation and Context
Selenium manager is failing on Windows app execution aliases
Types of changes
Checklist
PR Type
Bug fix
Description
isWindowsAppExecutionAlias
to check if the browser path is a Windows app execution alias.isExecutable
method to use the new alias check before verifying if the file is executable.Changes walkthrough 📝
Require.java
Add Windows app execution alias check in Require.java
java/src/org/openqa/selenium/internal/Require.java
isWindowsAppExecutionAlias
to check for Windows appexecution aliases.
isExecutable
method to incorporate the new alias check beforeverifying if the file is executable.