Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/223.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何编写查询以获取progressbar是否存在_Android_Calabash - Fatal编程技术网

Android 如何编写查询以获取progressbar是否存在

Android 如何编写查询以获取progressbar是否存在,android,calabash,Android,Calabash,我已经编写了查询检查progressbar是否出现在视图中。 我发出以下命令,但它不起作用 query("progressbar class:'android.widget.ProgressBar'") 当我发出query(“*”)命令时,它将作为元素之一返回 [8] { "id" => "progress", "enabled" => true, "contentDescription" =

我已经编写了查询检查progressbar是否出现在视图中。 我发出以下命令,但它不起作用

query("progressbar class:'android.widget.ProgressBar'")
当我发出query(“*”)命令时,它将作为元素之一返回

[8] {
                      "id" => "progress",
                 "enabled" => true,
      "contentDescription" => nil,
                   "class" => "android.widget.ProgressBar",
                    "rect" => {
          "center_y" => 419.0,
          "center_x" => 194.0,
            "height" => 72,
                 "y" => 383,
             "width" => 72,
                 "x" => 158
      },
             "description" => "android.widget.ProgressBar@4138e948"
  },
任何人都知道如何使用查询命令获取progressbar元素吗


提前感谢

晚一点总比永远不要尝试这样的事情好

  def check_loading
   wait_for_elements_exist([query_progress_bar], :timeout => 22, :timeout_message => "No Progress Bar")
  end

  def query_progress_bar
   'android.widget.ProgressBar'
  end
如果要查找某个类,只需查询类名,如

query('android.widget.ProgressBar')
您可以像在您的案例中那样添加信息

query('android.widget.ProgressBar id:"progress"')