|
4#
楼主 |
发表于 2008-12-30 13:56:34
|
只看该作者
依然遇到了问题 SetProperty的工作方法好像是先识别object然后对这个object的属性进行修改,基本用在改editbox的值之类的地方:
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
这个和我的想法不大一样,我是想不需要判断当前object是否存在而直接修改ObjectMap里object的某个属性然后应用到后面的测试中,类似于将object的某个属性设置成变量,可以对其进行赋值。我不像修改被测试程序的object的属性,而是修改RFT的ObjectMap中的Object识别的属性来适应不同的Objject 比如不同语言版本中的同一个Button,他们的text不同,我想跑不同的语言的时候调相应的text值来识别控件。
有对这方面研究过的么?谢谢先! |
|