コントロールの認識プロパティーと重みの変更

Functional Tester は、認識プロパティーを使用してコントロールを一意的に識別します。 認識分析のために、それぞれの認識プロパティーに対して異なる重みが割り当てられます。 Functional Tester はこれらの値と重みを使用して、再生時にコントロールを識別します。 テストしているコントロールに最も適した認識プロパティーと重みをカスタマイズすることができます。
拡張可能なメソッドが表 1 にリストされています。
表 1. 認識プロパティーのための拡張可能なメソッド
Java .Net
java.util.Hashtable getRecognitionProperties() System.Collections.Hashtable GetRecognitionProperties()
int getRecognitionPropertyWeight(String propertyName) int GetRecognitionPropertyWeight(String propertyName)
注: Functional Tester オブジェクト・ライブラリー機能を使用して、すべてのコントロールの認識プロパティーと重みを XML ファイルとして外部化することもできます。 オブジェクト・ライブラリーについて詳しくは、Functional Tester のヘルプを参照してください。

以下の Java™ サンプルは、新規プロパティー ".priorLabel" を追加の認識プロパティーとして追加します。

import com.rational.test.ft.domain.*;

public class someProxy extends baseProxy
{
 .
 .
 public java.util.Hashtable getRecognitionProperties()
 {
    java.util.Hashtable properties = super.getRecognitionProperties();
    properties.put(".priorLabel", getPriorLabel());
    return properties; 
 }
 .
 .
 .
 public Object getRecognitionPropertyWeight(String propertyName)
 {
    if (propertyName.equals(".priorLabel"))
	return 60;
    return super.getRecognitionPropertyWeight(propertyName);
 } 
}

以下の .Net サンプルは、新規プロパティー ".priorLabel" を追加の認識プロパティーとして追加します。

using Rational.Test.Ft.Domain;

public class AnyProxy:BaseProxy
{
     .
     .
     .
    public override System.Collections.Hashtable GetRecognitionProperties()
    {
        System.Collections.Hashtable properties= base.GetRecognitionProperties(); 
	properties.Add(".priorLabel", GetPriorLabel() );
        return properties;
    }
    .
    .
    .
   public override object GetRecognitionPropertyWeight(string propertyName)
   {
       if (propertyName == ".priorLabel" )
            return 60; 
       return base.GetRecognitionPropertyWeight(propertyName) ;
   }
このプロキシー・コードを正常に開発してデプロイした後、新規認識プロパティー ".priorLabel" がコントロールに対して、プロパティーの重み 60 で追加されます。 これはオブジェクト・マップ・エディターの TestObject の「認識」タブから確認できます。

フィードバック