51Testing软件测试论坛

标题: 有哪位高手知道robot里的SQAGetProperty的用法? [打印本页]

作者: gabriel    时间: 2005-6-8 14:23
标题: 有哪位高手知道robot里的SQAGetProperty的用法?
有哪位高手知道robot里的SQAGetProperty的用法?我看了帮助,还不是很明白,希望有知道的高手不吝赐教啊
在线等待-------
谢谢啦
作者: winterwindy    时间: 2005-6-9 09:22
获取对象的方法和属性
SQAGetProperty(recMethod$, property$, value)
recMethod$ :The recognition method values you use to identify an object
property$:是你所要读取的属性的名称, 它是区分大小写的。
Result:函数的返回值 (见备注)
Value:对象的属性或取值
然后可以运用if 语句与预期结果进行比较,来达到测试的目的
作者: winterwindy    时间: 2005-6-9 09:22
Result = SQAGetProperty (ObjectRec, "State", CheckState)
If Result = sqaSuccess And CheckState = 0 Then
CheckBox Click, ObjectRec
End If
Result:
0        sqaSuccess        Command executed successfully.
1001        sqaNoObjectSpecified        recMethod is empty.
1002        sqaInvalidRecString        Invalid syntax in recMethod.
1003        sqaObjectNotFound        The specified object could not be found.
1004        sqaNoPropertySpecified        The property$ argument is empty.
1005        sqaPropertyNotFound        The specified property could not be found.
1006        sqaErrorGettingProperty        An error occurred while getting a property value.
1007        sqaArraysNotSupported        No index was specified for an array of property values.
1008        sqaPropertyIsNotArray        An index was specified for a property that does not contain an array of values.
1009        sqaPropertyHasNoValue        The property has no value or is currently not applicable. A property that has no value is not the same as a property with a value of 0 or null. For example, the ItemSelected property for an empty list box has no value.
1010        sqaPropertyNotSupported        The property is not supported. This status typically results when the operating system you are testing on does not support a property ?for example, the NumbersOnly property for an edit box is not supported under 16-bit Windows.
1011        sqaUnableToConvertString        Cannot convert the specified property value to a String.
1012        sqaPropertyIsReadOnly        The property value is read-only and cannot be modified.
1013        sqaInvalidDataType        The data type of the property cannot be converted to a Variant. With  SQASetProperty commands, the type (VarType) of Variant cannot be converted to a property.
1014        sqaInvalidPropertyValue        Invalid property value. For example, this error occurs if you try to set the State property for a check box to a value that is not one of the property's choices (Checked or Unchecked).
1015        sqaIndexOutOfBounds        The array index is not within the bounds of the array.
1016        sqaTimeout        The specified object could not be found within the specified time, or (with SQAWaitForPropertyValue) was not equal to the specified time.
1017        sqaNoMethodSpecified        No method was specified in Object Method.
1018        sqaMethodNotFound        The method specified in Object Method does not exist.
1019        sqaErrorInvokingMethod        An error occurred while attempting to execute the method. A likely cause is either that the method does not exist or the method arguments are invalid.
1020        sqaErrorSettingProperty        An error occurred while setting a property value with SQASetProperty.
1030        sqaOutOfMemory        There is not enough memory to run this command.
1031        sqaUserAbort        The operation was canceled ?for example, by pressing F11.
1040        sqaUnknownError        An unknown error occurred.
作者: gabriel    时间: 2005-6-9 09:59
非常感谢winterwindy!谢谢!




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2