Skip to content

Ruby - Unable to upload file when w3c browser capability is set to true #7666

@sriup

Description

@sriup

🐛 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.

Selenium::WebDriver::Error::UnknownCommandError: unknown command: unknown command: session/xxxsession_idXXX/se/file
Backtrace:
       Ordinal0 [0x00FDEB13+1501971]
       Ordinal0 [0x00F5F6D1+980689]
        Ordinal0 [0x00EE765F+489055]
        Ordinal0 [0x00E9618E+156046]
        Ordinal0 [0x00E95FF4+155636]
        Ordinal0 [0x00E7220E+8718]
  Ordinal0 [0x00E72626+9766]
  Ordinal0 [0x00E72C10+11280]
 Ordinal0 [0x00F78F37+1085239]
       GetHandleVerifier [0x0107D7ED+503293]
       GetHandleVerifier [0x0107D580+502672]
       GetHandleVerifier [0x010846AC+531644]
       GetHandleVerifier [0x0107DFFA+505354]
       Ordinal0 [0x00F70606+1050118]
       Ordinal0 [0x00F7047F+1049727]
       Ordinal0 [0x00E7204B+8267]
  Ordinal0 [0x00E71D7C+7548]
  GetHandleVerifier [0x013CD83C+3976780]
      BaseThreadInitThunk [0x755738F4+36]
 RtlUnicodeStringToInteger [0x77375E13+595]
  RtlUnicodeStringToInteger [0x77375DDE+542]

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:
image

After removing /se/ from the below line, file upload is working as expected without error message.

image

Please let us know if there is any other way to handle this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-rbRuby BindingsJ-awaiting answerQuestion asked of user; a reply moves it to triage again

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions