Fwd: send_keys not working after upgrading to latest S::R::D

25 views
Skip to first unread message

Daniel Gempesaw

unread,
Sep 28, 2016, 1:56:28 PM9/28/16
to perumal pandian, selenium-re...@googlegroups.com
Hi perumal,

Can you provide the entire error and associated stack trace? Or, are you using `Selenium::Firefox` and thus cannot get at the stack trace? I guess I should have S::R::D output the entire thing if possible. Well, anyway, I can't help much from the provided information. I can only make unhelpful general guesses: 

- is the element hidden or otherwise unable to be interacted with? maybe behind another element?
- maybe there's an issue in geckodriver that has bugs with sendKeysToElement? I've no idea but perhaps a google search would be fruitful.

As usual, the easiest way for me to help is if you provide a full reproduction case: a webpage that generates the error and the entire perl script that causes the error. Finally, I'm forwarding this to the SRD mailing list; please continue further correspondence there so that when we figure this out, it may be of use to others c:

Thanks and good luck!

---------- Forwarded message ---------
From: perumal pandian <perumal...@gmail.com>
Date: Wed, Sep 28, 2016 at 1:33 PM
Subject: send_keys not working after upgrading to latest S::R::D
To: Daniel Gempesaw <gemp...@gmail.com>


Hi Daniel,

After upgrading to latest S::R::D (v 1.0), send_keys is not working. I am getting the below error:

Error While Executing command: sendKeysToElement

Code Snippet:
$driver->find_element("//input[\@id='Password']")->send_keys("test123");

Here $driver is, firefox object. There is no problem with xpath.. The same code snippet working fine for chrome. Only I am facing issue with firefox.

Firefox Version: 48
Geckodriver : 0.10

Can You please help me out in this ? What wrong I am doing ?

Thanks in Advance,
Perumal

Daniel Gempesaw

unread,
Oct 4, 2016, 12:01:34 PM10/4/16
to Selenium Remote Driver, perumal pandian

Ah, so this issue has nothing to do with send_keys. Apparently, the response to find element (POST /session/:sessionId/element) is different between geckodriver and the selenium standalone server jar.

From geckodriver, the key that corresponds to the element ID has its own UUID on it:

REQ: POST, session/0a0af85d-6556-c74b-b324-697a98287f41/element, {"value":"div","using":"css selector"}
RES: {
    "value": {
        "element-6066-11e4-a52e-4f735466cecf": "e1ae9c33-85eb-2245-9273-af7da455aa75"
    }
}

whereas from RemoteDriver via standalone server jar, the key is simply ELEMENT:

REQ: POST, session/beabd546-b1a4-4cc0-baf6-bdd57c7d1332/element, {"value":"div","using":"css selector"}
RES: {
    "class": "org.openqa.selenium.remote.Response",
    "hCode": 1200604265,
    "sessionId": "beabd546-b1a4-4cc0-baf6-bdd57c7d1332",
    "state": "success",
    "status": 0,
    "value": {
        "ELEMENT": "0"
    }
}

I have opened an issue in geckodriver and I’m putting a workaround in for a bugfix release of S::R::D. Thanks for bringing this to my attention!

test script:

use strict;
use warnings;
use Selenium::Firefox;

my $ff = Selenium::Firefox->new;
# my $ff = Selenium::Remote::Driver->new; # for comparison
$ff->get('https://www.google.com');

$ff->debug_on;
my $search_bar = $ff->find_element('div', 'css');
# my $search_bar = $ff->find_elements('div', 'css');

$ff->quit;
Reply all
Reply to author
Forward
0 new messages