Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Javascript Execution Hangs - Need help #53

@VamCATS

Description

@VamCATS

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions