SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

Getting an "XHR error Response_Code = 500" on running test with latest senelium server 1.0.3 #408

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 408

In order to run test suite on Firefox 3.6, I upgraded existing selenium 
server 1.0.1 to 1.0.3. But immediately after replacing latest selenium-
server.jar I have been getting an error "XHR ERROR: URL = 
http://localhost:8080/app/ Response_Code = 500 Error_Message = Internal 
Server Error on session 9201117329044c9dbc146dcdb7c77cc5" 

I am getting an error with the latest selenium server only. Same test is 
running fine with older selenium server (1.0.1) on Firefox 3.0.x

I am running test on windows XP OS.

Any pointers or input is highly appreciated.

Reported by mehta.pritesh on 2010-03-05 11:08:48

lukeis commented 8 years ago
Could this be related to bug 400?

Reported by testautomationblog on 2010-03-05 18:46:41

lukeis commented 8 years ago
It is smilar problem. but I have been getting Response code 500 on executing open 
command. It occurs with  *chrome and *firefox both mode. 

Kindly let me know if you need more detail and if there is any workaround to get rid

this issue.

Reported by mehta.pritesh on 2010-03-08 05:06:16

lukeis commented 8 years ago
I am getting the same issue for firefox 3.6
[INFO] SeleniumException: XHR ERROR: URL = http://my-secret-url.com Response_Code =
500 Error_Message = javax.servlet.ServletException: Original SevletResponse or
wrapped original ServletResponse not passed to RequestDispatcher in violation of
SRV.8.2 and SRV.14.2.5.1

Server Providing this Error Message is a JBoss 4.2.3

Reported by Lange.Fabian on 2010-03-10 10:59:21

lukeis commented 8 years ago
I'm guessing that this is always happening on the 'open' command. There was a bug where
a feature that was 
supposed to be disabled / transparent to the user wasn't nearly disabled enough. I
believe I have fixed this in 
svn, but does it resolve itself if you pass "true" as an additional argument to the
open command?

Reported by adamgoucher on 2010-03-10 13:02:18

lukeis commented 8 years ago
I am able to get around the XHR error by providing "true" as a second argument in 
open command but I am wondering how would I do the same in selenium.open() method?
I 
am using java as scripting language.

Reported by mehta.pritesh on 2010-03-10 13:48:13

lukeis commented 8 years ago
We have the same problem. After reading the suggestion from Adam above, I tried this,
with success:

        selenium = new DefaultSelenium("localhost", port, browserString, url) {
            public void open(String url) {
                commandProcessor.doCommand("open", new String[] {url,"true"});
            }
        };

Reported by thomas.gronwall on 2010-03-12 12:13:59

lukeis commented 8 years ago
thomas.gronwall provided copy&pasable code that solved the problem for me as well.
Looking forward to a version with this fix

Reported by Lange.Fabian on 2010-03-12 12:43:17

lukeis commented 8 years ago
The problem is that with cubictest this fails miserably as i cant modify the open code

This needs a quick fix for cubictest !

I will notify Christian Schwarz about this issue

Reported by thomas.eitzenberger on 2010-03-15 09:59:29

lukeis commented 8 years ago
For PHP Selenim, you can put this hack on Driver.php, around line 714:

                } else {

                    //patch to ignore XSR errors
                    if ($command == 'open') $arguments[] = 'true'; //add me

                    $this->doCommand($command, $arguments);
                }

Reported by npmnpm on 2010-03-26 12:44:24

lukeis commented 8 years ago
I am very new to Selenium. How can I call open() with true using SeleneseTestCase. 
Did not have any luck with TestCase and using default either. In my case, one of our

prodct url seems to be not working at all. It works using https but not http. I am

using selenium-remote-control-1.0.3.

Thanks.

-- rr

Reported by rehana.rahman on 2010-05-06 14:43:57

lukeis commented 8 years ago
@thomas.gronwall can you please provide your entire code?

Reported by hspatalia on 2010-05-11 07:59:33

