2016-08-09 7 views
0

私はcalabash-androidを使用してandroid appの自動テストスクリプトを開発する予定です。 しかし、私はページ下の中で、「登録」ボタンを照会/タッチする方法がわからない: enter image description herecalabash-androidでWebViewの詳細情報を取得する方法

私はひょうたんコンソールに「『*』クエリ」にしようとしたが、 ボタンについての情報を取得することはできません。クエリの出力:

irb(main):002:0> query "*" 
[ 
    [0] { 
         "id" => nil, 
        "enabled" => true, 
     "contentDescription" => nil, 
        "visible" => true, 
         "tag" => nil, 
       "description" => "com.android.internal.policy.impl.PhoneWindow$De 
corView{b11eeb10 V.E..... R.....I. 0,0-768,1134}", 
        "class" => "com.android.internal.policy.impl.PhoneWindow$De 
corView", 
         "rect" => { 
      "center_y" => 617, 
      "center_x" => 384, 
       "height" => 1134, 
        "y" => 50, 
       "width" => 768, 
        "x" => 0 
     } 
    }, 
    [1] { 
         "id" => nil, 
        "enabled" => true, 
     "contentDescription" => nil, 
        "visible" => true, 
         "tag" => nil, 
       "description" => "android.widget.LinearLayout{b10779d0 V.E..... . 
.....I. 0,0-768,1134}", 
        "class" => "android.widget.LinearLayout", 
         "rect" => { 
      "center_y" => 617, 
      "center_x" => 384, 
       "height" => 1134, 
        "y" => 50, 
       "width" => 768, 
        "x" => 0 
     } 
    }, 
    [2] { 
         "id" => "content", 
        "enabled" => true, 
     "contentDescription" => nil, 
        "visible" => true, 
         "tag" => nil, 
       "description" => "android.widget.FrameLayout{b1234b00 V.E..... .. 
....I. 0,0-768,1134 #1020002 android:id/content}", 
        "class" => "android.widget.FrameLayout", 
         "rect" => { 
      "center_y" => 617, 
      "center_x" => 384, 
       "height" => 1134, 
        "y" => 50, 
       "width" => 768, 
        "x" => 0 
     } 
    }, 
    [3] { 
         "id" => nil, 
        "enabled" => true, 
     "contentDescription" => nil, 
        "visible" => true, 
         "tag" => nil, 
       "description" => "android.widget.LinearLayout{b11ecf40 V.E..... . 
.....I. 0,0-768,1134}", 
        "class" => "android.widget.LinearLayout", 
         "rect" => { 
      "center_y" => 617, 
      "center_x" => 384, 
       "height" => 1134, 
        "y" => 50, 
       "width" => 768, 
        "x" => 0 
     } 
    }, 
    [4] { 
         "id" => "NoResourceEntry-6", 
        "enabled" => true, 
     "contentDescription" => "Web View", 
        "visible" => true, 
         "tag" => nil, 
       "description" => "org.apache.cordova.inappbrowser.InAppBrowser$6$ 
5{b108af68 VFEDHVC. .F....I. 0,0-768,1134 #6}", 
        "class" => "org.apache.cordova.inappbrowser.InAppBrowser$6$ 
5", 
         "rect" => { 
      "center_y" => 617, 
      "center_x" => 384, 
       "height" => 1134, 
        "y" => 50, 
       "width" => 768, 
        "x" => 0 
     } 
    } 
] 

私にいくつかの提案をお願いしますか?どうもありがとう!

+0

アプリ:ネイティブまたはハイブリッドですか? –

+0

ハイブリッド。ありがとう! – Stephen

答えて

0

私はあなたのアプリがハイブリッドアプリだと考えていると答えています。これはネイティブアプリではうまくいきません。疑わしい。
あなたはDOM内のすべての要素に関するいくつかの情報を取得したい場合は、この命令を使用する必要があります

query("systemWebview css:'*'") 

命令は、Webビュー上のすべての要素を持つ配列を返します。

query("systemWebview css:'*' {textContent CONTAINS 'Register'}") 

チェック結果と教えて:あなたはのTextContentは、あなたがこれを実行する必要があります(あなたはそれが簡単に見つけましょう)単語登録が含まれている要素のみを取得したい場合は、などのクラス、idを、取得します私:それはあなたが欲しいものですか?

+0

私はcalabash-androidコンソールで2つのコマンドを確認しましたが、何も返されません。ちょうど空[] – Stephen

+0

まあ。まず、ハイブリッドアプリだと思いますか?他の方法では、あなたのアプリはWebビューを表示しません。 –

+0

このアプリの種類はどのように確認できますか?私はこれらのことの初心者です。 – Stephen

関連する問題