Skip to content

[rb] Upload file command is not W3C compatible #8735

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

Closed
abhisheksawant16 opened this issue Sep 25, 2020 · 5 comments
Closed

[rb] Upload file command is not W3C compatible #8735

abhisheksawant16 opened this issue Sep 25, 2020 · 5 comments
Labels
C-rb Ruby Bindings D-chrome I-defect Something is not working as intended J-awaiting answer Question asked of user; a reply moves it to triage again OS-mac

Comments

@abhisheksawant16
Copy link

🐛 Bug Report

Upload file command is not W3C compatible

To Reproduce

Use the selenium 4.x version with Saucelabs and try to upload a file using upload_file method

Selenium::WebDriver::Error::UnknownCommandError:
09:10:24        unknown command: unknown command: session/057a6f6332b92799b785cb73f414d279/se/file
09:10:24      # 0   chromedriver                        0x0000000103aac6b9 chromedriver + 4904633
09:10:24      # 1   chromedriver                        0x0000000103a4bde3 chromedriver + 4509155
09:10:24      # 2   chromedriver                        0x00000001036bbc06 chromedriver + 773126
09:10:24      # 3   chromedriver                        0x000000010363d439 chromedriver + 255033
09:10:24      # 4   chromedriver                        0x000000010363d0fd chromedriver + 254205
09:10:24      # 5   chromedriver                        0x0000000103603fba chromedriver + 20410
09:10:24      # 6   chromedriver                        0x0000000103a75032 chromedriver + 4677682
09:10:24      # 7   chromedriver                        0x0000000103a82eca chromedriver + 4734666
09:10:24      # 8   chromedriver                        0x0000000103a82b81 chromedriver + 4733825
09:10:24      # 9   chromedriver                        0x0000000103a5820e chromedriver + 4559374
09:10:24      # 10  chromedriver                        0x0000000103a833f1 chromedriver + 4735985
09:10:24      # 11  chromedriver                        0x0000000103a69dea chromedriver + 4632042
09:10:24      # 12  chromedriver                        0x0000000103601824 chromedriver + 10276
09:10:24      # 13  libdyld.dylib                       0x00007fff63765ea9 start + 1
09:10:24      # 14  ???                                 0x0000000000000003 0x0 + 3
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/response.rb:72:in `assert_ok'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/response.rb:34:in `initialize'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/common.rb:88:in `new'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/common.rb:88:in `create_response'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/default.rb:114:in `request'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/common.rb:64:in `call'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/bridge.rb:167:in `execute'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:567:in `execute'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:395:in `upload'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:379:in `block in send_keys_to_element'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:379:in `map'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:379:in `send_keys_to_element'
09:10:24      # ./gems/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/element.rb:156:in `send_keys'
09:10:24      # ./gems/gems/capybara-3.33.0/lib/capybara/selenium/node.rb:362:in `block in set_file'
09:10:24      # ./gems/gems/capybara-3.33.0/lib/capybara/selenium/node.rb:375:in `with_file_detector'
09:10:24      # ./gems/gems/capybara-3.33.0/lib/capybara/selenium/node.rb:357:in `set_file'
09:10:24      # ./gems/gems/capybara-3.33.0/lib/capybara/selenium/nodes/chrome_node.rb:26:in `set_file'
09:10:24      # ./gems/gems/capybara-3.33.0/lib/capybara/selenium/node.rb:72:in `set'
09:10:24      # ./gems/gems/capybara-3.33.0/lib/capybara/node/element.rb:123:in `block in set'
09:10:24      # ./gems/gems/capybara-3.33.0/lib/capybara/node/base.rb:83:in `synchronize'
09:10:24      # ./gems/gems/capybara-3.33.0/lib/capybara/node/element.rb:123:in `set'
09:10:24      # ./gems/gems/capybara-3.33.0/lib/capybara/node/actions.rb:303:in `attach_file'
09:10:24      # ./pages/sections/xing_id_module.rb:18:in `upload'
09:10:24      # ./spec/image_upload_spec.rb:63:in `block (4 levels) in <top (required)>'
09:10:24      # ./gems/bundler/gems/page_objects_dsl-91f04084e372/lib/page_objects/dsl.rb:39:in `instance_eval'
09:10:24      # ./gems/bundler/gems/page_objects_dsl-91f04084e372/lib/page_objects/dsl.rb:39:in `evaluate'
09:10:24      # ./gems/bundler/gems/page_objects_dsl-91f04084e372/lib/page_objects/dsl.rb:56:in `visit_page'
09:10:24      # ./spec/image_upload_spec.rb:59:in `block (3 levels) in <top (required)>'
09:10:24      # ./gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
09:10:24      # ./gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
09:10:24      # ./gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
09:10:24      # ./gems/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
09:10:24      # ./gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'

Expected behavior

The session should call for the W3C compatible command without '/se'

Incorrect eg: session/057a6f6332b92799b785cb73f414d279/se/file

Correct eg: session/057a6f6332b92799b785cb73f414d279/file

Test script or set of commands reproducing this issue

Its not easy to reproduce as this issue only occurs when executing the tests on a remote web driver like Saucelabs in W3C compatible mode

Environment

OS: Windows 10
Browser: Chrome
Browser version: 85
Browser Driver version: 85.0.4183.38
Selenium Grid version (if applicable): 3.142.7

@ghost ghost added the A-needs-triaging A Selenium member will evaluate this soon! label Sep 25, 2020
@SalmonMode SalmonMode added C-rb Ruby Bindings D-chrome I-defect Something is not working as intended OS-mac labels Sep 27, 2020
@diemol diemol removed the A-needs-triaging A Selenium member will evaluate this soon! label Sep 28, 2020
@diemol
Copy link
Member

diemol commented Sep 28, 2020

@abhisheksawant16 could you please share the capabilitie used to create the RemoteWebDriver session?

@diemol diemol added the J-awaiting answer Question asked of user; a reply moves it to triage again label Sep 28, 2020
@abhisheksawant16
Copy link
Author

@diemol here is how the capabilities file looks.

{
  "platformName": "macOS 10.14",
  "sauce:options": {
    "parentTunnel": "xxx-desktop",
    "tunnelIdentifier": "xxxxx",
    "seleniumVersion": "3.142.7",
    "screenResolution": "1920x1440",
    "maxDuration": 5000,
    "recordVideo": true,
    "videoUploadOnPass": true,
    "recordScreenshots": true,
    "timeZone": "Berlin"
  }
}

@titusfortner
Copy link
Member

I just verified that this is a Sauce Labs bug, not a Selenium bug.

Note that it works for Firefox, but Sauce does an extra layer of processing for Chrome that needs to recognize the new Se4 endpoint and it does not, yet.

I've raised the issue internally at Sauce and we're working on a fix.
If you want to track the status, you can contact your CSM or create a support ticket and reference this issue.

@titusfortner
Copy link
Member

@abhisheksawant16 thanks for raising the issue.

Also, to clarify, since there is no upload functionality specified in w3c, se/file is the w3c compliant implementation.

@abhisheksawant16
Copy link
Author

@titusfortner thanks for looking into it.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-rb Ruby Bindings D-chrome I-defect Something is not working as intended J-awaiting answer Question asked of user; a reply moves it to triage again OS-mac
Projects
None yet
Development

No branches or pull requests

4 participants