February 12th, 2015
Once you have learned objects with Rapise, it is time to use them, or modify how you use them. As a primary functional element, buttons are pretty ubiquitous. Submit, Calculate, etc… You push a button for most transactions. This article explains the different operations that can be performed with buttons during automated testing.
Overview of Buttons
The basic use of a button is to click on it to create some change or calculation to process either in the GUI or behind the scenes.
As stated, the basic function of a button is to be the target for a mouse click, however there are several other ways to interact as well. Some buttons have states, up or down, some react differently with left or right click. Some are activated through keystrokes, I could go on but you get the gist, there are several ways to interact with a button.
Rapise Button Commands
Rapise provides for these methods through the various commands available to buttons:
Performs default action for an object. In the case of buttons the default is typically a Left Click. If a technology library does not have a default listed Rapise will default to Left click
- DoAnalogPlay (path to recording,left of analog area,top of analog area)
Plays a previously recorded analog recording using coordinates relative to this object.
- DoClick(clickType, xOffset, yOffset)
If the parameters are left blank Performs left click at the center of an object. Parameters for click type and offset can be added to alter what kind of click (L, LD,M, MD, R, RD, N) or the offset from the top leftmost point of the object
Checks to see if the object is visible on the screen.
Used after DoMouseMove to left click and hold. Make sure to close this with DoLButtonUp to avoid locking the mouse
Closes the loop on DoLButtonDown. Use case would be for a click and drag. I.e. DoMouseMove -> DoLButtonDown -> DoMouseMove -> DoLButtonUp.
By default Performs a left click at the center of an object. With x and y parameters added it will click with the offset from the top left of the object.
By default Performs a left double click at the center of an object or at the specified location.
Same as DoLButtonDown but with the Middle mouse button
Same as DoLButtonUp but with the Middle mouse button
Same as DoLClick with the middle button
Same as DoLDClick with the middle button
Moves mouse cursor to a location relative to the defined objects position.
Same as DoLButtonDown, but for the Right button. Same caveats apply.
Same as DoLButtonUp, but for the Right button. Same caveats apply.
Same as DoLClick for Right Click.
Same as DoLDClick for Right Click.
Sends series of keystrokes to an object.
All these commands, and more, are contained in the help file with Rapise, or online at http://www.inflectra.com/Rapise/Documentation.aspx.
Using these commands you can perform a number of additional actions on an object, using them in sequence you can do even more. Keep these in mind as you are recording the test and you will be able to modify your process to meet the expectations of your test plan more effectively.