1 Replies Last post: Sep 6, 2008 10:24 PM by Jian Fang  
Jian Fang Pro 93 posts since
Jun 26, 2008
Currently Being Moderated

Sep 6, 2008 2:56 PM

Tellurium widget prototype - How to create and use widgets in Tellurium

Have you imaged that you have a lot of predefined widgets and you can use the widgets directly for your selenium testing and do not have the burden to work on individual links and buttons?

 

Your dream is coming true with Tellurium widgets. Tellurium provides you the capability to composite UI objects into a widget object and then you can use the widget directly just like using a tellurium UI object. The advantage is that you do not need to deal with the UIs at the link or button level for the widget, you just work on the high level methods. Another advantage is that this widget is reusable. One person defines it and packages as a jar file, anyone can then use it. Isn't this appealing?

 

I am done with the first round of prototype and take the Date Picker widget in the Dojo Java script framework as an example. You can use the Date Picker widget like regular Tellurium UI objects in your UI module.

 

ui.Form(uid: "dropdown", clocator: :, group: "true"){
            TextBox(uid: "label", clocator: [tag: "h4", text: "Dropdown:"])
            InputBox(uid: "input", clocator: [dojoattachpoint: "valueInputNode"])
            Image(uid: "selectDate", clocator: [title: "select a date", dojoattachpoint: "containerDropdownNode", alt: "date"])
            DOJO_DatePicker(uid: "datePicker", clocator: [tag: "div", dojoattachpoint: "subWidgetContainerNode"])
        }

 

Note the DatePicker widget comes with the namespace DOJO to avoid the name collision.

 

One method we defined for the Date picker is selectPrevYear(). Then you can use the method directly in the tests as follows,

 

onWidget "dropdown.datePicker", selectPrevYear

 

For more details, please see the wiki page

 

http://code.google.com/p/aost/wiki/TelluriumWidget

 

and the tellurium trunk for the sub project dojo-widget.

 

You can also use the same way to define your own widgets using Tellurium so that you can always reuse and work on the high level methods. 

 

Your comments and suggestions are welcome.

 

Thanks,

 

Jian

More Like This

  • Retrieving data ...