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

Element Send Keys doesn't honour text parameters #594

Closed
shs96c opened this issue Apr 2, 2017 · 3 comments
Closed

Element Send Keys doesn't honour text parameters #594

shs96c opened this issue Apr 2, 2017 · 3 comments

Comments

@shs96c
Copy link

shs96c commented Apr 2, 2017

Firefox Version

55.0a1 (2017-04-02) (64-bit)

Geckodriver version

fd9bf45

Platform

OS X

Steps to reproduce -

Send a Element Send Keys command with the payload:

{"text":"cheese@example.com"}

According to the spec (steps 7 and 8 of the remote end steps), this should be okay:

7 Let text be the result of getting a property called "text" from the parameters argument.

8 If text is not a string, return an error with error code invalid argument.

Instead, the following error message is sent: Expected [object Undefined] undefined to be a string

and the following stacktrace:

stack backtrace:
   0:        0x109893831 - backtrace::backtrace::trace<closure>
                        at /Users/shs/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.0/src/backtrace/mod.rs:90
   1:        0x109894d24 - backtrace::capture::Backtrace::new::h8ca3ad60a3bf61a1
                        at /Users/shs/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.0/src/lib.rs:101
   2:        0x10980949a - webdriver::error::{{impl}}::new<collections::string::String>
                        at /Users/shs/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/webdriver-0.24.0/src/error.rs:126
   3:        0x109815800 - geckodriver::marionette::{{impl}}::response
                        at /Users/shs/src/geckodriver/src/marionette.rs:518
   4:        0x109823871 - geckodriver::marionette::{{impl}}::send_command
                        at /Users/shs/src/geckodriver/src/marionette.rs:1193
   5:        0x10981415f - geckodriver::marionette::{{impl}}::handle_command
                        at /Users/shs/src/geckodriver/src/marionette.rs:414
   6:        0x1097b01df - webdriver::server::{{impl}}::run<geckodriver::marionette::MarionetteHandler,geckodriver::marionette::GeckoExtensionRoute>
                        at /Users/shs/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/webdriver-0.24.0/src/server.rs:65
   7:        0x10980a108 - webdriver::server::start::{{closure}}<geckodriver::marionette::MarionetteHandler,geckodriver::marionette::GeckoExtensionRoute>
                        at /Users/shs/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/webdriver-0.24.0/src/server.rs:254
   8:        0x1097fe4da - std::panic::{{impl}}::call_once<(),closure>
                        at /private/tmp/rust-20170317-3971-sqpojh/rustc-1.16.0-src/src/libstd/panic.rs:296
   9:        0x109739ea9 - std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure>,()>
                        at /private/tmp/rust-20170317-3971-sqpojh/rustc-1.16.0-src/src/libstd/panicking.rs:460
  10:        0x109deaa4a - __rust_maybe_catch_panic
                        at /private/tmp/rust-20170317-3971-sqpojh/rustc-1.16.0-src/src/libpanic_unwind/lib.rs:98
  11:        0x109739553 - std::panicking::try<(),std::panic::AssertUnwindSafe<closure>>
                        at /private/tmp/rust-20170317-3971-sqpojh/rustc-1.16.0-src/src/libstd/panicking.rs:436
  12:        0x109736854 - std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure>,()>
                        at /private/tmp/rust-20170317-3971-sqpojh/rustc-1.16.0-src/src/libstd/panic.rs:361
  13:        0x1097391ab - std::thread::{{impl}}::spawn::{{closure}}<closure,()>
                        at /private/tmp/rust-20170317-3971-sqpojh/rustc-1.16.0-src/src/libstd/thread/mod.rs:357
  14:        0x109796272 - alloc::boxed::{{impl}}::call_box<(),closure>
                        at /private/tmp/rust-20170317-3971-sqpojh/rustc-1.16.0-src/src/liballoc/boxed.rs:614
  15:        0x109de8e74 - std::sys::imp::thread::{{impl}}::new::thread_start
                        at /private/tmp/rust-20170317-3971-sqpojh/rustc-1.16.0-src/src/liballoc/boxed.rs:624
  16:     0x7fff8b864aaa - _pthread_body
  17:     0x7fff8b8649f6 - _pthread_start
