10 Replies Last post: Aug 20, 2008 5:22 AM by L7aNK  
Beginner 5 posts since
May 3, 2008
Currently Being Moderated

May 3, 2008 2:24 PM

414 Request URI Too Large

 

hello, I am using Selenium RC on Firefox 2.0.0.14 on FreeBSD 6.2 with JRE 1.6.

 

 

When I am trying to fill some text fields longer than lets say 1000 characters, i get following error:  414 Request URI Too Large.

 

 

I assume that is due to the fact that Selenium driver (i mean main window which drives the child frame or child window) is being question with GET requests, and those request seem to be too large, is there any solution for this?

 

 

 

 

Regards, T. Kraus

 

 

Haw-Bin Chai Master 515 posts since
May 19, 2006
Currently Being Moderated
3. May 14, 2008 9:32 PM in response to: balrog
Re: 414 Request URI Too Large

Hi,

 

You might want to file a JIRA ticket for this.

 

http://jira.openqa.org

 

  • Haw-Bin

 

Haw-Bin Chai Master 515 posts since
May 19, 2006
Currently Being Moderated
4. May 15, 2008 12:24 AM in response to: balrog
Re: 414 Request URI Too Large

I've confirmed this is an issue with the Perl driver (see http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/). I did not experience the issue using the Java driver.

 

  • Haw-Bin

 

Beginner 3 posts since
Apr 30, 2008
Currently Being Moderated
5. May 29, 2008 4:29 AM in response to: balrog
Re: 414 Request URI Too Large

Hi balrog

 

Could you point me to the Python fix please. I've tried replicating your code in python but I'm having some trouble with it.


def type(self,locator,value):
     """
     Sets the value of an input field, as though you typed it in.


     Can also be used to set the value of combo boxes, check boxes, etc. In these cases,
     value should be the value of the option selected, not the visible text.


     'locator' is an element locator
     'value' is the value to type
     """

     #My mod starts here. Taken from http://clearspace.openqa.org/message/43878
     max_chars = 2000;
     value_length = len(value)
     if value_length > max_chars:
          pos = 0;
          while pos<value_length:
               chunk = value[pos:max_chars]
               chunk = chunk.replace('"', '\\"')
               pos += max_chars;
               js_call = 'selenium.browserbot.findElement("%s").value += "%s";' % (locator, chunk)
               self.do_command("getEval", js_call)
               time.sleep(2)
     else:
          self.do_command("type", [locator,value,])

 

Thanks

 

fintan.

Haw-Bin Chai Master 515 posts since
May 19, 2006
Currently Being Moderated
6. May 29, 2008 10:56 AM in response to: fintan
Re: 414 Request URI Too Large

If you're using a fairly recent Selenium RC, you can build the Python driver from trunk, which has the fix. See SRC-321 (http://jira.openqa.org/browse/SRC-321).

 

  • Haw-Bin

 

 

Beginner 3 posts since
Apr 30, 2008
Currently Being Moderated
7. May 30, 2008 7:57 AM in response to: Haw-Bin Chai
Re: 414 Request URI Too Large

Thanks Haw-Bin Chai for the reply. How recent? I've 9.2 for the server and client. Would I need one of the release candidates?

Haw-Bin Chai Master 515 posts since
May 19, 2006
Currently Being Moderated
8. May 30, 2008 9:34 AM in response to: fintan
Re: 414 Request URI Too Large

9,2 should be fine for the Selenium server. You will have to build the python driver from trunk, though, as that was a very recent check-in. There are instructions here:

 

http://wiki.openqa.org/display/SRC/Developer%27s+Guide

 

  • Haw-Bin

 

Beginner 3 posts since
Apr 30, 2008
Currently Being Moderated
9. Jun 3, 2008 5:54 AM in response to: Haw-Bin Chai
Re: 414 Request URI Too Large

Thanks Haw-Bin, I'll give it a shot.

 

fintan.
 

L7aNK Beginner 2 posts since
Jul 30, 2008
Currently Being Moderated
10. Aug 20, 2008 5:22 AM in response to: balrog
Re: 414 Request URI Too Large

Hi all,

Thanks balrog for your code __, I like ruby and modified your code:

 

def type(locator,value)
          @MaxChars = 2000
          if !value.nil? then
            @ValLen =value.size
          end
          if (@ValLen > @MaxChars) && (!value.nil?) then
            @Pos = 0;
            @JSCall = sprintf("selenium.browserbot.findElement(\"%s\").value = \"%s\";", locator, nil)
            do_command("getEval", [@JSCall,]) 
            while (@Pos<@ValLen)
              @Chunk=value[@Pos,@MaxChars]
              @Chunk=@Chunk.sub(/\"/,"\\\"")
              @Pos += @MaxChars
              @JSCall = sprintf("selenium.browserbot.findElement(\"%s\").value += \"%s\";", locator, @Chunk)
                do_command("getEval", [@JSCall,])
              sleep 0.1
            end
          else
            do_command("type", [locator,value,])
          end
    end

More Like This

  • Retrieving data ...