RVL-based Module
Let's take a look how it works. First we will create a new Test Automation Framework.
![](/Support/Attachment/140764.aspx)
Name it PageObjectsDemo and choose Web test type.
![](/Support/Attachment/140765.aspx)
Choose Chrome browser profile.
![](/Support/Attachment/140766.aspx)
In the Object Tree pane right click Modules/Pages and choose Create Module/Page Object.
![](/Support/Attachment/140767.aspx)
Give it a name LoginPage and click Create button.
![](/Support/Attachment/140769.aspx)
We are going to create an RVL module, so choose RVL option.
![](/Support/Attachment/140770.aspx)
LoginPage RVL will be created.
![](/Support/Attachment/140771.aspx)
And LoginPage module will appear in the Object Tree.
![](/Support/Attachment/140772.aspx)
Our page object has a default action DoAction, you may see it's name in RVL tabs. Double click it and change to DoLogin.
![](/Support/Attachment/140773.aspx)
Define two input parameters for this action: USR, PWD.
![](/Support/Attachment/140774.aspx)
We will now record a login sequence of steps on https://libraryinformationsystem.org with credentials librarian/librarian. Make sure that the LoginPage RVL document is still active and click Record button on the toolbar. You will see the Choose Test Case dialog with LoginPage selected.
![](/Support/Attachment/140775.aspx)
Click OK and record the login scenario. Enter the URL when prompted.
![](/Support/Attachment/140776.aspx)
Click the Log In link.
![](/Support/Attachment/140777.aspx)
Enter username and password and click Log In button.
![](/Support/Attachment/140778.aspx)
Click Finish in the Recording Activity dialog.
![](/Support/Attachment/140779.aspx)
Select line 10 and click Insert Here button.
![](/Support/Attachment/140780.aspx)
You will see the steps inserted.
![](/Support/Attachment/140781.aspx)
Bind Username and Password fields to USR and PWD input parameters.
![](/Support/Attachment/140782.aspx)
DoLogin action is ready to use. Let's now create one more sheet DoLogout.
![](/Support/Attachment/140783.aspx)
Click Record on the toolbar, click OK in the Choose Test Case dialog. Rapise will reconnect to Chrome. Just click on Log Out link.
![](/Support/Attachment/140784.aspx)
Click Finish in the Recording Activity dialog.
![](/Support/Attachment/140785.aspx)
Insert the recorded steps, remove the default parameter for the DoLogout action. You will see the result.
![](/Support/Attachment/140787.aspx)
We are now ready to create the very first test case.
![](/Support/Attachment/140788.aspx)
In CheckLogin RVL use LoginPage module like this:
![](/Support/Attachment/140789.aspx)
You may now run CheckLogin test case, just click Play icon against the test case name.
![](/Support/Attachment/140790.aspx)
After execution you will see the report:
![](/Support/Attachment/140791.aspx)
If you wish to close the browser at the end of each test case please refer to Recommended way of executing code before and after each test case.
JavaScript-based Module
Let's now create JavaScript module with name GridModule.
![](/Support/Attachment/140792.aspx)
![](/Support/Attachment/140793.aspx)
![](/Support/Attachment/140794.aspx)
GridModule.js will be created and opened.
![](/Support/Attachment/140795.aspx)
Change it to
/**
* @PageObject GridModule description
*/
SeSPageObject("GridModule");
/**
* Get the number of rows in the main grid
*/
function GridModule_GetRowCount() /**number*/
{
var /**HTMLObject*/ tableObj = Navigator.SeSFind("//table[@class='dataGrid']");
if (tableObj)
{
var rowCount = tableObj.DoDOMQueryValue("count(.//tr)");
return rowCount - 1;
}
return -1;
}
Now we may use it in a test case. Let's create new test case with name CheckGrid by cloning existing test case CheckLogin.
![](/Support/Attachment/140796.aspx)
Make sure that you are logged into the Library Information System in Chrome and record click on Book Management link.
![](/Support/Attachment/140797.aspx)
Then update the CheckGrid RVL to look like this:
![](/Support/Attachment/140798.aspx)
Logout from the Library Information System in Chrome and play CheckGrid test. You will see the report.
![](/Support/Attachment/140799.aspx)
Note: the framework created in this article is attached.