Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

element.send_keys('.') tries to upload a file instead of sending the key to the input box using the grid #4608

Closed
lukeis opened this issue Mar 4, 2016 · 9 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 4608

Sending only the '.' over the grid returns a python error:

Traceback (most recent call last):
  File "sel4.py", line 17, in <module>
    element.send_keys('.')
  File "/home/florinstrugariu/.virtualenvs/marketplace/local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py",
line 144, in send_keys
    value = self._upload(local_file)
  File "/home/florinstrugariu/.virtualenvs/marketplace/local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py",
line 237, in _upload
    raise e
selenium.common.exceptions.WebDriverException: Message: u'invalid stored block lengths'
; Stacktrace: Method read threw an error in InflaterInputStream.java 






What steps will reproduce the problem?
Run the code 

from selenium import webdriver
from selenium.webdriver.common.by import By

capabilities = getattr(webdriver.DesiredCapabilities, 'FIREFOX')
capabilities['version'] = '14'
capabilities['platform'] = 'MAC'

executor = 'http://webqa.local:4444/wd/hub'

driver = webdriver.Remote(command_executor=executor, desired_capabilities=capabilities,
browser_profile=None)


driver.get("http://www.google.com")

element = driver.find_element_by_name("q")

element.send_keys('.')

element.get_attribute('value')


What is the expected output? What do you see instead?

The input box should contain the sent value

Selenium version:2.25.0
Grid: 2.25.0
OS:Windows
Browser:Firefox
Browser version: 14


Reported by bebef.1987 on 2012-09-24 16:30:09

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Can you try replicating with a local FirefoxDriver, and with a standalone server? I
doubt this issue is specific to Selenium grid.

Reported by dave.hunt on 2012-09-24 16:39:50

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

part of this has been fixed in r17837

Reported by david.burns@theautomatedtester.co.uk on 2012-09-24 17:03:59

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Tested this with the standalone server and I got the same result.


Traceback (most recent call last):
  File "sel4.py", line 17, in <module>
    element.send_keys('.')
  File "/home/florinstrugariu/.virtualenvs/marketplace/local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py",
line 144, in send_keys
    value = self._upload(local_file)
  File "/home/florinstrugariu/.virtualenvs/marketplace/local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py",
line 237, in _upload
    raise e
selenium.common.exceptions.WebDriverException: Message: u'invalid stored block lengths'
; Stacktrace: Method read threw an error in None 


and from the standalone console:

16:10:58.993 INFO - Executing: [new session: {platform=MAC, javascriptEnabled=true,
browserName=firefox, version=14}] at URL: /session)
16:11:09.250 INFO - Done: /session
16:11:09.256 INFO - Executing: org.openqa.selenium.remote.server.handler.GetSessionCapabilities@3edad7e
at URL: /session/1348578357317)
16:11:09.256 INFO - Done: /session/1348578357317
16:11:09.333 INFO - Executing: [get: http://www.google.com] at URL: /session/1348578357317/url)
16:11:13.587 INFO - Done: /session/1348578357317/url
16:11:13.592 INFO - Executing: [find element: By.name: q] at URL: /session/1348578357317/element)
16:11:15.036 INFO - Done: /session/1348578357317/element
16:11:15.042 INFO - Executing: org.openqa.selenium.remote.server.handler.UploadFile@6c93595a
at URL: /session/1348578357317/file)
16:11:15.049 WARN - Exception thrown
java.util.zip.ZipException: invalid stored block lengths
    at java.util.zip.InflaterInputStream.read(Unknown Source)
    at java.util.zip.ZipInputStream.read(Unknown Source)
    at java.util.zip.ZipInputStream.closeEntry(Unknown Source)
    at java.util.zip.ZipInputStream.getNextEntry(Unknown Source)
    at org.openqa.selenium.io.Zip.unzip(Zip.java:145)
    at org.openqa.selenium.io.Zip.unzip(Zip.java:123)
    at org.openqa.selenium.remote.server.handler.UploadFile.call(UploadFile.java:44)
    at org.openqa.selenium.remote.server.handler.UploadFile.call(UploadFile.java:1)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:150)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
16:11:15.053 WARN - Exception: invalid stored block lengths

Reported by bebef.1987 on 2012-09-25 13:12:04

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

also the issue is not reproducible using the Firefox driver:

driver = webdriver.Firefox()

Reported by bebef.1987 on 2012-09-25 13:13:21

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 4605 has been merged into this issue.

Reported by barancev on 2012-09-27 20:04:13

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2012-09-28 06:49:53

  • Labels added: Lang-Python

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I also get this with HtmlUnit
DesiredCapabilities.HTMLUNITWITHJS

Reported by redcoelho77 on 2012-12-04 16:39:20

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

This issue was closed by revision d9fd10fa7504.

Reported by luke.semerau on 2013-01-19 00:47:23

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:16:13

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
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

1 participant