lukeis commented 8 years ago
 thomas.gronwall could you please provide the code for dot net to solve this "XHR
error Response_Code = 500" 

Reported by AarenFelix on 2010-05-14 07:19:56

lukeis commented 8 years ago
@hspatalia
What you want to do is replace your call to setUp(url,browserString) with a manual

creation of the DefaultSelenium object, as per thomas.gronwall's post.  You then have

to make a call to the selenium.start() method.

-- setUp(url,browserString);
++ selenium = new DefaultSelenium("localhost", port, browserString, url) {
++          public void open(String url) {
++              commandProcessor.doCommand("open", new String[] url,"true"});
++          }
++        };
++ selenium.start();

@AarenFelix
I am not familiar with the dot net source but I believe the above explanation should

be easily translatable.

Reported by Kerr.Richard on 2010-05-14 10:37:21

lukeis commented 8 years ago
This has been fixed in r8480 and r8558 by adamgoucher. The latest Selenium 2.0 alpha

contains the fix, but Selenium 1.x hasn't been built since the fix was committed.

Reported by dave.hunt on 2010-05-14 16:25:29

lukeis commented 8 years ago
I've also experienced this problem when attempting to use SelRC to run scripts
created with SelIDE. After doing some research, found this thread, downloaded
selenium-server-2.0a4.jar and found that it fixed the problem.

TY Selenium team.

Reported by Kevin.Homer on 2010-06-01 20:02:32

lukeis commented 8 years ago
any plan to apply this patch to the 1.x release?

Reported by smurfdaddy on 2010-06-09 16:55:41

lukeis commented 8 years ago
I /believe/ it is already in the most current 1.x release. If not, it is perfectly safe
to use the 2.x jar for 1.x work (it is backwards compatible) is you can get over the
fact it is labeled 'a4'.

Reported by adamgoucher on 2010-06-09 17:57:33

lukeis commented 8 years ago
I am having trouble trying to build r8558, is it possible somebody could attach a fixed
version of the 1.0.3 jar or email it to me at lees.d.a@gmail.com?

Reported by lees.d.a on 2010-06-11 09:57:47

lukeis commented 8 years ago
Slight typo in solution..Posting a correction that might save some newbies (like me)
some angst...
Replace setUp(...) with

Integer port = 4444;
String browserString= "*firefox";
String url = "http://yoururl.com";
selenium = new DefaultSelenium("localhost",port,browserString,url) {
public void open(String url) { commandProcessor.doCommand("open", new String[] {url,"true"});};
selenium.start();

And that's pretty much how selenium.open() can be overloaded with the true operator.

Reported by rsud79 on 2010-06-18 18:43:14

lukeis commented 8 years ago
When I try to download selenium-server-2.0a4.jar from here, I get a corrupted jar.

http://code.google.com/p/selenium/source/browse/repository/org/seleniumhq/selenium/selenium-server/2.0a4/?r=8888

Reported by ardjang@yahoo.co.uk on 2010-07-06 13:42:50

lukeis commented 8 years ago
verfy.
Thanks so much.

Replace setUp(...) with

        Integer port = 4444;
        String browserString= "*firefox";
        String url = "http://172.19.16.122:8080/jmx-console/";
        selenium = new DefaultSelenium("localhost",port,browserString,url) {
        public void open(String url) { commandProcessor.doCommand("open", new String[] {url,"true"});};
        };
        selenium.start();

Reported by Solon.Huang on 2010-07-14 06:22:41

lukeis commented 8 years ago
Guys,

the problem which i am facing is .. when using firefox 3.5 & Selenium RC 1.0.3
XHR ERROR: URL = https://**.**.**.**/login.htm Response_Code = -1 Error_Message = Request
Error.
This code works fine for *iexplore.

Any help...!!

Reported by mayank.chandravanshi on 2010-07-28 09:18:19

lukeis commented 8 years ago
I am having the same problem. I have been usinf Selenium for a while, and every thing
was fine.

   [jdk1-6]     Caused an ERROR
   [jdk1-6] XHR ERROR: URL = https://cheekit.da.troony.com/frda/tradegard/invoiceApple.htm?brand
ing=tradegard Response_Code = 500 Error_Message = Internal Server Error
   [jdk1-6] com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = https://checkout.qa.tradegard.com/se
curePayment/troonie/invoicefreed.htm?branding=tradegard Response_Code = 500 Error_Message
= Internal Server
 Error
   [jdk1-6]     at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCo
mmandProcessor.java:97)

