setProperty
public void setProperty(java.lang.String propertyName,
java.lang.Object value)Sets the specified property to the specified value. Note that this directly modifies the object in the software under test; therefore, it should be done with extreme care. Avoid using setProperty whenever possible because it allows you to modify the software under test in ways that a typical user cannot. If you use this method, be sure to discuss its use with the developers of the software you are testing.
A common use for this method is to set the text value of an input or edit control. This may be simpler and more reliable than playing back a sequence of keys to update the control. However, you should be aware that even in this simple use case, there may be problems. For example, the developer may watch the keys going to the control and may have code to prevent certain characters from appearing. By setting the property directly, you may be circumventing the normal error handling.
Most commonly, the value is a value class - an object that can be recreated in the process of the software under test. However, the value can also be a TestObject containing a reference to an object in the software under test, for example, a TestObject returned by a previous call to getProperty.
Parameters:
propertyName - the name of the property
value - the value used to set the property