[Celerity-users] Javascript execution hangs - Need help

vamsi sudhir vamsisudhir at gmail.com
Mon Jul 11 05:35:09 EDT 2011


Hello,

We are using Celerity (JRuby wrapper around Watir, using HtmlUnit as the
underlying browser) to navigate thru the webpage, (
https://www.sos.ok.gov/corp/bulkorder/bulkDefault.aspx).  We have
encountered an issue with java script on this webpage.

Javascript execution hangs when we try to access the URL
https://www.sos.ok.gov/cart/contact.aspx?ReturnUrl=/corp/bulkorder/bulkEntry.aspxby
clicking the "Place order" link on
https://www.sos.ok.gov/corp/bulkorder/bulkDefault.aspx'

Using java script debugger we found that JS hangs at this piece of code.

*if (!ValidatedTextBoxOnKeyPress(event)) { event.cancelBubble = true; if
(event.stopPropagation) event.stopPropagation();
      return false; }
*
Also attached the entire java script file (okjs.zip)

Javascript needs to be enabled to navigate through this website. So we can't
disable javascript in this case.
Also java script timeout doesnt seem to be working here.
Is this a bug in htmlunit?

Here is the code for your reference.

*require 'rubygems'
require 'celerity'
proxyProtocol, proxyHost, proxyPort = ENV["http_proxy"].split(':')
proxyHost = proxyHost.scan(%r"//(.*)")[0][0]
browser = Celerity::Browser.new( { :browser => :firefox3, :proxy =>
proxyHost + ':' + proxyPort } )
browser.webclient.setJavaScriptEnabled(true)
browser.css = false
browser.secure_ssl = false
### HtmlUnit::Util::WebClientUtils.attachVisualDebugger(browser.webclient)
browser.goto 'https://www.sos.ok.gov/corp/bulkorder/bulkDefault.aspx' ###
This works alright.
browser.wait
puts "clicking Place Order"
browser.button(:id,'ctl00_DefaultContent_buttonSubmit').click  ### Here's
where it hangs
browser.wait
puts browser.html
*

Thanks
Vamsee.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/celerity-users/attachments/20110711/646294e6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: okjs.zip
Type: application/zip
Size: 4873 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/celerity-users/attachments/20110711/646294e6/attachment.zip>


More information about the Celerity-users mailing list