Reported by H0000H on 2010-07-28 19:54:22

lukeis commented 8 years ago
I've tried using the code in comment 21 but,  I get the error "A namespace does not
directly contain members such as fields or methods" at the selenium.start() line.

Reported by DazAdams on 2010-08-19 13:48:55

lukeis commented 8 years ago
Got the same problem as the comment 22.  Applied solution from comment 5 and 21, it
works with both "*iexplore" and "*firefox". 

This exception only shows with firefox. 
com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL =  https://xxx/CustomerLogin
Response_Code = -1 Error_Message = Request Error
    at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)

This is the exception on the same problem in IE (which is a bit misleading). com.thoughtworks.selenium.SeleniumException:
Timed out after 30000ms
    at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)

Reported by sawatdiphong on 2010-08-25 16:22:05

lukeis commented 8 years ago
Issue 685 has been merged into this issue.

Reported by theautomatedtester on 2010-10-30 18:30:24

lukeis commented 8 years ago
Issue 685/Comment 22 (where Response_Code = -1, not 500—is this really a dupe?) appears
to be OS-dependent. I saw this issue for the first time right after updating from 1.0.1
to 1.0.3, but only under Linux (Ubuntu Karmic). Against the same version of FireFox
under Windows (Firefox 3.6.12 under Windows Server 2008 SP2), I'm not seeing this,
nor any other new issues.

Solon.Huang: Your workaround (comment 21) worked for me, too. But under Linux, the
test browser windows didn't close until Selenium Server was stopped. This problem did
not occur in 1.0.1 (without the workaround), nor under Windows (with the workaround).
I fixed this by adding a call to selenium.stop() in the tearDown method.

Also, could somebody tell me how to submit to this forum without Google posting my
address for every spammer in the world to see? So much for doing no evil.

MS.

Reported by selenium@michaelscheper.com on 2010-11-02 19:56:05

lukeis commented 8 years ago
Any idea how do I do this in Ruby. The above exmaples of php and .net did not help me.

Reported by sabu.thaliyath on 2010-11-18 07:12:58

lukeis commented 8 years ago
@ sabu.thaliyath
That's pretty easy...
Try to find the file 'legacy_driver.rb' in your gems library, for example, path from
my machine is 
'C:\Ruby186\lib\ruby\gems\1.8\gems\selenium-client-1.2.18\lib\selenium\client'
Hope you can find a similar one on your machine...

Change the open method as below:
        def open(url)
            remote_control_command("open", [url,"true"])
        end

Reported by igrowheart on 2010-11-18 15:59:04

lukeis commented 8 years ago
Got the same problem as the comment 22,25.

The exception:
com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = https://my application
here/ Response_Code = -1 Error_Message = Request Error
    at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
    at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
    at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:353)
    ... ...

When I just change the setUp() follow the comment 5 and 21, I get another error:

As there is these sentense in test function:
proc.doCommand("flexMonkey", new String[] {"<UIEvent command=\"SelectText\" value=\"txtUserName\"
prop=\"automationName\">\n  <arg value=\"0\"/>\n  <arg value=\"0\"/>\n</UIEvent>",
""});

New Exception:
com.thoughtworks.selenium.SeleniumException: Timed out after 30000ms
    at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
    at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
    at testcase.CreateUserTestCase1$1.open(CreateUserTestCase1.java:27)
        ... ...

My Env:
Server: Selenium-RC 1.03
UTA: Flex Application (FlexBuilder 3 SDK 3.2)
Remote Server: True
Selenium IDE
FlexMonkium
SSL: HTTPS

Reported by fuyoucaoyu1988@163.com on 2010-11-19 09:14:14

