jarib / celerity

This project is no longer maintained.
http://celerity.rubyforge.org/
GNU General Public License v2.0
206 stars 38 forks source link

Javascript Execution Hangs - Need help #53

Open VamCATS opened 13 years ago

VamCATS commented 13 years ago

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.aspx by 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.txt)

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.