Job Hunt Day 6: Rational Robot keyword driven scripting

Rational Robot is a capture/playback tool. On playback sometimes It has a problem with focusing on a web browser because it records the setting of playback context using literal strings, usually a string literal title of an html document and it puts it in it’s Caption parameter. Here is a a short way one can use custom keyword command for setting a focus and waiting an a web page to load before running next command. It’s a mini automation framework. You can read more about automation frameworks by looking at Carl Nagle’s RRASF which is really but to implement it on a project you need management support. Well worth it.

But for now let’s make your own mini framewor. Here is a simple example (really really simple). We create a keyword command ‘SetFocus’ with no parameters to use in your scripts to focus on a webpage and wait for page to load before proceeding.

Set up a ‘library.sbl’ where you define a procedure called ’setFocus’ like this:

‘****************************************************

Sub setFocus

’set focus to main app browser frame and wait for page to load

‘REQUIRE: use constants to define a TAG and FRAME targets

‘****************************************************

Window SetContext, WINDOW_TAG, “”

Browser SetFrame, WINDOW_FRAME,”"

Browser NewPage, “”, “”

End sub

Then define your global constants (in the same sbl file)

‘Used in StartBrowser command (You can call your AUT any name you need.

global const WINDOW_TAG$ = “WindowTag=AUT”

‘in this calse ‘main’ is the id we want to work on.

global const WINDOW_FRAME$ = “Type=HTMLFrame;HTMLId=main”

And now in your script you can use the command ‘SetFocus’ before running other commands against your target window. In your script you must include the library with ‘$Include “libraryname.sbl” directive.

I think Rational Robot is cumbersome procedural hog machine. But for people who have learned how to use .sbl and .sbh files and modularize subs (and never ever ever use the DataPool utility but instead hook up a database directly to your scritps) then Rational Robot is a nice test automation tool.

Technorati Tags:

close Reblog this comment
blog comments powered by Disqus