lukeis commented 8 years ago
I switch to Selenium 2.0, it works.

Reported by jevonsguo1980 on 2010-12-09 08:50:24

lukeis commented 8 years ago

Reported by antlong on 2011-01-24 18:21:50

lukeis commented 8 years ago
I got error 
Selenium::CommandError: XHR ERROR: URL = http://localhost:3000/tester/home Respo
nse_Code = 500 Error_Message = Internal Server Error

when i want to run script by "ruby utest.rb" command

i m using selenium IDE 1.0.10

And i also apply Change the open method as below:
        def open(url)
            remote_control_command("open", [url,"true"])
        end
 but its not usefull for me,please help me.

Reported by rathodmadhu on 2011-03-09 11:00:13

lukeis commented 8 years ago
Instead of calling @browser.open, try this...

@browser.remote_control_command("open", [url, true])

NOTE: The true is a boolean here as opposed to a string. 

Reported by bsends on 2011-03-09 19:55:57

lukeis commented 8 years ago
@bse...@gmail.com its not use full for me give me some other solution..

Reported by rathodmadhu on 2011-03-10 06:08:43

lukeis commented 8 years ago
my code which i run by "ruby file.rb" command

require "test/unit"
require "rubygems"
gem "selenium-client"
require "selenium/client"

class U_giv_test < Test::Unit::TestCase

  def setup
    @verification_errors = []
    @selenium = Selenium::Client::Driver.new \
      :host => "localhost",
      :port => 4444,
      :browser => "*chrome",
      :url => "http://localhost:3000/",
      :timeout_in_second => 360

    @selenium.start_new_browser_session
  end

  def teardown
    @selenium.close_current_browser_session
    assert_equal [], @verification_errors
  end

  def test_u_giv_test
    @selenium.open "/tester/home"
    @selenium.click "link=www.nelbee.com"
    @selenium.wait_for_page_to_load "600000"
    @selenium.type "project_reply_project_reply_answers_attributes_0_answer", "ggggggg"
    @selenium.type "project_reply_project_reply_answers_attributes_1_answer", "gggggg"
    @selenium.type "project_reply_project_reply_answers_attributes_2_answer", "gggggggggg"
    @selenium.click "project_reply_submit"
    @selenium.wait_for_page_to_load "600000"
    @selenium.click "link=Offene Aufträge"
    @selenium.wait_for_page_to_load "600000"
    @selenium.click "link=Beendete Aufträge"
    @selenium.wait_for_page_to_load "600000"
    @selenium.click "link=Einstellungen"
    @selenium.click "link=Konto verwalten"
    @selenium.wait_for_page_to_load "600000"
    @selenium.click "link=Bearbeiten"
    @selenium.wait_for_page_to_load "600000"
    @selenium.type "user_company", "TCSc"
    @selenium.click "user_submit"
    @selenium.wait_for_page_to_load "600000"
  end
end
require "test/unit"
require "rubygems"
gem "selenium-client"
require "selenium/client"

class U_giv_test < Test::Unit::TestCase

  def setup
    @verification_errors = []
    @selenium = Selenium::Client::Driver.new \
      :host => "localhost",
      :port => 4444,
      :browser => "*chrome",
      :url => "http://localhost:3000/",
      :timeout_in_second => 360

    @selenium.start_new_browser_session
  end

  def teardown
    @selenium.close_current_browser_session
    assert_equal [], @verification_errors
  end

  def test_u_giv_test
    @selenium.open "/tester/home"
    @selenium.click "link=www.nelbee.com"
    @selenium.wait_for_page_to_load "600000"
    @selenium.type "project_reply_project_reply_answers_attributes_0_answer", "ggggggg"
    @selenium.type "project_reply_project_reply_answers_attributes_1_answer", "gggggg"
    @selenium.type "project_reply_project_reply_answers_attributes_2_answer", "gggggggggg"
    @selenium.click "project_reply_submit"
    @selenium.wait_for_page_to_load "600000"
    @selenium.click "link=Offene Aufträge"
    @selenium.wait_for_page_to_load "600000"
    @selenium.click "link=Beendete Aufträge"
    @selenium.wait_for_page_to_load "600000"
    @selenium.click "link=Einstellungen"
    @selenium.click "link=Konto verwalten"
    @selenium.wait_for_page_to_load "600000"
    @selenium.click "link=Bearbeiten"
    @selenium.wait_for_page_to_load "600000"
    @selenium.type "user_company", "TCSc"
    @selenium.click "user_submit"
    @selenium.wait_for_page_to_load "600000"
  end
end
 then i got error please solve this.........

Reported by rathodmadhu on 2011-03-10 06:28:03

lukeis commented 8 years ago
The solution to this is to update your server. 2.0b2 is the current one and includes
the RC API with fixes. The 'beta' label is more for the WebDriver component.

Closing.

(Oh, and for the person doing the Ruby code here; you should switch to the selenium-webdriver
gem as selenium-client has been abandoned)

Reported by adamgoucher on 2011-03-10 12:15:24

lukeis commented 8 years ago
Hello, I run into the same problem.

My question here is, instead of using Selenium RC's way (DefaultSelenium) of starting
the browser, I'm using Selenium Grid way to start the browser (ThreadSafeSeleniumSessionStorage.startSeleniumSession(seleniumHost,
seleniumPort, browser, url) ). In this case, how do I go about this problem? 

Help is kindly appreciated!

Reported by annjeelee on 2011-03-10 12:31:34

lukeis commented 8 years ago
@ adam_gou...@hotmail.com i m updating server with 2.0b2 & than i got following error

Loaded suite utest
Started
Wed Mar 16 11:05:47 +0530 2011 selenium-client received failure from selenium se
rver:
requested:
        cmd=click
        1=link=www.nelbee.com
        sessionId=a8b27f64d90042879442506a5d5ea58d
received:
        "ERROR: Element link=www.nelbee.com not found"
        called from c:/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'
E
Finished in 7.209 seconds.

  1) Error:
test_u_giv_test(U_giv_test):
Selenium::CommandError: ERROR: Element link=www.nelbee.com not found
    c:/ruby/lib/ruby/gems/1.8/gems/selenium-client-1.2.18/lib/selenium/client/pr
otocol.rb:13:in `remote_control_command'
    c:/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'
    c:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout'
    c:/ruby/lib/ruby/gems/1.8/gems/selenium-client-1.2.18/lib/selenium/client/pr
otocol.rb:11:in `remote_control_command'
    c:/ruby/lib/ruby/gems/1.8/gems/selenium-client-1.2.18/lib/selenium/client/id
iomatic.rb:149:in `click'
    utest.rb:27:in `test_u_giv_test'

1 tests, 1 assertions, 0 failures, 1 errors

i can't understand what going on in this,same code is successfully run on selenium
IDE 1.0.10 but not on selenium Rc, please help me...

Reported by rathodmadhu on 2011-03-16 05:46:03

lukeis commented 8 years ago
I'm having the same problem of comment 40. Selenium Grid's latest version is 1.0.8,
there's no 2.0 with the fix everybody talks about on this thread. 

Is it possible to "merge" the Grid with the RC code in order to get the bug fixed?
I'm going to try the overwriting of the open function but it would be extremely better
if it could be fixed with the new version.

Thanks

Reported by anabelina@kentriki.com on 2011-03-28 05:48:11

lukeis commented 8 years ago
I get this bug with Selenium Grid 1.0.8, too. Fixed it with overriding seleniums open
procedure and throw that exception away. Dunno why status is "Fixed" in that case.

Reported by kawaklx650 on 2011-04-06 14:54:54

lukeis commented 8 years ago
Hi

I have been getting this same error when using selenium version 2.5. i am pretty new
to this and i am using ROBOIDE for writing test cases. how actually can i give this
additional "true" argument and where/which file needs to be modified for this. please
help in this

Thanks

Reported by psgkishore on 2011-08-19 06:51:49

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 17:48:57