"Rollup" command is used as a bunch of commands in selenium IDE. "Rollup" command is very useful feature in selenium IDE to reduce size of test case. Let me tell you one example for better understanding. Suppose we are testing any mail login software application features considering bellow given scenarios.
Software Test Scenario1 :
- Login in to email account.
- Click on "Inbox" folder.
- Logout
Software Test Scenario2 :
- Login in to email account.
- Click on "Draft" folder.
- Logout
For above scenarios, my test case in selenium IDE will be as bellow.
New Test | ||
Command | Target | Value |
open | Replace with my mail login URL | |
sendKeys | Replace with element id of User ID field | myuserid |
sendKeys | Replace with element id of password field | mypassword |
clickAndWait | Replace with element id of login button | |
click | Replace with element id of inbox folder | |
clickAndWait | Replace with element id of signout button | |
open | Replace with my mail login URL | |
sendKeys | Replace with element id of User ID field | myuserid |
sendKeys | Replace with element id of password field | mypassword |
clickAndWait | Replace with element id of login button | |
click | Replace with element id of Draft folder | |
clickAndWait | Replace with element id of signout button |
Now Using Rollup Command, above test case will be as bellow.
New Test | ||
Command | Target | Value |
rollup | logincommands | |
click | Replace with element id of inbox folder | |
clickAndWait | Replace with element id of signout button | |
rollup | logincommands | |
click | Replace with element id of Draft folder | |
clickAndWait | Replace with element id of signout button |
Now you will think how this will works. Before using "Rollup" command, you need to create userextension-rollup.js file and need to attach it with selenium IDE.
I created sample userextension-rollup.js. Click here to download it. Attach that file as a user extension with selenium IDE. Click here to know how to attach user extension file with selenium IDE. (Replace all targets with real id or name or xpath of targeted element before attaching file). After attaching file, copy paste above test case in your selenium IDE.
In this way, you can use 'Rollup' command with selenium IDE when you need to use bunch of commands frequently in same test case or different test cases.
Nice trip!
ReplyDeleteThat's nice. Thank you!
ReplyDeleteI'm wondering if I have to write an userextension for every rollup I want to use.
It is just copy&paste all the commands, targets and values from the Source tab in the IDE. What a stupid work...
It would be fantastic if I could just mark the commands for the rollup in the IDE an create the userextension by mouseclick.
Is there any posibility to do so?
can we use roll up rules to include aother test suite within a test suite?
ReplyDeleteI am not sure if any way.. Please update me too if find anywhere.
Deletecan we use roll up rules with other user-extension files like sideflow?
ReplyDeleteYes, user-extensions.js is just that... user extensions. You can have as much JavaScript as you would like in that file. So just edit the file and add all the code you want to use in a single file including your SideFlow and your RollupManager configuration.
ReplyDeleteAlso, since the user-extensions.js is the last one loaded on the page... you have full access to Selenium's JavaScript objects and API.
I don't see in Selenium IDE how to use the GUI to create the rollups... However, you're more than welcome to program it in JavaScript and contribute it back to the Selenium IDE project at:
https://github.com/SeleniumHQ/selenium
More precisely the IDE code lives at:
https://github.com/SeleniumHQ/selenium/tree/master/ide
Selenium IDE itself is a Firefox extension. If you don't know how to develop one see:
https://developer.mozilla.org/en-US/Add-ons/Overlay_Extensions/Firefox_addons_developer_guide/Firefox_extensions_and_XUL_applications
Any Replacement button for Click? if i want to click on login button.. can i use any other button>??
ReplyDeleteHi, can you help me on using mutliple rollup.js in selenium IDE. I have tried uploading 2 rollup.js but only one is identified by selenium IDE command rollup.
ReplyDeleteHi, can you help me on using mutliple rollup.js in selenium IDE. I have tried uploading 2 rollup.js but only one is identified by selenium IDE command rollup.
ReplyDeleteInstead of uploading multiple files, you should include the rollup rules in one javascript file like this:
Deletevar manager = new RollupManager();
manager.addRollupRule({
name: 'name_rule1',
description: 'description of rule1',
args: [
// include arguments here
],
commandMatchers: [],
getExpandedCommands: function(args) {
var commands = [];
// include commands here
return commands;
});
manager.addRollupRule({
name: 'name_rule2',
description: 'description of rule2',
args: [
// include arguments here
],
commandMatchers: [],
getExpandedCommands: function(args) {
var commands = [];
// include commands here
return commands;
});