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