Skip to content
natritmeyer edited this page Sep 14, 2010 · 12 revisions

After following the steps in Installation and Setup, you can start writing tests with bewildr.

Probably the first thing you’ll want to do is to start your app and wait for it to be ready to interact with. Here’s how to do that with bewildr:

my_app, main_window = Bewildr::Application.start_app_and_wait_for_window("c:\myApp.exe", "My App 1.0")

You’ll notice that with one line you can start your app and wait for a window to be displayed – the first argument is the path to your exe, the second argument is the title of the window you want to wait for. You can make this more robust by substituting a regex for the string when specifying the window title… the following example does exactly the same thing as above but will allow the test to keep working when the app version number changes:

my_app, main_window = Bewildr::Application.start_app_and_wait_for_window("c:\myApp.exe", "My App [0-9.]+")

Clone this wiki locally