@andreastt
Copy link
Contributor

geckodriver appears to send {value: "string"} to Marionette in https://github.com/mozilla/geckodriver/blob/master/src/marionette.rs#L914, but Marionette (on m-c) only accepts a text field in http://searchfox.org/mozilla-central/source/testing/marionette/driver.js#2147. The JSON serialisation of SendKeysParameters in webdriver also looks sketchy in https://github.com/mozilla/webdriver-rust/blob/master/src/command.rs#L757.

To support the largest number of Firefoxen that doesn’t have https://bugzilla.mozilla.org/show_bug.cgi?id=1348782, I suggest making geckodriver send:

{
    "value": ["s", "t", "r", "i", "n", "g"],
    "text": "string"
}

@andreastt
Copy link
Contributor

cc @AutomatedTester

@andreastt andreastt added this to the 0.16 milestone Apr 4, 2017
barancev added a commit to SeleniumHQ/selenium that referenced this issue Apr 6, 2017
jgraham pushed a commit that referenced this issue Apr 7, 2017
Following https://bugzilla.mozilla.org/show_bug.cgi?id=1348782
and https://bugzilla.mozilla.org/show_bug.cgi?id=1354323, the
sendKeysToElement and sendKeysToDialog commands in Marionette accept
only a string `text' field as input.

These patches to Firefox has since been uplifted all the way to Firefox
53.  In order to make geckodriver work with newer Firefox versions again,
we need to pass the `text' field.  But in order to support older Firefoxen
without the `text' field requirement, we also want to continue to send
`value' as a string array.

Clients must unfortunately send a string `text' field, but it is believed
it is easier to upgrade to the latest Selenium release than to pin the
exact versions of geckodriver and Firefox.

Fixes: #594
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue May 20, 2017
…sParameters

Following https://bugzilla.mozilla.org/show_bug.cgi?id=1348782
and https://bugzilla.mozilla.org/show_bug.cgi?id=1354323, the
sendKeysToElement and sendKeysToDialog commands in Marionette accept
only a string `text' field as input.

These patches to Firefox has since been uplifted all the way to Firefox
53.  In order to make geckodriver work with newer Firefox versions again,
we need to pass the `text' field.  But in order to support older Firefoxen
without the `text' field requirement, we also want to continue to send
`value' as a string array.

Clients must unfortunately send a string `text' field, but it is believed
it is easier to upgrade to the latest Selenium release than to pin the
exact versions of geckodriver and Firefox.

Fixes: mozilla/geckodriver#594
Source-Repo: https://github.com/mozilla/geckodriver
Source-Revision: 41f89d878c805e0d66a15f8b6151dda78173ccff

committer: jgraham <james@hoppipolla.co.uk>

--HG--
extra : rebase_source : 1574a632e591dc121cba77fc58c8026435fbef2b
aethanyc pushed a commit to aethanyc/gecko-dev that referenced this issue May 21, 2017
…sParameters

Following https://bugzilla.mozilla.org/show_bug.cgi?id=1348782
and https://bugzilla.mozilla.org/show_bug.cgi?id=1354323, the
sendKeysToElement and sendKeysToDialog commands in Marionette accept
only a string `text' field as input.

These patches to Firefox has since been uplifted all the way to Firefox
53.  In order to make geckodriver work with newer Firefox versions again,
we need to pass the `text' field.  But in order to support older Firefoxen
without the `text' field requirement, we also want to continue to send
`value' as a string array.

Clients must unfortunately send a string `text' field, but it is believed
it is easier to upgrade to the latest Selenium release than to pin the
exact versions of geckodriver and Firefox.

Fixes: mozilla/geckodriver#594
Source-Repo: https://github.com/mozilla/geckodriver
Source-Revision: 41f89d878c805e0d66a15f8b6151dda78173ccff

committer: jgraham <james@hoppipolla.co.uk>
JerryShih pushed a commit to JerryShih/gecko-dev that referenced this issue May 25, 2017
…sParameters

Following https://bugzilla.mozilla.org/show_bug.cgi?id=1348782
and https://bugzilla.mozilla.org/show_bug.cgi?id=1354323, the
sendKeysToElement and sendKeysToDialog commands in Marionette accept
only a string `text' field as input.

