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

Fail to Run Selenium RC scripts on grid #3054

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

Fail to Run Selenium RC scripts on grid #3054

lukeis opened this issue Mar 3, 2016 · 26 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 3054

Still fail to run selenium scripts from python even after updating starting commands:

1. Download on both machines: selenium-server-standalone-2.15.0.jar
Ubuntu: wget http://selenium.googlecode.com/files/selenium-server-standalone-2.15.0.jar

2. Run Selenium Grid Hub on 'gridhub' machine
java -jar /sem/sgrid2/selenium-server-standalone-2.15.0.jar -role hub

3. Run Remote Control on 'rchost' machine to connect to the Hub
Java -jar selenium-server-standalone-2.15.0.jar -role node -hubHost gridhub -hubPort
4444 -hub http://gridhub:4444/grid/register  -host rchost -port 8236

3. Run WebDriver on 'rchost' machine to connect to the Hub
Java -jar selenium-server-standalone-2.15.0.jar -role node -hubHost gridhub -hubPort
4444 -hub http://gridhub:4444/grid/register  -host rchost -port 8235

4. On python 
from selenium import selenium

selenium = selenium("localhost", 4444, "*firefox", "http://google.com/")
selenium.start()

Expected result: new session should be ready for scripts executions.

Actual Result: 

Grid Error with response for python test code

<html>
<head>
<title>Error 500 org.openqa.grid.common.exception.GridException: Error forwarding the
new session The server returned an error : </title>
</head>
<body>
<h2>HTTP ERROR: 500</h2><pre>org.openqa.grid.common.exception.GridException: Error
forwarding the new session The server returned an error : </pre>
<p>RequestURI=/selenium-server/driver/</p>
<p><i><small><a href="http://jetty.mortbay.org">Powered by Jetty://</a></small></i></p>



</body>
</html>

Java test code shows: 
java.lang.RuntimeException: Could not start Selenium session: Connection refused


It worked without errors with grid 2.9.0. 
But how to make selenium rc work on Grid2 now??? 

Related Issue 2756: Grid Hub shows DefaultRemoteProxy both for WebDriverRemoteProxy
and SeleniumRemoteProxy
- probably caused by it.

Reported by tatyana@sentilla.com on 2011-12-12 15:54:10

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Please rename this issues to
Fail to run Selenium RC scripts on grid

Reported by tatyana@sentilla.com on 2011-12-12 15:55:19

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by ajaykemparaj on 2011-12-13 03:12:12

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by barancev on 2011-12-13 07:00:34

  • Labels added: Component-RC, Component-Grid

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Added screenshot of Grid page for 2.15.0 which selenium is looking for: [Selenium2-10+RC_Error.jpg]

Broken backward compatibility of Selenium 2 with selenium 1?

Reported by tatyana@sentilla.com on 2011-12-13 18:57:03


