如何通过calabash-android获取WebView详细信息?

时间:2016-08-09 08:22:43

标签: calabash calabash-android

我计划使用calabash-android为Android应用程序开发自动化测试脚本。      但我不知道如何触摸/查询"注册"下面的按钮:      enter image description here

我试图查询" *"'在calabash控制台,但无法获得有关的任何信息 按钮。查询输出:

Private Sub All_Sheets_Click()
Dim x As Integer
Dim i As Integer
 x = 1
 For i = 1 To 30
 With Userform1
 .Controls("SheetCheckBox" & x).value = True
 End With
 x = x + 1
 Next i
End Sub
Private Sub Undo_Click()
Dim x As Integer
Dim i As Integer
 x = 1
 For i = 1 To 30
 With Userform1
 .Controls("SheetCheckBox" & x).value = False
 End With
 x = x + 1
 Next i
End Sub
    Private Sub UserForm_Initialize()
    Dim numsht As Long
    numsht = ThisWorkbook.Worksheets.Count
    If numsht = 1 Then
            SheetCheckBox1.Visible = True
        ElseIf numsht = 2 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
        ElseIf numsht = 3 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
        ElseIf numsht = 4 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
        ElseIf numsht = 5 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
        ElseIf numsht = 6 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
        ElseIf numsht = 7 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
        ElseIf numsht = 8 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
        ElseIf numsht = 9 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
        ElseIf numsht = 10 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
        ElseIf numsht = 11 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
        ElseIf numsht = 12 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
        ElseIf numsht = 13 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
        ElseIf numsht = 14 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
        ElseIf numsht = 15 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
        ElseIf numsht = 16 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
        ElseIf numsht = 17 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
        ElseIf numsht = 18 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
        ElseIf numsht = 19 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
        ElseIf numsht = 20 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
        ElseIf numsht = 21 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
            SheetCheckBox21.Visible = True
        ElseIf numsht = 22 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
            SheetCheckBox21.Visible = True
            SheetCheckBox22.Visible = True
        ElseIf numsht = 23 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
            SheetCheckBox21.Visible = True
            SheetCheckBox22.Visible = True
            SheetCheckBox23.Visible = True
        ElseIf numsht = 24 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
            SheetCheckBox21.Visible = True
            SheetCheckBox22.Visible = True
            SheetCheckBox23.Visible = True
            SheetCheckBox24.Visible = True
        ElseIf numsht = 25 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
            SheetCheckBox21.Visible = True
            SheetCheckBox22.Visible = True
            SheetCheckBox23.Visible = True
            SheetCheckBox24.Visible = True
            SheetCheckBox25.Visible = True
        ElseIf numsht = 26 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
            SheetCheckBox21.Visible = True
            SheetCheckBox22.Visible = True
            SheetCheckBox23.Visible = True
            SheetCheckBox24.Visible = True
            SheetCheckBox25.Visible = True
            SheetCheckBox26.Visible = True
        ElseIf numsht = 27 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
            SheetCheckBox21.Visible = True
            SheetCheckBox22.Visible = True
            SheetCheckBox23.Visible = True
            SheetCheckBox24.Visible = True
            SheetCheckBox25.Visible = True
            SheetCheckBox26.Visible = True
            SheetCheckBox27.Visible = True
        ElseIf numsht = 28 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
            SheetCheckBox21.Visible = True
            SheetCheckBox22.Visible = True
            SheetCheckBox23.Visible = True
            SheetCheckBox24.Visible = True
            SheetCheckBox25.Visible = True
            SheetCheckBox26.Visible = True
            SheetCheckBox27.Visible = True
            SheetCheckBox28.Visible = True
        ElseIf numsht = 29 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
            SheetCheckBox21.Visible = True
            SheetCheckBox22.Visible = True
            SheetCheckBox23.Visible = True
            SheetCheckBox24.Visible = True
            SheetCheckBox25.Visible = True
            SheetCheckBox26.Visible = True
            SheetCheckBox27.Visible = True
            SheetCheckBox28.Visible = True
            SheetCheckBox29.Visible = True
        ElseIf numsht = 30 Then
            SheetCheckBox1.Visible = True
            SheetCheckBox2.Visible = True
            SheetCheckBox3.Visible = True
            SheetCheckBox4.Visible = True
            SheetCheckBox5.Visible = True
            SheetCheckBox6.Visible = True
            SheetCheckBox7.Visible = True
            SheetCheckBox8.Visible = True
            SheetCheckBox9.Visible = True
            SheetCheckBox10.Visible = True
            SheetCheckBox11.Visible = True
            SheetCheckBox12.Visible = True
            SheetCheckBox13.Visible = True
            SheetCheckBox14.Visible = True
            SheetCheckBox15.Visible = True
            SheetCheckBox16.Visible = True
            SheetCheckBox17.Visible = True
            SheetCheckBox18.Visible = True
            SheetCheckBox19.Visible = True
            SheetCheckBox20.Visible = True
            SheetCheckBox21.Visible = True
            SheetCheckBox22.Visible = True
            SheetCheckBox23.Visible = True
            SheetCheckBox24.Visible = True
            SheetCheckBox25.Visible = True
            SheetCheckBox26.Visible = True
            SheetCheckBox27.Visible = True
            SheetCheckBox28.Visible = True
            SheetCheckBox29.Visible = True
            SheetCheckBox30.Visible = True
        Else:
            MsgBox "Need more checkboxes!" & vbNewLine & "Contact Jan Wieland for more details", vbCritical
    End If
    'Uncheck DataCheckBoxes
    SheetCheckBox1.value = False
    SheetCheckBox2.value = False
    SheetCheckBox3.value = False
    SheetCheckBox4.value = False
    SheetCheckBox5.value = False
    SheetCheckBox6.value = False
    SheetCheckBox7.value = False
    SheetCheckBox8.value = False
    SheetCheckBox9.value = False
    SheetCheckBox10.value = False
    SheetCheckBox11.value = False
    SheetCheckBox12.value = False
    SheetCheckBox13.value = False
    SheetCheckBox14.value = False
    SheetCheckBox15.value = False
    SheetCheckBox16.value = False
    SheetCheckBox17.value = False
    SheetCheckBox18.value = False
    SheetCheckBox19.value = False
    SheetCheckBox20.value = False
    SheetCheckBox21.value = False
    SheetCheckBox22.value = False
    SheetCheckBox23.value = False
    SheetCheckBox24.value = False
    SheetCheckBox25.value = False
    SheetCheckBox26.value = False
    SheetCheckBox27.value = False
    SheetCheckBox28.value = False
    SheetCheckBox29.value = False
    SheetCheckBox30.value = False
    End Sub
你能给我一些建议吗?非常感谢!

1 个答案:

答案 0 :(得分:0)

我要回答这个问题,认为您的应用是混合应用。我不确定这适用于原生应用程序。我对此表示怀疑 如果您想获得有关DOM中所有元素的一些信息,您应该使用以下指令:

query("systemWebview css:'*'")

该指令将返回一个包含Web视图中所有元素的数组。您将获得类,ID等。如果您只想获得textContent包含单词Register的元素(这将帮助您更容易找到它),您应该运行:

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

检查结果并告诉我:这是你想要的吗?