Selenium RC HTTP HEAD then GET

378 views
Skip to first unread message

Stephen

unread,
Mar 16, 2010, 10:54:34 AM3/16/10
to Selenium Users
Hi,

I'm using Selenium IDE to develop my tests and have created a
controller within my web app that allows Selenium to create data by
doing a HTTP GET with some URL parameters.

This works fine when testing using Selenium IDE - however when using
RC each GET is preceeded by a HEAD. I'm aware that GET shouldn't
change state but why is the RC server doing this when the IDE doesn't?

Many thanks for any ideas you may have (including another way to
assert data)

Cheers,

Stephen

Sergey N. Didyk

unread,
Apr 1, 2010, 4:04:27 PM4/1/10
to Selenium Users
Hello!

I have got the same problem with Selenium RC 1.0.3 (and Firefox 3.6.2)

Is there a solution?

On 16 мар, 18:54, Stephen <step...@eccostudio.com> wrote:
> Hi,
>
> I'm using Selenium IDE to develop my tests and have created a
> controller within my web app that allows Selenium to create data by
> doing a HTTP GET with some URL parameters.
>
> This works fine when testing using Selenium IDE - however when using

> RC each GET is preceeded by aHEAD. I'm aware that GET shouldn't

qaessentials

unread,
Apr 6, 2010, 9:50:55 AM4/6/10
to Selenium Users
I have the same issue with Selenium-RC sending a HEAD before each
GET. It won't necessarily be a problem except the HEAD is on the same
TCP connection as the GET which is making it event worst. I have
looked through the code but I get lost when I start looking into the
java script code. I am using firefox.

Any help would be greatly appreciated.

On Apr 1, 4:04 pm, "Sergey N. Didyk" <sergey.di...@gmail.com> wrote:
> Hello!
>
> I have got the same problem with Selenium RC 1.0.3 (and Firefox 3.6.2)
>
> Is there a solution?
>

> On 16 ÜÐà, 18:54, Stephen <step...@eccostudio.com> wrote:
>
>
>
> > Hi,
>
> > I'm using Selenium IDE to develop my tests and have created a
> > controller within my web app that allows Selenium to create data by

> > doing aHTTPGET with some URL parameters.

oldpasha

unread,
Apr 6, 2010, 3:31:29 PM4/6/10
to Selenium Users
Hi!

Does no one have an idea how to disable this? Two requests cause me
double memory consumption in my application. There is simply no sense
in making double requests...

Greets,
Oliver


On 1 Apr., 22:04, "Sergey N. Didyk" <sergey.di...@gmail.com> wrote:
> Hello!
>
> I have got the same problem with Selenium RC 1.0.3 (and Firefox 3.6.2)
>
> Is there a solution?
>

keithdtyler

unread,
Apr 12, 2010, 10:25:47 PM4/12/10
to Selenium Users
This is new behaviour in 1.0.3. While it's true that HEAD should
technically not cause a change, it is also true that User-Agents
should not send HEAD on GET/POST requests but only on static content.
"Be conservative in what you send", etc.

We have this problem and we have solved it by rolling back to RC
1.0.1. I presume it is a change in Core underlying but I can't
diagnose it further. I hope it is changed back because we cannot stay
at an old version forever.

qaessentials

unread,
Apr 22, 2010, 11:19:06 AM4/22/10
to Selenium Users
Not sure if anyone is interested but I figured out a slight hack to
this problem. I didn't have much time to spend on it so there might
be a better way but here is what I did. I compared the Selenium Core
1.0.1 to the 1.0.3 and I found this new comment in the code for the
doOpen function.

* @param ignoreResponseCode (optional) turn off ajax head request
functionality

So rather then figuring out where doOpen is called from I simply
opened the selenium-server.jar and edited the /core/scripts/selenium-
api.js file. After the line,

"Selenium.prototype.doOpen = function(url, ignoreResponseCode) {"

I added

ignoreResponseCode = "true";

I then closed the file, re-jarred the selenium-server.jar file and
restarted the selenium server.

Hope that helps.

PS. Not sure what the affect of turning off the HEAD request is.
Things seem to work fine for me but if I run into any problems I'll
update this thread.


On Apr 12, 10:25 pm, keithdtyler <kty...@gmi-mr.com> wrote:
> This is new behaviour in 1.0.3. While it's true thatHEADshould
> technically not cause a change, it is also true that User-Agents
> should not sendHEADon GET/POST requests but only on static content.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

endium

unread,
Apr 25, 2010, 4:46:01 PM4/25/10
to Selenium Users
After looking through the selenium RC source code, I found that you
can prevent this extra HEAD request by specifying 'true' in the open
request.
something like: open('myurl', 'true')

Note that this is a string parameter! I couldn't get it to work at
first because i was passing a boolean.

spatel

unread,
May 6, 2010, 6:18:43 AM5/6/10
to Selenium Users
This problem is also stopping us from upgrading to 1.0.3.

This issue has been logged against selenium here:
http://code.google.com/p/selenium/issues/detail?id=462

mam_p

unread,
May 7, 2010, 1:35:57 PM5/7/10
to Selenium Users

You're good! This solved my problem immediately and was soooo
simple! I posted it on the bug report. And I urge everyone on this
thread to immediately go to the bug report at
http://code.google.com/p/selenium/issues/detail?id=462 and click on
the star in the upper left corner to vote for this problem to be
fixed!

--mam-p


> something like: open('myurl', 'true')

PhatBaja

unread,
May 8, 2010, 12:22:11 AM5/8/10
to Selenium Users
If you're using Ruby and the selenium-client gem, you can simply patch
gem. Edit the following file:

/Library/Ruby/Gems/1.8/gems/selenium-client-1.2.7/lib/selenium/client/
generated_driver.rb

and replace:

def open(url)
remote_control_command("open", [url,])
end

With:

def open(url,ignoreResponseCode=true)
remote_control_command("open", [url,ignoreResponseCode])
end

Adam Goucher

unread,
May 8, 2010, 8:16:41 AM5/8/10
to seleniu...@googlegroups.com
This has already been fixed in svn and will be avail in either the next
1.x or 2.x build. In the meanwhile, you can send the string 'true'
(minus the 's) as the second parameter to open.

-adam
Reply all
Reply to author
Forward
0 new messages