Skip to content
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

Expansion of file paths removes / to \ translation when using the Firefox driver #2228

Closed
twalpole opened this issue Jul 12, 2019 · 5 comments

Comments

@twalpole
Copy link
Member

For windows with Firefox the user needs to translate / to \ when file names are sent - this is because the webdriver spec doesn't really specify what file separators should be, and we don't know what platform any final browser is actually running on. Unfortunately expanding the path (added in 3.24) removes any translation of the name a user has done.

@twalpole
Copy link
Member Author

@lflucasferreira I'll update here when I have things to try/fixed

@twalpole
Copy link
Member Author

Original report :

I am facing the same issue. And I am translating / to \ if "OS.windows?" as you can see below.

It works in Chrome but not in Firefox 68.0 (64-bits).

def attach_doc_file(id, file)
path = File.join(Dir.pwd, "features/support/public/doc/#{file}")
path = path.tr('/', '') if OS.windows?
attach_file(id, path)
end

Original Error:

File not found: C:/Project/cnb/features/support/public/doc/CEP_Upload.xml (Selenium::WebDriver::Error::InvalidArgumentError)
WebDriverError@chrome://marionette/content/error.js:179:5
InvalidArgumentError@chrome://marionette/content/error.js:306:5
interaction.uploadFiles@chrome://marionette/content/interaction.js:501:13

@twalpole
Copy link
Member Author

@lflucasferreira I don't have a windows box to test this on currently. Could you please try using the relative_path branch and see if it fixes the issue.

@twalpole
Copy link
Member Author

Fixed via 482dfb3

@lflucasferreira
Copy link

Fixed via 482dfb3

In this case, can I already update Capybara to the newest version?

@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants