Bewildr 0.1.13

[So much for the hope of doing "more frequent releases"...] It’s update time again. A few additions to the API, and a couple of changes. First, the additions:

  • Added a ‘wait_for’ alias to ‘wait_for_existence_of’ – much nicer
  • Added Bewildr::Application#process to allow access to the underlying windows process
  • Added a static ‘attach_to_process_id’ method on Bewildr::Application

Now for the API changes:

  • For combo boxes and list items, calling ‘selected’ will return a Bewildr::Element, not the element’s name. In previous versions, to get a list’s/combobox’s selected item name, you would write: ‘@my_list.selected’. From now on, it’s: ‘@my_list.selected.name’. Same for comboboxes.

Happy bewildring!

Bewildr 0.1.12

Another release of bewildr… a few important changes:

  • (hopefully) fixed waiting-for-window timeout problem (ht: mrwizard82d1)
  • passing :how_many => :all to #get will always return an array regardless of how many elements were found, you no longer have to cater for a nil result – what was I thinking?
  • comboboxes and lists with no items will return an empty array instead of nil when asked for their items
  • added next_sibling and previous_sibling methods to Element

Bewildr is one year old today!

Bewildr is one year old today! The first gem push doesn’t seem that long ago… At almost 2,100 downloads since it launched last year, bewildr is doing quite well – much better than I’d anticipated! It’s the 3rd most downloaded ironruby gem on rubygems.org!

I initially wrote bewildr as a response to a frustrating experience using White through IronRuby. I’m pleased to report that the CMS for the BBC News site (http://www.bbc.co.uk/news) is tested using bewildr (cucumber scenarios executed by Hudson twice a day); and White has been completely retired. The test automation people tell me that using bewildr is a much more pleasant experience than using White ever was – that’s certainly true for me, but then it would be, wouldn’t it :P

Things I need to improve:

  • documentation (rdoc and wiki)
  • more frequent releases
  • remove dirt from the API
  • add more tests
  • make certain defaults configurable (timeouts, etc)
  • add some tutorials

Please keep raising bugs, and let me know what you think!

Bewildr and IronRuby 1.1.2

—UPDATE—

All better now. Bewildr 0.1.11 has just been released that works with IronRuby 1.1.1 and the new 1.1.2.

The problem was this: IronRuby 1.1.2 implements Ruby 1.9.2, while IronRuby 1.1.1 implemented ruby 1.8.6.  Calling .select on a hash in 1.8.6 resulted in a 2D array (daft), whereas doing the same in 1.9.2 returns a new hash. The fix was just to check what version of ruby is being run and if it’s 1.8.6, flatten the result of the .select method, and convert it to a hash. Nice and easy.If it’s 1.9.2, do nothing – it already does what I want.

This exercise also demonstrated the value of automated tests – put in the fix, run the tests in IronRuby 1.1.1. It still works. Flip to 1.1.2 and run the tests again… they all work too. Commit, tag, push the changes, push the new gem version. Done!

gem update bewildr

—Original Post—

Bewildr is not compatible with IronRuby 1.1.2.  I’ll be releasing an update shortly, but for now, stick with IronRuby 1.1.1.

If you’ve installed 1.1.2, you’ll get the following error:

undefined method `flatten' for {:id=>"my_button"}:Hash (NoMethodError)
./lib/bewildr/finder.rb:20:in `condition_for'
./lib/bewildr/element.rb:102:in `get'

I’m on it.

Bewildr 0.1.10

Bewildr development marches on…

For this release there isn’t much new functionality, just the .height and .width methods on Element. There are a couple of bug fixes too. The main reason that this version has come to be is that after making a small tweek to how elements are built, useful rdoc can now be provided! rdoc.info has already gobbled up the code and produced some nice doco. Check it out here:

http://rubydoc.info/gems/bewildr/0.1.10/frames

It’s time to…

gem update bewildr

Bewildr 0.1.9

I’ve just pushed the latest version of bewildr: v0.1.9. New in this release:

  • Bewildr::Application now has proc_id and name methods to return the process ID and the process name
  • A new Bewildr::Mouse class to wrap the old BewildrClickr dll
  • Drag and drop – see here for examples (with thanks to Neil Danson!)
  • Toggle buttons now have toggle_on and toggle_off methods

Next step:

gem install bewildr

Note that there is now a dependency on ActiveSupport >= 3.0

Bewildr 0.1.8

This is a quick release just to add the visible? method to the Element class. It’s not very sophisticated at the moment as it just checks the IsOffscreen property of the underlying AutomationElement object – it’ll get more robust as time goes on.

gem update bewildr

Go! Go! Go!