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

Jython 2.7 Port of Python Bindings #3988

Closed
lukeis opened this issue Mar 3, 2016 · 7 comments
Closed

Jython 2.7 Port of Python Bindings #3988

lukeis opened this issue Mar 3, 2016 · 7 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 3988

These small changes allow Jython use the Python Selenium WebDriver to control Chrome,
Firefox and Internet Explorer 32-bit. The changes don't break compatibility with Python
2.7. The diff files were created from the Python Selenium distribution, version 2.22.1.

The following steps will reproduce the problem and verify the fix.
1. Get a computer with Windows 7 64-bit.
2. Install Java 1.6.0_32 32-bit.
3. Set your JAVA_HOME environment variable to C:\Program Files (x86)\Java\jdk1.6.0_32
4. Prepend your PATH environment variable with %JAVA_HOME%\bin;
5. Install Jython 2.7.0a2 to the default location.
6. Apply the two small workarounds located at the following locations.
http://bugs.jython.org/issue1898
http://bugs.jython.org/issue1899
7. Install Distribute 0.6.27
8. Install Python Selenium 2.22.1
9. Download the file JythonSeleniumTest.py which is attached to this issue.
10. Download ChromeDriver.exe for Windows and place it either somewhere in your path
or in the same directory that contains JythonSeleniumTest.py
11. To verify the fix, apply the three small diff files that are attached to this issue.
12. Open a command prompt and run the following commands.
cd C:\Path\Containing\JythonSeleniumTest\
C:\jython2.7a2\jython.bat JythonSeleniumTest.py
C:\Python27\python.exe JythonSeleniumTest.py

Reported by varialus on 2012-05-30 03:14:10


- _Attachment: [common_utils.py.diff](https://storage.googleapis.com/google-code-attachments/selenium/issue-3988/comment-0/common_utils.py.diff)_ - _Attachment: [firefox_binary.py.diff](https://storage.googleapis.com/google-code-attachments/selenium/issue-3988/comment-0/firefox_binary.py.diff)_
@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by barancev on 2012-05-31 03:16:23

  • Labels added: Type-Enhancement, Component-WebDriver, Lang-Python
  • Labels removed: Type-Defect

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Please can you sign the CLA at http://goo.gl/qC50R

Reported by david.burns@theautomatedtester.co.uk on 2012-05-31 09:42:16

  • Labels removed: Status-Untriaged

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

These patches primarily fix issues I encountered while running Selenium 2.23.0 under
Jython 2.7.0a2 on Windows 7 64-bit with 32-bit Java. These patches also fix at least
one issue with the Internet Explorer web driver under Python 2.7.3 32-bit on Windows
7 64-bit.

Web Drivers Tested in Jython 2.7.0a2 and Python 2.7.3
Chrome
Firefox
IE 9 32-bit without IEWebDriverServer.exe
IE 9 32-bit with IEWebDriverServer.exe
IE 9 64-bit with IEWebDriverServer.exe

The following steps will reproduce the issues and verify the fix.
1. Get a computer with Windows 7 64-bit.
2. Install Java 1.6.0_32 32-bit.
3. Set your JAVA_HOME environment variable to C:\Program Files (x86)\Java\jdk1.6.0_32
4. Prepend your PATH environment variable with %JAVA_HOME%\bin;
5. Install Jython 2.7.0a2.
6. Apply the following two small workarounds.
http://bugs.jython.org/issue1898
http://bugs.jython.org/issue1899
7. Download and extract Distribute 0.6.27 from the following location.
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz#md5=ecd75ea629fee6d59d26f88c39b2d291
8. Install Distribute 0.6.27 with the following commands.
cd C:\Path\To\Directory\distribute-0.6.27
C:\Path\Containing\jython2.7a2\jython.bat setup.py install
9. Download and extract Selenium 2.23.0 from the following location.
http://pypi.python.org/packages/source/s/selenium/selenium-2.23.0.tar.gz#md5=a9e77c09cfc4db164c9b036666826058
10. Install Selenium 2.23.0 with the following commands.
cd C:\Path\To\Directory\selenium-2.23.0
C:\Path\Containing\jython2.7a2\jython.bat setup.py install
11. Download the file JythonSeleniumTest.py which is attached to this issue.
12. Download and extract chromedriver.exe from the following location.
https://chromedriver.googlecode.com/files/chromedriver_win_20.0.1133.0.zip
13. Copy chromedriver.exe either to the same directory that contains JythonSeleniumTest.py
or to a directory in your PATH environment variable.
14. Optionally download and extract IEDriverServer.exe from one of the following locations.
https://selenium.googlecode.com/files/IEDriverServer_Win32_2.23.0.zip
https://selenium.googlecode.com/files/IEDriverServer_x64_2.23.0.zip
15A. To verify the existing issues, do not apply the small diff files that are attached
to this issue.
15B. To verify the fix of the existing issues, apply the small diff files that are
attached to this issue.
16. Run the following commands.
cd C:\Path\To\Directory\Containing\JythonSeleniumTest.py\
C:\Path\Containing\jython2.7a2\jython.bat JythonSeleniumTest.py
C:\Python27\python.exe JythonSeleniumTest.py

Here are some errors that are fixed the diff files attached to this issue.
Error: selenium.common.exceptions.WebDriverException: Message: 'Can not connect to
the ChromeDriver'
Fix: common_utils.py.diff

Error: TypeError: args must contain only strings
Fix: firefox_binary.py.diff

Error without IEDriverServer: NotImplementedError: variadic functions not supported
yet;  specify a parameter list
Error with IEDriverServer: selenium.common.exceptions.WebDriverException: Message:
'{ "status" : 404, "sessionId" : "211f3d86-c68b-44fd-b752-b9daf7d60fa8", "value" :
"session 211f3d86-c68b-44fd-b752-b9daf7d60fa8 does not exist" }'
Fix: ie_webdriver.py.diff

Reported by varialus on 2012-06-11 21:04:03


- _Attachment: [JythonSeleniumTest.py](https://storage.googleapis.com/google-code-attachments/selenium/issue-3988/comment-4/JythonSeleniumTest.py)_ - _Attachment: [ie_webdriver.py.diff](https://storage.googleapis.com/google-code-attachments/selenium/issue-3988/comment-4/ie_webdriver.py.diff)_

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Here is a cross reference to a new unresolved Jython issue about the implementation
differences that make these Selenium patches necessary.

http://bugs.jython.org/issue1918

Reported by varialus on 2012-06-11 22:29:30

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I have updated your bug report on the jython bug tracker: I'm afraid that deferred socket
creation on jython is not an "unresolved issue": it is the only viable solution to
the problem of implementing the cpython socket API on jython.

http://bugs.jython.org/issue1918

As I have noted your bug report, I am open to updating the documentation so that this
point is made even more explicitly clear (though I thought that the documentation was
already clear enough on this point).

Reported by alan.kennedy.name on 2012-06-14 08:23:56

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

fixed in r17260

Reported by david.burns@theautomatedtester.co.uk on 2012-06-22 17:08:55

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 18:15:32

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 3, 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