Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.
jarib edited this page Aug 14, 2010 · 22 revisions

How do I turn off logging? It’s killing me!

Either instantiate the Browser with

browser = Celerity::Browser.new(:log_level => :off)

or set it later

browser.log_level = :off

Finding elements by :index is not doing what I expect.

To stay compatible with Watir, locating elements by :index or fetching elements from ElementCollection subclasses is 1-indexed.
To change this to zero-index, versions >= 0.0.6.10 lets you set

Celerity.index_offset = 0

How can I find elements that use non-ASCII characters?

Celerity encodes all strings as UTF-8, so if you save your test scripts as UTF-8 everything should work fine.
To make Watir use UTF-8, add this line to your test suite (WTR-219):

WIN32OLE.codepage = WIN32OLE::CP_UTF8 

Can I watch my tests execute?

Celerity uses HtmlUnit, a headless Java browser library, to interact with web pages, which makes it a lot faster than driving
a real browser at the cost of not having any visual feedback from your tests. To work around this you can use one of apps from the CelerityViewers repo to simulate driving a browser. Celerity won’t actually drive these, but sends them an HTML string over DRb on every page load.

How do I deal with pages that make Ajax calls?

See Ajax.

Troubleshooting

Celerity doesn’t work with Test::Unit’s autorun

This is caused by a JRuby bug in versions pre-1.2.
Update to JRuby >= 1.2 to get rid of this problem.

I’m getting an error from DRb

This is caused by a JRuby bug, and only appears when running off jruby-complete.jar. Until the bug is fixed, you can solve the problem by doing a proper install of JRuby or adding this:

require "thread.rb"
Clone this wiki locally