-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Ruby - Unable to upload file when w3c browser capability is set to true #7666
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
Comments
Tested the fix on |
Can you provide the full code how to reproduce the issue? In particular, I'm interested to see how you start the browser/driver and what options you use for starting. |
Here is the method that will get the capabilities based on the browser.
And below the line of code that will create the @browser instance.
once the browser is initialized calling the below line when we are on the file upload page.
Let me know if you need any more information. |
FYI - After further digging found out that the root cause of the issue is |
What version of Grid do you use? It looks to me that you use recent ChromeDriver but maybe old Grid? |
This is strange. I'm running the exact same configuration and it works perfectly fine for me:
require 'selenium-webdriver'
Selenium::WebDriver.logger.level = :info
begin
driver = Selenium::WebDriver.for(:remote, url: 'http://localhost:4444/wd/hub', desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome('goog:chromeOptions' => {'w3c' => true}, 'browserName' => 'chrome'))
driver.file_detector = ->(args) { args.first }
driver.get 'https://www.websupergoo.com/file-upload-1.aspx'
driver.find_element(css: 'input[type="file"]').send_keys __FILE__
ensure
driver.quit
end
As you can see there is a request to Can you strip down your test case to Ruby script like I made? |
Sure, will check and update. |
Having the same issue using PHP Behat. Seems to be related to docksal/behat#7 |
I don't see 'session/:session_id/se/file' end-point in the list of available endpoints from 'http://www.w3.org/TR/2015/WD-webdriver-20150918/#list-of-endpoints` page. |
@sridharUpputuri it’s not a webdriver specified endpoint - it’s a selenium extension, as identified by the |
Closing this as requested info not given |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
Script is failing to upload with "Selenium::WebDriver::Error::UnknownCommandError: unknown command: unknown command: session/xxxsession_idXXX/se/file" error message.
To Reproduce
Try uploading file to a file_feild in the below specified environment.
Expected behavior
File should be uploaded successfully. But we are getting the below error.
Test script or set of commands reproducing this issue
@browser.file_field(xpath: "//*[contains(text(), 'Upload')]/input[@type='file']").set(@complete_path)
Environment
OS: Windows 10
Browser: Chrome
Browser version: 77
Browser Driver version: ChromeDriver 77
Language Bindings version: Ruby 3.142.6
Original code:

After removing
/se/
from the below line, file upload is working as expected without error message.Please let us know if there is any other way to handle this.
The text was updated successfully, but these errors were encountered: