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 is broken with Firefox 53 or newer and geckodriver 0.15.0 #659

Closed
danosoft77 opened this issue Apr 20, 2017 · 68 comments
Closed
Labels
Milestone

Comments

@danosoft77
Copy link

Firefox Version

53.0 (32 bit)

Platform

Windows 10

Steps to reproduce -

I use Python with Selenium and Geckodriver 0.15 , yesterday it work all ok with Firefox 52.0.2,
from today firefox update and it now 53.0 and my code do an error when i try to push a text in a input

username.send_keys("text")

it do this error :

selenium.common.exceptions.WebDriverException: Message: Expected [object Undefined] undefined to be a string

@zosrothko
Copy link

zosrothko commented Apr 20, 2017

Hi
Got the same exception with the latest Firefox Developer Edition. The same program Selenium2Example.java works fine with Firefox 52 while it fails with Firefox 54. See the attached log

Firefox_52.0.2 (32 bits).txt

Firefox_Developper_Edition_54.0a2 (2017-04-18) (64 bits).txt

Selenium2Example.java.txt

@zosrothko
Copy link

Does not work neither with Firefox 53

Firefox_53.0 (32 bits).txt

@danosoft77
Copy link
Author

danosoft77 commented Apr 20, 2017 via email

@andreastt andreastt changed the title Probelm : selenium.common.exceptions.WebDriverException: Message: Expected [object Undefined] undefined to be a string Element Send Keys is broken with Firefox 53 or newer and geckodriver 0.15.0 Apr 20, 2017
@andreastt
Copy link
Contributor

I took a look at the logs attached, and the problem is that a patch was uplifted from Firefox Nightly to Firefox 53 that makes the Marionette remote control protocol only accept a text field as part of the JSON body.

We have patched geckodriver master to accept text and convert it into the expected Marionette format. Until geckoriver 0.16.0 is released, you can build geckodriver yourself from master. Note that you will require the very latest Selenium version with 0.16.0, however.

@zosrothko
Copy link

Could you let this issue open until we can check that it is fixed by the release of geckoriver 0.16.0?

@andreastt
Copy link
Contributor

It has been fixed on master, which the issue tracker is tracking.

@zosrothko
Copy link

zosrothko commented Apr 20, 2017

ok, so can you add a label 0.16.0 then?

@JohnA2
Copy link

JohnA2 commented Apr 20, 2017

Until geckoriver 0.16.0 is released, you can build geckodriver yourself from master. Note that you will require the very latest Selenium version with 0.16.0, however.

Does the very latest Selenium version mean the latest release - 3.3.1, or should I also build it from master?

@danosoft77
Copy link
Author

danosoft77 commented Apr 20, 2017 via email

@andreastt
Copy link
Contributor

andreastt commented Apr 20, 2017

Does the very latest Selenium version mean the latest release - 3.3.1

I think 3.3.1 should be sufficient.

Ok but where i can download the 0.16.0 , and how i can build it?

0.16.0 has not been released yet, but build instructions are in the README.

@andreastt
Copy link
Contributor

Please note that “me too” comments are not valuable.

@KPKA
Copy link

KPKA commented Apr 21, 2017

When will 0.16.0 be released?

@andreastt
Copy link
Contributor

When it is done. That’s the best estimate I can give, sorry.

@jaykhimani
Copy link

Similar issue on Linux (ubuntu) as well following are the logs, in case it provides some more information.

Caused by: org.openqa.selenium.InvalidArgumentException: Expected [object Undefined] undefined to be a string
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'SFDWSLIN01', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-72-generic', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=/tmp/rust_mozprofile.5D8N1nchgBL3, rotatable=false, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=53.0, platformVersion=4.4.0-72-generic, moz:processID=5036, browserName=firefox, platformName=linux}]
Session ID: e48faf4b-5f89-4b5b-bdd1-a1a572eb55d4
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:133)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:99)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:43)

@emolinaibanez
Copy link

andreastt could you point me where is the README you refer please??
Thank you!

@andreastt
Copy link
Contributor

@praveenashok
Copy link

Hi emolinaibanez,
I tried from linux machine to build it and able to build it as below.
Do git clone of master geckodriver to your local machine.
go inside geckodriver folder.
You need to install curl & cargo(sudo apt install curl & sudo spt install cargo).
then run command "cargo build --release".
wait till it finishes, then you will find the built geckodriver file under "geckodriver/target/release".

@praveenashok
Copy link

praveenashok commented Apr 21, 2017

@andreastt I di build the master geckodriver.
Now with Firefox 53 version & selenium 3.3.1 its opening up the driver, but not entering the URL at all.

1492782738189 geckodriver INFO Listening on 127.0.0.1:18190
1492782738617 geckodriver::marionette INFO Starting browser /usr/lib/firefox/firefox.sh with args ["-marionette"]
1492782744005 Marionette INFO Listening on port 46233
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=null, logLevel=null, prefs={}, profile=org.openqa.selenium.firefox.FirefoxProfile@24fb6a80}, firefox_profile=org.openqa.selenium.firefox.FirefoxProfile@24fb6a80}], required capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=null, logLevel=null, prefs={}, profile=org.openqa.selenium.firefox.FirefoxProfile@24fb6a80}, firefox_profile=org.openqa.selenium.firefox.FirefoxProfile@24fb6a80}]
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'inblrlt-praveeng', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-19-generic', java.version: '1.8.0_112'
Driver info: driver.version: FirefoxDriver

@andreastt
Copy link
Contributor

@praveenashok I can’t tell what’s wrong from that alone. Could you paste the trace-level log from geckodriver somewhere? (See the README on how to crank up the log verbosity.)

@zosrothko
Copy link

OK will do it. Thanks

@nirjharb
Copy link

nirjharb commented May 7, 2017

Have tested this in FF 53, geckodriver-v0.16.1-win64, Windows 64 Bit, Selenium 3.4.0 and it passed. It is WORKING now. All, appreciate your help and guidance. Thank you!

@russcarter
Copy link

Not working with:

  • Win7 (64bit)
  • Python: v2.7.12 (win32bit) or v3.5.2 (32bit)
  • Selenium: v3.3.1 thru 3.4.1
  • FireFox Browser: v53.0 (32bit) thru v53.0.2 (32bit) ....but does work with v52.0
  • FireFox geckodriver.exe: v0.15.0 thru v0.16.1 (32bit)

I'll try to investigate the behavior from my logs, forum comments, and address it better in subsequent feedback (whether here and/or another bug).

@andreastt
Copy link
Contributor

@russcarter This has been confirmed fixed by several users, so I suspect you haven’t updated to the latest geckodriver, Selenium, and Firefox version. Please ensure you’re using Firefox Nightly for the best experience.

If it still does not work for you, you are welcome to file a new bug, but we will need a geckodriver trace-level log attached to it.

@pichai-t
Copy link

Thank you everyone (especially @andreastt and @danosoft77)

This page helped me a lot. My configurations as below.

  • Win7 (64 bit)
  • C# (with SpecFlow)

  • Selenium 3.4.0 (.Net 4.0)
  • FireFox 53.0.3 (released 19 May 17)
  • geckodriver (v0.16.1-win64)

@abalonperin
Copy link

Working with:

  • macos = 10.12.4
  • geckodriver = 0.17
  • firefox = 53.0.3
  • selenium = 3.4.0

@andreastt, thank you for fixing the issue.

@BrandonDudek
Copy link

BrandonDudek commented Jun 15, 2017

(Moved to 786)

Still an Issue for:

Selenium: 3.4
Java: 1.8
geckodriver: 0.17.0
Firefox: 54.0 (32 & 64 bit)
Windows: 7

What I tried:
WebDriver.get( "https://www.google.com" );
WebDriver.findElement( By.xpath( "/html/body" ) ).sendKeys( Keys.chord( Keys.CONTROL, "n" ) );

Result:
Nothing Happens.

Note: I can still send normal keys to an input element.

@7k50
Copy link

7k50 commented Jun 18, 2017

Seem to be having same issue with:

Selenium: 3.4.3
Python 2.7.13.
geckodriver: 0.17.0
Firefox: 54.0
macOS: 10.12.5

@HansAarneLiblik
Copy link

Are you using proxy ? If so, you have to strip the port from 'httpProxy' element and add it to 'httpProxyPort' element.

String port = proxy.getHttpProxy().substring(proxy.getHttpProxy().indexOf(":") + 1);
String host = proxy.getHttpProxy().substring(0, proxy.getHttpProxy().indexOf(":"));
JsonObject proxyJson = new JsonObject();
proxyJson.addProperty("proxyType", "manual");
proxyJson.addProperty("httpProxy", host);
proxyJson.addProperty("httpProxyPort", Integer.valueOf(port));
capabilities.setCapability(CapabilityType.PROXY, proxyJson);

This fix solved the issue for me

@7k50
Copy link

7k50 commented Jun 19, 2017

I'm personally not using proxy, but thanks for the info/fix!

@wholewheattoast
Copy link

Also currently having this issue. Let me know if I can provide other helpful details.

  • selenium==3.4.1
  • marionette-driver==2.2.0
  • Firefox: 54.0 (64-bit)
  • MacOs: 10.12.5

@sagar3715
Copy link

I go this same issue I solved this issue by watching this video
https://www.youtube.com/watch?v=exYl-pSVTSs&t=1029s

@7k50
Copy link

7k50 commented Jul 10, 2017

@sagar3715 In what way does the video help with the issue?

@asrafiq
Copy link

asrafiq commented Jul 24, 2017

C# workaround:
driver.Manage().Window.Size = new Size(1920, 1080);

@mdul
Copy link

mdul commented Jul 24, 2017

also c#:

                int screenWidth = Screen.PrimaryScreen.Bounds.Width;
                int screenHeight = Screen.PrimaryScreen.Bounds.Height;
                driver.Manage().Window.Size = new Size(screenWidth, screenHeight);

@chuan-qin
Copy link

chuan-qin commented Jul 25, 2017

@sagar3715 the video is removed. What is the video about?

Anyone had similar issue with geckodriver 0.18? sendKeys(protractor.Key.SPACE) doesn't work.

@Rain9333
Copy link

I have the same issue now with Firefox 55.0.1 & 55.0.2 x64 with geckodriver 0.18.0 x64. On file upload button/dialog and SendKeys (C#) -> File not found (IndexOutOfBounds) where file is there and pass as full path (string).

@udos
Copy link

udos commented Aug 18, 2017

@Rain9333: I run into the same issue and was able to "fix" by downgrading Firefox from 55.0.2 to 54.0.1 -> see https://stackoverflow.com/questions/45742958/selenium-common-exceptions-webdriverexception-message-file-not-found-path-to/45753912#45753912

@Rain9333
Copy link

@udos yeah - if downgrading is OK. I also found another workaround until its proper resolved (I need the SendKeys for uploading a file). So just add this to the driver's options:
options.SetPreference("dom.file.createInChild", true);

@7k50
Copy link

7k50 commented Sep 8, 2017

How can I set dom.file.createInChild to True with Python?

I tried adding it as a profile preference: firefox_profile.set_preference("dom.file.createInChild", True) and capability firefox_capabilities["dom.file.createInChild"] = True but neither seem to work.

Not sure if I'm doing it right.

@whimboo
Copy link
Collaborator

whimboo commented Sep 11, 2017

@winterflags for file upload issues there is issue #858. So for the workaround in Firefox 55 see #858 (comment).

@7k50
Copy link

7k50 commented Sep 11, 2017

@whimboo Just for clarity, I don't need to upload a file, but rather to open new tab and close tab via Python:

driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND + 't')
driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND + 'w')

I supposed that JavaScript's options.SetPreference("dom.file.createInChild", true); was a temporary fix to that because of comment #659 in this thread. But perhaps it doesn't help with tabs.

@whimboo
Copy link
Collaborator

whimboo commented Sep 11, 2017

You cannot use Command+T or Command+W because that would require chrome privileges. For more details see issue #786.

@Fatimi
Copy link

Fatimi commented Oct 5, 2017

Currently I am facing issue with firefox

Selenium Version = 3.6
Firefox Version = 56.0 (64 Bit)
Windows 7

