Testim Docs JA

Tricentis Testim ユーザー制作日本語翻訳ドキュメント

要素属性の検証(モバイル)

Testim Docs

要素属性検証では、画面上の要素が持つ属性値を検証できます。

Validate Element Attribute ステップの追加

Validate Element Attribute を追加するには:

  1. 検証を追加したい位置の (矢印記号) にカーソルを合わせます。

ステップ追加矢印

アクションのオプションが表示されます。

  1. Toggle breakpoint ボタンをクリックします。

CLI

  1. Run test ボタンをクリックし、ブレークポイントまでテストを実行します。

ステップ追加矢印

  1. 再び (矢印記号) にカーソルを合わせ、「M」(Testim 定義済みステップ)をクリックします。
    Predefined steps メニューが開きます。

ステップ追加矢印

  1. Validations をクリックします。Validations メニューが展開されます。メニューをスクロールして Validate element attribute を選択します。

検証

  1. AUT ウィンドウで検証対象の要素を選択します。検証の設定には要素の属性名が必要です。

検証

  1. Element Attribute Validation フォームが表示されます。

検証

  1. Attribute name に検証したい属性名を入力します(例: checkablecheckedclassNameclickable)。利用可能な属性の一覧は List of possible attributes を参照してください。
  2. Expected value に期待値を入力します(例: true)。

Testim はテスト実行時に、選択した要素の属性が期待値を持つかどうかを検証します。

  1. OK をクリックします。Editor に「Validate element attribute」ステップが追加され、ステップ内に選択要素のサムネイルが表示されます。
  2. 検証ステップの後にある Toggle Breakpoint ボタンをクリックしてブレークポイントを削除します。

Validate element attribute ステップの修正

選択要素を変更したい場合は、ステップを削除して録り直す必要はありません。別の要素に再割り当てできます。あるいは、要素を選び直さずに Attribute name / Expected value の値だけを編集することも可能です。検証ステップで選択要素を再割り当てするには:

  1. 要素を再割り当てしたいステップの左側にカーソルを合わせ、Toggle breakpoint ボタンをクリックします。
  2. Run test ボタンをクリックし、ブレークポイントまでテストを実行します。
  3. 要素を再割り当てしたいステップにカーソルを合わせ、Show Properties アイコンをクリックします。

CLI

右側に Properties パネルが表示されます。

  1. Target element サムネイルにカーソルを合わせてオプションを表示し、Reassign をクリックします。

CLI

  1. AUT ウィンドウで、新しく選択したい要素を特定しクリックします。
    選択された要素が Properties パネルの Target element ボックスに表示されます。
  2. Attribute name に新しい要素の属性名を入力します。
  3. Expected value に新しい属性の期待値を入力します。
  1. 要素を再割り当てしたステップの左側にある Toggle Breakpoint ボタンをクリックしてブレークポイントを削除します。

元の要素のプロパティを編集するには:

  1. 要素を再割り当てしたいステップにカーソルを合わせ、Show Properties アイコンをクリックします。

CLI

右側に Properties パネルが表示されます。

  1. Properties パネルの Attribute name フィールドに、要素の新しい属性名を入力します。
  2. Properties パネルの Expected value フィールドに、属性の新しい期待値を入力します。

属性

利用可能な属性一覧

iOS 属性(Appium 使用時)

  • checkable
  • checked
  • {class,className}
  • clickable {content-desc,contentDescription}
  • enabled
  • focusable
  • focused
  • {long-clickable,longClickable}
  • package
  • password
  • {resource-id,resourceId}
  • scrollable
  • selection-start
  • selection-end
  • selected
  • {text,name}
  • hint
  • extras
  • bounds
  • displayed
  • contentSize

Android 属性

  • UID
  • accessibilityContainer
  • accessible
  • enabled
  • frame
  • index
  • label
  • name
  • rect
  • selected
  • type
  • value
  • visible
  • wdAccessibilityContainer
  • wdAccessible
  • wdEnabled
  • wdFrame
  • wdIndex
  • wdLabel
  • wdName
  • wdRect
  • wdSelected
  • wdType
  • wdUID
  • wdValue
  • wdVisible