These patches to Firefox has since been uplifted all the way to Firefox
53.  In order to make geckodriver work with newer Firefox versions again,
we need to pass the `text' field.  But in order to support older Firefoxen
without the `text' field requirement, we also want to continue to send
`value' as a string array.

Clients must unfortunately send a string `text' field, but it is believed
it is easier to upgrade to the latest Selenium release than to pin the
exact versions of geckodriver and Firefox.

Fixes: mozilla/geckodriver#594
Source-Repo: https://github.com/mozilla/geckodriver
Source-Revision: 41f89d878c805e0d66a15f8b6151dda78173ccff

committer: jgraham <james@hoppipolla.co.uk>
@lock
Copy link

lock bot commented Aug 17, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 1, 2019
…sParameters

Following https://bugzilla.mozilla.org/show_bug.cgi?id=1348782
and https://bugzilla.mozilla.org/show_bug.cgi?id=1354323, the
sendKeysToElement and sendKeysToDialog commands in Marionette accept
only a string `text' field as input.

These patches to Firefox has since been uplifted all the way to Firefox
53.  In order to make geckodriver work with newer Firefox versions again,
we need to pass the `text' field.  But in order to support older Firefoxen
without the `text' field requirement, we also want to continue to send
`value' as a string array.

Clients must unfortunately send a string `text' field, but it is believed
it is easier to upgrade to the latest Selenium release than to pin the
exact versions of geckodriver and Firefox.

Fixes: mozilla/geckodriver#594
Source-Repo: https://github.com/mozilla/geckodriver
Source-Revision: 41f89d878c805e0d66a15f8b6151dda78173ccff

committer: jgraham <jameshoppipolla.co.uk>

UltraBlame original commit: b443a2f7254b5fcd744a091013c73d697ee0ae29
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 1, 2019
…sParameters

Following https://bugzilla.mozilla.org/show_bug.cgi?id=1348782
and https://bugzilla.mozilla.org/show_bug.cgi?id=1354323, the
sendKeysToElement and sendKeysToDialog commands in Marionette accept
only a string `text' field as input.

These patches to Firefox has since been uplifted all the way to Firefox
53.  In order to make geckodriver work with newer Firefox versions again,
we need to pass the `text' field.  But in order to support older Firefoxen
without the `text' field requirement, we also want to continue to send
`value' as a string array.

Clients must unfortunately send a string `text' field, but it is believed
it is easier to upgrade to the latest Selenium release than to pin the
exact versions of geckodriver and Firefox.

Fixes: mozilla/geckodriver#594
Source-Repo: https://github.com/mozilla/geckodriver
Source-Revision: 41f89d878c805e0d66a15f8b6151dda78173ccff

committer: jgraham <jameshoppipolla.co.uk>

UltraBlame original commit: b443a2f7254b5fcd744a091013c73d697ee0ae29
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 1, 2019
…sParameters

Following https://bugzilla.mozilla.org/show_bug.cgi?id=1348782
and https://bugzilla.mozilla.org/show_bug.cgi?id=1354323, the
sendKeysToElement and sendKeysToDialog commands in Marionette accept
only a string `text' field as input.

These patches to Firefox has since been uplifted all the way to Firefox
53.  In order to make geckodriver work with newer Firefox versions again,
we need to pass the `text' field.  But in order to support older Firefoxen
without the `text' field requirement, we also want to continue to send
`value' as a string array.

Clients must unfortunately send a string `text' field, but it is believed
it is easier to upgrade to the latest Selenium release than to pin the
exact versions of geckodriver and Firefox.

Fixes: mozilla/geckodriver#594
Source-Repo: https://github.com/mozilla/geckodriver
Source-Revision: 41f89d878c805e0d66a15f8b6151dda78173ccff

committer: jgraham <jameshoppipolla.co.uk>

UltraBlame original commit: b443a2f7254b5fcd744a091013c73d697ee0ae29
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