Following is my Code , Issue i m facing browser gets open enter the URL the login but when I try to get the title and print browser is not executing any driver. class on browser page.

  • not getting the title
  • not finding any element

package auto_Procurement;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class procurement_auto {

public static void main(String[] args) throws IOException {
	System.setProperty("webdriver.gecko.driver", "C:/Users/aamir.fatimi/Downloads/geckodriver-v0.19.0-win64/geckodriver.exe");

	WebDriver driver = new FirefoxDriver();
	driver.get("http://dbu-export-09/en/Pages/default.aspx");
	Runtime.getRuntime().exec("C:\\Users\\aamir.fatimi\\Desktop\\AutoIT\\Autoit.exe");
	driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
	String get_Title = driver.getTitle();
	System.out.println("Title is" + get_Title);
	driver.quit();
}

}

Logs 👍

1507199865260 geckodriver INFO geckodriver 0.19.0
1507199865268 geckodriver INFO Listening on 127.0.0.1:23773
1507199865989 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "-marionette" "-profile" "C:\Users\AAMIR~1.FAT\AppData\Local\Temp\rust_mozprofile.W8diIkeLeheg"
1507199866317 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1554" data: no] Stack trace: loadExtensionState()@resource://gre/modules/addons/XPIProvider.jsm:1554 < getInstallState()@resource://gre/modules/addons/XPIProvider.jsm:1589 < checkForChanges()@resource://gre/modules/addons/XPIProvider.jsm:3109 < startup()@resource://gre/modules/addons/XPIProvider.jsm:2188 < callProvider()@resource://gre/modules/AddonManager.jsm:269 < _startProvider()@resource://gre/modules/AddonManager.jsm:739 < startup()@resource://gre/modules/AddonManager.jsm:906 < startup()@resource://gre/modules/AddonManager.jsm:3090 < observe()@jar:file:///C:/Program%20Files/Mozilla%20Firefox/omni.ja!/components/addonManager.js:65
1507199867297 Marionette INFO Enabled via --marionette
Unable to read VR Path Registry from C:\Users\aamir.fatimi\AppData\Local\openvr\openvrpaths.vrpath
[Child 30472] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 30472] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
1507199870595 Marionette INFO Listening on port 51760
1507199870722 Marionette WARN TLS certificate errors will be ignored for this session
1507199870786 Marionette DEBUG Register listener.js for window 4294967297
Oct 05, 2017 3:37:50 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
1507199870905 Marionette DEBUG Received DOM event "beforeunload" for "about:blank"
Exception in thread "main" org.openqa.selenium.UnhandledAlertException: :
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'KHILT-1573', ip: '192.168.142.193', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=C:\Users\aamir.fatimi\AppData\Local\Temp\rust_mozprofile.W8diIkeLeheg, rotatable=false, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, moz:headless=false, platform=XP, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=true, browserVersion=56.0, platformVersion=6.1, moz:processID=30932, browserName=firefox, javascriptEnabled=true, platformName=XP}]
Session ID: 0db44e36-7403-4dc2-bc6d-533f856d57cb
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:118)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:643)
at org.openqa.selenium.remote.RemoteWebDriver.getTitle(RemoteWebDriver.java:314)
at auto_Procurement.procurement_auto.main(procurement_auto.java:22)

@whimboo
Copy link
Collaborator

whimboo commented Oct 9, 2017

@Fatimi please don't hi-jack this issue. If you have a problem please file a new issue and make sure to add a trace log. The above isn't one. Thanks.

@michelleXIE2014
Copy link

michelleXIE2014 commented Oct 18, 2017

Firefox: 56.0
Geckodriver: 0.19.0
selenium: 3.6.0
Java: 1.8
OS: mac Version 15.6.0

sendKeys is not working, just stuck there, even no any log and timeout.

@whimboo
Copy link
Collaborator

whimboo commented Oct 19, 2017

I'm going to lock this issue now given that the basic issue is fixed. Maybe related ones exist but those should be handled separately.

Therefore if you still have problems please file a new issue with a trace level log included. A simple "me too" as given in the last comments here is sadly not that helpful to us. Thanks.

@mozilla mozilla locked and limited conversation to collaborators Oct 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests