Knowledge Base Article

Home Page > Knowledge Base > Rapise

Home Page > Knowledge Base > Rapise > Rapise Desktop

Article Testing MS-Word With Rapise

by Adam S on Tuesday, March 22, 2016

We had some customers that were looking to record some tests against Microsoft Word 2010. When testing against MS-Word 2010 there are actually two parts to the application:
  • There is the application ribbon (the menus, navigation, etc.)
  • There is the MS-Word text window where your content is actually displayed

This article provides some strategies for dealing with both areas.

The Application Ribbon

The MS-Word 2010 application ribbon implements the Microsoft UIAutomation API for testing, so when recording/learning using Rapise you should use the UIAutomation library:



You can use the standard UIAutomation Spy and library to record and learn any of the objects in the Ribbon:



You will then end up with a test script that interacts with these objects:

    //Select tab:'Insert' in 'Ribbon Tabs'
    SeS('Ribbon_Tabs').DoSelectTab("Insert");
    SeS('Ribbon_Tabs').DoSelectTab("Page Layout");
    SeS('Ribbon_Tabs').DoSelectTab("Home");
    SeS('Microsoft_Word_Document').DoLClick(321, 130);
    SeS('Microsoft_Word_Document').DoSendKeys('hello');
    SeS('Microsoft_Word_Document').DoLDClick(249, 125);

The Text Window

Unlike the application ribbon, the main text area of MS-Word is a giant "object" that Rapise has only limited access to:



This area is best recorded using the Simulated and Generic libraries. You will typically need to use commands: DoSendKeys(...), DoClick(x,y) and DoLDClick(x,y) to click or double-click on specific areas and then select text ready for highlighting:

    SeS('Microsoft_Word_Document').DoLClick(321, 130);
    SeS('Microsoft_Word_Document').DoSendKeys('hello');
    SeS('Microsoft_Word_Document').DoLDClick(249, 125);


Attached to this article is the complete Rapise test script
Attachments
Article Info
Last Updated: 3/22/2016
Article ID: KB200
# Views: 296
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.