Knowledge Base Article

Home Page > Knowledge Base > Rapise

Home Page > Knowledge Base > Rapise > Rapise Desktop

Article Change Object Value or Text

by Jim R. on Thursday, January 7, 2016

This guide describes the different ways that you can change the value of text label of an object.

Rapise provides several alternatives for setting control text:

  • DoSetText() – this is the best approach if the control supports this method. Not all the control types support DoSetText. However if a control does support this method then the control has explicit support for having its text without having to use the IAccessible API.

  • DoSendKeys() - appropriate for most cases. Rapise mimics the end-user behavior by actually sending the key-strokes. This approach is less dependent on a specific control library’s implementation of the IAccessible API.

  • SetValue() – this works for some controls, but not for all. This is because Rapise sets the Value property of the controls using their IAccessible accessibility interface and this depends on the IAccessible implementation of that specific control.

  • SetWindowText – this approach performs a Win32 API call for setting the text. Again, some edit controls accept this SetWindowText call, others do not.

If the text is not changed using the SetValue/SetWindowText command, Rapise will not report an issue. This is because these controls are like Password boxes, you may change the value using these methods, but you cannot query the control to determine what the value is (black-box testing).

Attachments
Article Info
Last Updated: 1/7/2016
Article ID: KB122
# Views: 729
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.