Knowledge Base Article

Home Page > Knowledge Base > Rapise

Home Page > Knowledge Base > Rapise > Rapise Desktop

Article Getting the State of a Win32 object using Rapise

by Adam S on Monday, October 21, 2013

Sometimes you need to be able to test the state of a specific Win32 object in Rapise to see if it is enabled, disabled, is activated, etc. This sample illustrates how to get the numeric and textual value of the object's state.

To get the state of an object in Rapise, please do the following:

  1. Start the application being tester.
  2. Learn the object that you want to get the state of using Record/Learn.
  3. Once you have learned the object, use the following code to display the numerical and textual value of its state:

 //This sample illustrates how to access the object state of an Accessible (MSAA) Win32 object
 //It uses the Two Dialogs sample application that ships with Rapise.

 
 //First get the object state as a number using the normal GetState() function:
 Tester.Message(SeS('Please_enter_your_name_').GetState());
  
 //Next get the object state as a string using the private stateString property:
 var ao = SeS('Please_enter_your_name_');
 var state = ao.stateString;
 Tester.Message(state);

 

Attachments
Article Info
Last Updated: 10/21/2013
Article ID: KB63
# Views: 1388
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.