- _Attachment: [Selenium2-10+RC_Error.jpg](https://storage.googleapis.com/google-code-attachments/selenium/issue-3054/comment-4/Selenium2-10+RC_Error.jpg)_

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Comparison of selenium-server versions 2.9.0 and 2.15.0 shows that 
selenium-server had lost listening on /selenium-server/driver path of the grid2. 

See attached screenshot with different 2.15.0 and 2.9.0 grid sessions [Selenium2-9vs15_Comparison]

Note: Actually, this feature have been lost since version selenium-server 2.10.0.

Reported by tatyana@sentilla.com on 2011-12-13 19:18:52


- _Attachment: [Selenium2-9vs15_Comparison.jpg](https://storage.googleapis.com/google-code-attachments/selenium/issue-3054/comment-5/Selenium2-9vs15_Comparison.jpg)_

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Possible solution: adding a simple redirect from "/selenium-server/driver" to "/wd/hub"
in selenium server probably may resolve the issue...

Reported by tatyana@sentilla.com on 2011-12-13 19:24:46

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

All active development is focused on Selenium 2.0 (the WebDriver APIs).  Updating issue
priority accordingly.

Reported by jmleyba on 2012-01-04 03:06:22

  • Labels added: Priority-Low

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I realize a fix for this issue isn't forthcoming in the 2.16.0 timeframe, but should
I expect a fix soon after that?  2.17.0 perhaps?  Basically, I just want to know if
I should go another way (2.9.0 and earlier) if this is going to be a low priority indefinitely.

Reported by bennychuck on 2012-01-04 16:04:40

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

While WebDriver is a priority, we need to keep the RC's working imo.  The fact that
the RC's haven't worked since 2.9 is pretty scary.  The longer this waits the farther
reaching the implications may be.  I look forward to when this is fixed and i can upgrade
our company's grid from 2.9.

Reported by jscharett@tlcdelivers.com on 2012-01-11 21:35:10

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Has this issue been resolved in the 2.17 release from the 16th ?

Reported by sirgeekcsp on 2012-01-19 20:45:44

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

No, 2.17 also has this issue. Are there any plans to fix this? This means that you cannot
use the Selenium grid with Selenium 1 clients!

Reported by m.ohlendorf on 2012-01-25 09:58:17

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

This is still an issue in 2.19.  Any comments from the developers?  Did it work in 2.9?
 We are setting up a new grid deployment with significant amounts of time invested
with selenium 1 scripts. Are the significant differences between server 2.9 and 2.19?

Reported by Jamie.Scott.Anderson on 2012-02-14 17:38:30

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

You may try to use the latest server (2.19 now) and RC version 2.9: it works in my environment,
shows correct identification for that RC client as "SeleniumRemoteProxy".

Reported by tatyana@sentilla.com on 2012-02-14 19:28:19

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

(I am just a user of this system, not a developer :)

Reported by tatyana@sentilla.com on 2012-02-14 19:29:00

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I noticed that the API changed which may be the issue I'm facing.  Haven't tested yet
though.  In 2.9, when configuring an RC node you give it the role RC, but looks like
the docs now specify role node.  It states its backwards compatible, but it doesn't
seem to work for "rc" only "wd".

Reported by jscharett@tlcdelivers.com on 2012-02-14 19:44:12

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

To make Selenium 1 work with Selenium 2 Grid, 
I use:
Hub: one of the latest version for Hub (2.15.0);
RC: version 2.9.0 with "-role rc", to make Selenium grid understand that it has SeleniumRemoteControl.
Command line example:

Java -jar selenium-server-standalone-2.9.0.jar -role rc -nodeTimeout 180  -hubHost
grid -hubPort 4444 -hub http://grid:4444/grid/register  -host rchost -port 5588 -browser
"browserName=*firefox,maxInstances=5,platform=WINDOWS"  -firefoxProfileTemplate "C:\sem\ff\ff4selenium"
-browser "browserName=*iehta,maxInstances=3,platform=WINDOWS"

The grid console shows SeleniumRemoteProxy at 
Address: http://grid:4444/grid/console

Grid Hub 2.15.0
---------------------------------------
SeleniumRemoteProxy
listening on http://rchost:5588
test session time out after 300 sec.
Supports up to 5 concurrent tests from: 
(f)(f)(f)(f)(f)(ie)(ie)(ie)
---------------------------------------

Test scripts are written on python, and the use and code is as described for Selenium
1.

But, unfortunately, this version of Selenium, 2.9.0, does not work with Firefox over
version 7 and Internet Explorer having version over 8: fails to test IE9, FF8, FF9...

So we had to start porting all our Selemiun1 (Python) based test code to Selenium 2
WebDriver (Java) to be able to test FF9 and IE9. And this is really time consuming
task as there is no WebDriver-Backed Selenium-RC for Python yet. Actually, all the
work was started from the scratch...

Reported by tatyana@sentilla.com on 2012-02-15 11:47:36

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I wound up converting all of my existing tests to use WebDriver, which was very time
consuming.  What's somewhat maddening is that it would probably take a lot less time
to just fix this bug.  At least where I work, when you break core functionality, you
fix it before moving on to something else instead of lowering the priority and sticking
your head in the sand.  

Reported by bennychuck on 2012-02-22 18:07:29

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Hello, guys! A have some surprise for you! See https://github.com/dirzhov/Python-WebDriver-Backed-Selenium-RC
You can join the development!

Reported by dirzhov on 2012-03-15 14:40:29

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by francois.reynaud on 2012-04-16 15:18:30

  • Status changed: Started

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Hi all, to get the Grid Node work with Selenium RC (ie. so that it responds to /selenium-server/driver
instead of /wd/hub), ensure that the node is launched with a browser argument that
includes 'seleniumProtocol=Selenium', eg.

Java -jar selenium-server-standalone-2.15.0.jar -role rc -hubHost localhost -browser
 browserName=*firefox,version=12,platform=MAC,seleniumProtocol=Selenium

I've tested this in Selenium 2.25.0, but not sure if this applies to older versions
or not...

Reported by piaross on 2012-07-24 11:35:19

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I can't get Grid working with RC. All requests to /selenium-server/driver return:

HTTP ERROR: 500

Problem accessing /selenium-server/driver/. Reason:

    java.lang.NullPointerException


HUB START:
 java -jar selenium-server-standalone-2.28.0.jar -role hub

NODE START:
java -jar selenium-server-standalone-2.28.0.jar -role node -hub http://127.0.0.1:4444/grid/register



So does Selenium support running RC under grid? I have 1000+ RC tests to support, so
"porting to webdriver" is not a viable solution at this point.

Reported by alienhard on 2013-01-28 18:09:34

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

# To install the Python client library:
# pip install -U selenium

When I execute this sample pyhton code,I get the following error 
"SyntaxError: multiple statements found while compiling a single statement" How do
I resolve this..

# Import the Selenium 2 namespace (aka "webdriver")
from selenium import webdriver




# Google Chrome
driver = webdriver.Chrome()

# Firefox
driver = webdriver.Firefox()

# ------------------------------
# The actual test scenario: Test the codepad.org code execution service.

# Go to codepad.org
driver.get('http://codepad.org')

# Select the Python language option
python_link = driver.find_elements_by_xpath("//input[@name='lang' and @value='Python']")[0]
python_link.click()

# Enter some text!
text_area = driver.find_element_by_id('textarea')
text_area.send_keys("print 'Hello,' + ' World!'")

# Submit the form!
submit_button = driver.find_element_by_name('submit')
submit_button.click()

# Make this an actual test. Isn't Python beautiful?
assert "Hello, World!" in driver.get_page_source()

# Close the browser!
driver.quit()

Reported by pavitra.maiya on 2013-04-30 12:09:21

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

This issue should be fixed by revision 8301806b3af6 and the fix is available in version
2.30+

If the issue is still actual please ask to reopen.

Reported by barancev on 2013-05-05 20:40:06

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

The issue is still actual in version 2.33

Reported by fuyao@douban.com on 2013-12-02 13:38:30

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

and 2.44

Reported by jes@praqma.net on 2014-11-24 12:36:35

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 18:14:23

  • 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